Reputation: 357
I am trying to write a GDB script that "listens" to a remote target and responds to the start of one of two processes. I have the targeting part done but am stuck on identifying which breakpoint is hit.
The script would look something like this:
break *0x400de0 # Process 1 start addr
break *0x40f650 # Process 2 start addr
c # <- GDB waits here for one of the two processes to begin
# hits one of two breakpoints #
if (??? == "0x400de0")
# do something
else
# do something else
However, I'm somewhat stuck on getting the address at the breakpoint into a variable. I've looked into using frame
which prints the current address, however I have no idea how to get that into a variable to use for comparison.
Upvotes: 0
Views: 207