Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

OneDreamCloser

macrumors member
Original poster
Jun 16, 2008
30
0
hello all,

i would like to ask you about 2 things :

1. when a "SIGSEGV" (segmentation fault) appears at runtime, i can see the function that causes it (through the printed stack, when i run my app in debug mode)
the thing is that i do not know the specific line that is responsible for this kind of errors,
how can i obtain this information ? (Instruments as s profiler can logically help me deal with that)

2. how can i know "when" + "who" changes the value of a specific variable in my app ?
 
1. A backtrace should tell you line numbers. If it doesn't for some reason, use up and down or frame to navigate to the stack frame that had the problem (that's where you should start, though...) and you should be able to see the offending line.

2. http://www.unknownroad.com/rtfm/gdbtut/gdbwatch.html
There have been times that watchpoints haven't "done it" for me, so i've had to:
Use p to display the address of the variable using &.
use display/XX 0x7832309
where XX is the format of the variable in question, and the address is what you get from printing the variable address.
Then single step through your code until you see the value being displayed change.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.