opensubscriber
   Find in this group all groups
 
Unknown more information…

g : gdb@gnu.org 10 February 2010 • 5:09PM -0500

How to write commands in a GDB script that get executed every time a particular brkpt is hit ?
by shan23

REPLY TO AUTHOR
 
REPLY TO GROUP





I need to debug a certain set of commands each time i invoke gdb - so I
decided to put them in my .gdbinit. Everything was fine , till i decided to
use commands (to execute a certain set of gdb commands each time a certain
brkpt is hit). My script looks is as follows:

define setup
   handle SIGTRAP noprint nostop
   br 'Class1::Fun1(void)'
   run
   br 'Class2::Run(void)'
   c
   br Function2
   commands 3
     return 0
     c
   end
end

Problem is , whenever I execute them one by one , it behaves perfectly , but
when i source the script and run setup , it behaves weirdly after the
commands (does not do what was previously doing. i.e everytime brkpt 3 is
hit, return 0 and continue).

GDB version:
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)

Can anyone help ?

--
View this message in context: http://old.nabble.com/How-to-write-commands-in-a-GDB-script-that-get-executed-every-time-a-particular-brkpt-is-hit---tp27527100p27527100.html
Sent from the Gnu - gdb - General mailing list archive at Nabble.com.




Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.