GDB hardware watchpoint information on i386

paawan oza paawan1982@yahoo.com
Mon Aug 2 08:16:00 GMT 2010


Hi,
If you look at functions 
'bpstat_stop_status' and 'bpstat_do_actions', they find out why the process was 
stooped and how to execute the associated command.
Regards,
Oza.



----- Original Message ----
From: Shrikanth Kamath <shrikanth07@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Sent: Mon, August 2, 2010 1:25:02 PM
Subject: Re: GDB hardware watchpoint information on i386

Decent enough Jan. Okay, from internals perspective, say I have
written the "commands" to be executed when the watchpoint is hit,
which function
inside GDB maps this action(s) to the watchpoint trap?

I mean there would be
foo_service_watchpoint()
{
   /* map actions to this watchpoint */
}

which is this function?

--
Shrikanth R K

On Mon, Aug 2, 2010 at 12:28 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> 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
>
> [...]
>



      



More information about the Gdb mailing list