This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] Fix hw watchpoints in process record.
On Sunday 22 November 2009 02:10:23, Hui Zhu wrote:
> I think this patch still not OK.
> (gdb) hb *0x000000000040055b
> During symbol reading, incomplete CFI data; unspecified registers
> (e.g., rax) at 0x400550.
> Hardware assisted breakpoint 2 at 0x40055b: file 1.c, line 21.
> (gdb) record
> (gdb) c
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x000000000040055c in main () at 1.c:21
> 21 int c = 1;
> (gdb) info reg pc
> pc: 0x40055c
> The stop pc is not right. Looks we need do some special works when
> this is a simple hb.
You're confusing hardware watchpoints with hardware breakpoints.
The patch handles hardware _watchpoints_ only.
Fixing hardware breakpoints is a different and unrelated
Actually, the problem you're seeing sounds simple: The
breakpoint is set at 0x40055b, but GDB shows the SIGTRAP trigger
at 0x40055c. Off by one, that is. Completelly untested,
but I bet that something like this fixes it:
if (breakpoint_inserted_here_p (get_regcache_aspace (regcache),
/* There is a breakpoint. GDB will want to stop. */
+ if (software_breakpoint_inserted_here_p (get_regcache_aspace (regcache),
struct gdbarch *gdbarch = get_regcache_arch (regcache);
= gdbarch_decr_pc_after_break (gdbarch);
tmp_pc + decr_pc_after_break);