This is the mail archive of the gdb@sourceware.org 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]

Re: GDB hardware watchpoint information on i386


On Mon, 02 Aug 2010 06:10:31 +0200, Shrikanth Kamath wrote:
> I am specifically looking for information about "hooking" my ownÂhandlerÂto
> serviceÂthe watchpoint interrupt rather than needing to invoke a GDB session
> and press 'c'.

Besides GDB hacking isn't it enough for you to use `commands' with `continue'
and associate arbitrary commands (`backtrace' here) in the GDB CLI interface?

Regards,
Jan


(gdb) watch v
Hardware watchpoint 1: v
(gdb) commands
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>backtrace
>continue 
>end
(gdb) run
Starting program: var 
Hardware watchpoint 1: v

Old value = 0
New value = 1
f () at var.c:7
7	}
#0  f () at var.c:7
#1  0x00000000004004a7 in main () at var.c:20
Hardware watchpoint 1: v

Old value = 1
New value = 0
g () at var.c:13
13	}
#0  g () at var.c:13
#1  0x00000000004004ac in main () at var.c:21
Hardware watchpoint 1: v

Old value = 0
New value = 1
f () at var.c:7
7	}
#0  f () at var.c:7
#1  0x00000000004004a7 in main () at var.c:20
Hardware watchpoint 1: v

[...]


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