This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

touch and go breakpoints?


Is there a way I can set a breakpoint, where if it is hit, gdb will execute some command, and then continue?

What I want to do is print out the value of a variable everytime a certain line in the code is encountered, but then continue. I have a crash somewhat later, but only after lots of iterations, so what I'd like to do is see what the last value of this variable is before the crash.

I used to do this in MacsBug for the old Mac OS like this:

brp 1234 ';dm a0;g'

that will break at location 1234, display some memory starting at whatever register a0 is, then go.

Thanks,

Mike
--
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
crawford@goingware.com

Tilting at Windmills for a Better Tomorrow.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]