This is the mail archive of the gdb-patches@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: [RFC] Add hardware breapoints in procfs.c


> >  	* procfs.c (procfs_insert_hw_breakpoint, procfs_remove_hw_breakpoint):
> >  	New functions.
> >  	(procfs_use_watchpoints): Register new hardware breakpoint related
> >  	target functions.
> 
> I don't know procfs enough to review the patch accurately. I think
> that the part for removing the watchpoint is correct

Actually, target_insert/remove_hw_breakpoint are supposed to return
non-zero if the operation failed. However, if you look at the implementation
of procfs_set_watchpoint:

    procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
                           int after)
    {
    #ifndef UNIXWARE
    #ifndef AIX5
    [...]
    #endif /* AIX5 */
    #endif /* UNIXWARE */
      return 0;
    }

In other words, if h/w watchpoints are not supported, this function
returns zero.  Use that directly to insert h/w breakpoints on a system
where this feature is not implemented would lead the debugger to think
that the breakpoint was inserted when in fact it wasn't.

-- 
Joel


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