* [RFA] Report watchpoints hits for 'debug infrun'.
@ 2007-12-01 11:09 Vladimir Prus
2007-12-01 15:28 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Prus @ 2007-12-01 11:09 UTC (permalink / raw)
To: gdb-patches
This patch make 'set debug infrun 1' produce more detailed
information about watchpoint hits. OK?
* gdb/infrun.c (handle_inferior_event): More
detailed debugging about watchpoint hit.
---
gdb/infrun.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d79ed3f..6c62b60 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1597,7 +1597,17 @@ handle_inferior_event (struct execution_control_state *ecs)
stop_pc = read_pc_pid (ecs->ptid);
if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n", paddr_nz (stop_pc));
+ {
+ CORE_ADDR addr;
+ fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n", paddr_nz (stop_pc));
+ if (STOPPED_BY_WATCHPOINT (*ws))
+ {
+ fprintf_unfiltered (gdb_stdlog, "infrun: stopped by watchpoint\n");
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: stopped data address = 0x%s\n",
+ paddr_nz (addr));
+ }
+ }
if (stepping_past_singlestep_breakpoint)
{
@@ -1823,9 +1833,6 @@ handle_inferior_event (struct execution_control_state *ecs)
&& (HAVE_STEPPABLE_WATCHPOINT
|| gdbarch_have_nonsteppable_watchpoint (current_gdbarch)))
{
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: STOPPED_BY_WATCHPOINT\n");
-
/* At this point, we are stopped at an instruction which has
attempted to write to a piece of memory under control of
a watchpoint. The instruction hasn't actually executed
--
1.5.3.5
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFA] Report watchpoints hits for 'debug infrun'.
2007-12-01 11:09 [RFA] Report watchpoints hits for 'debug infrun' Vladimir Prus
@ 2007-12-01 15:28 ` Daniel Jacobowitz
2007-12-01 15:40 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-12-01 15:28 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
On Sat, Dec 01, 2007 at 02:09:01PM +0300, Vladimir Prus wrote:
>
> This patch make 'set debug infrun 1' produce more detailed
> information about watchpoint hits. OK?
Do any targets have a STOPPED_BY_WATCHPOINT that can only be called
once? How about target_stopped_data_address, which the manual says
will be called only once?
BTW, the call to target_stopped_data_address is missing from this
patch. It's going to use addr uninitialized.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Report watchpoints hits for 'debug infrun'.
2007-12-01 15:28 ` Daniel Jacobowitz
@ 2007-12-01 15:40 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2007-12-01 15:40 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: vladimir, gdb-patches
> Date: Sat, 1 Dec 2007 10:27:55 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> BTW, the call to target_stopped_data_address is missing from this
> patch. It's going to use addr uninitialized.
Right, and I'd also guard the use of that address by something,
because some targets don't support that (we don't want to print
garbage in those cases, do we?).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-01 15:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-01 11:09 [RFA] Report watchpoints hits for 'debug infrun' Vladimir Prus
2007-12-01 15:28 ` Daniel Jacobowitz
2007-12-01 15:40 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox