LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [gdb]how to exec cmd when breakpoint was hit (https://www.linuxquestions.org/questions/linux-software-2/%5Bgdb%5Dhow-to-exec-cmd-when-breakpoint-was-hit-689059/)

jackandking 12-08-2008 04:07 AM

[gdb]how to exec cmd when breakpoint was hit
 
suppose I have two breakpoint b1 and b2,
and I deinfed scripts s1 and s2 to exec at break time.

how to make s1 autorun when b1 was hit?

Valery Reznic 12-08-2008 11:49 PM

Quote:

Originally Posted by jackandking (Post 3367895)
suppose I have two breakpoint b1 and b2,
and I deinfed scripts s1 and s2 to exec at break time.

how to make s1 autorun when b1 was hit?

Code:

break b1
  commands
      silent # optional. should be first if present
      # whatever command you like include running everything via
      # gdb's shell command
      continue # optional, if you want execution continue after command execution
  ends

By the way, what ary trying to achieve ?


All times are GMT -5. The time now is 01:22 PM.