Click here to Skip to main content
15,899,632 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: upside down Bitmap image Pin
Dudi Avramov18-Nov-03 3:10
Dudi Avramov18-Nov-03 3:10 
GeneralOutlook Express extensions Pin
Bartosz Bien17-Nov-03 9:39
Bartosz Bien17-Nov-03 9:39 
QuestionHow to watch static variables while debugging Pin
Hashim Saleem17-Nov-03 9:04
Hashim Saleem17-Nov-03 9:04 
AnswerRe: How to watch static variables while debugging Pin
David Crow17-Nov-03 9:34
David Crow17-Nov-03 9:34 
GeneralRe: How to watch static variables while debugging Pin
Bartosz Bien17-Nov-03 9:40
Bartosz Bien17-Nov-03 9:40 
GeneralRe: How to watch static variables while debugging Pin
David Crow17-Nov-03 9:41
David Crow17-Nov-03 9:41 
GeneralRe: How to watch static variables while debugging Pin
Bartosz Bien17-Nov-03 13:03
Bartosz Bien17-Nov-03 13:03 
GeneralRe: How to watch static variables while debugging Pin
Hashim Saleem17-Nov-03 9:46
Hashim Saleem17-Nov-03 9:46 
Definitely, in order to watch, I have to set a breakpoint. The debugger gives this error message.

CXX0017: Error: symbol "i" not found

What I understand here is that static variables are not created and destroyed when a procedure is called. They have a lifetime of program. Why debugger is showing this message is because, I have set the breakpoint in procedure(), so debugger has a context of procedure(). So, it is unable to provide a watch on "i".

I tried to watch "i" in WinMain() but again WinMain() is also a function. Now, what I left is that declare a global variable, set a breakpoint there and watch "i". Perhaps it work.

The other approach I am using is having a pointer to this static variable "i" in procedure(). In this way, I am able to watch the contents of static variable "i". e.g.

void procedure(void)
{
   static int i;
   int * pi = &i;
   
   ...... code follows ......
}

GeneralRe: How to watch static variables while debugging Pin
David Crow17-Nov-03 9:52
David Crow17-Nov-03 9:52 
GeneralRe: How to watch static variables while debugging Pin
Hashim Saleem17-Nov-03 9:57
Hashim Saleem17-Nov-03 9:57 
GeneralRe: How to watch static variables while debugging Pin
David Crow17-Nov-03 10:03
David Crow17-Nov-03 10:03 
AnswerRe: How to watch static variables while debugging Pin
Bartosz Bien17-Nov-03 13:11
Bartosz Bien17-Nov-03 13:11 
GeneralSaving before close Pin
doctorpi17-Nov-03 8:20
doctorpi17-Nov-03 8:20 
GeneralRe: Saving before close Pin
David Crow17-Nov-03 8:33
David Crow17-Nov-03 8:33 
GeneralRe: Saving before close Pin
Obliterator17-Nov-03 8:57
Obliterator17-Nov-03 8:57 
GeneralRe: Saving before close Pin
Stye18-Nov-03 16:28
Stye18-Nov-03 16:28 
GeneralDetermining dependent DLLs Pin
Arash Sabet17-Nov-03 7:59
Arash Sabet17-Nov-03 7:59 
GeneralRe: Determining dependent DLLs Pin
David Crow17-Nov-03 8:37
David Crow17-Nov-03 8:37 
GeneralRe: Determining dependent DLLs Pin
Arash Sabet17-Nov-03 8:40
Arash Sabet17-Nov-03 8:40 
GeneralRe: Determining dependent DLLs Pin
David Crow17-Nov-03 8:45
David Crow17-Nov-03 8:45 
GeneralRe: Determining dependent DLLs Pin
Arash Sabet17-Nov-03 8:52
Arash Sabet17-Nov-03 8:52 
GeneralRe: Determining dependent DLLs Pin
David Crow17-Nov-03 9:27
David Crow17-Nov-03 9:27 
GeneralRe: Determining dependent DLLs Pin
Arash Sabet17-Nov-03 9:30
Arash Sabet17-Nov-03 9:30 
GeneralRe: Determining dependent DLLs Pin
David Crow17-Nov-03 9:40
David Crow17-Nov-03 9:40 
GeneralRe: Determining dependent DLLs Pin
Peter Molnar18-Nov-03 15:16
Peter Molnar18-Nov-03 15:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.