This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: RFC : Handling breakpoints on archs. with imprecise exceptions.
- From: Paul Gilliam <pgilliam at us dot ibm dot com>
- To: gdb at sources dot redhat dot com
- Cc: Ramana Radhakrishnan <ramana dot radhakrishnan at codito dot com>, Daniel Jacobowitz <drow at false dot org>, amit bhor <amit dot bhor at codito dot com>
- Date: Thu, 24 Mar 2005 11:53:01 -0800
- Subject: Re: RFC : Handling breakpoints on archs. with imprecise exceptions.
- References: <42431904.7010708@codito.com>
- Reply-to: pgilliam at us dot ibm dot com
Isn't this usually handled by the kernel?
On Thursday 24 March 2005 11:46, Ramana Radhakrishnan wrote:
> Hi,
>
> While looking at a GDB port to a processor that has
> imprecise exceptions/ interrupts i.e. the equivalent of a
> software breakpoint would require 4 instructions to stop.
> With my research I was unable to find any GDB port that
> needed to handle such a case.
>
> The mechanism that is in mind is the following for setting
> breakpoints.
>
>
> Description
> ------------
>
> Maintain a separate breakpoint table to which control would
> branch to from the debuggee. So gdb's breakpoint instruction
> is replaced by a branch to the corresponding breakpoint
> table for the
>
> 1 . Replace the instruction with a branch to an entry in a
> breakpoint table which already contains the necessary
> instructions for this purpose. So all that
> breakpoint_from_pc does is to encode this branch instruction
> and return this as the breakpoint instruction.
>
> 2. The breakpoint once hit gets informed to gdb as a
> breakpoint being hit at some location in the breakpoint
> table. So when GDB checks for a breakpoint as having been
> hit the PC it should use should be the value of the PC at
> which the breakpoint was actually set.
>
> GDB specifics.:
> ---------------
>
> a. Define gdbarch_adjust_breakpoint_address in the backend
> to store the mapping in the backend for the PC at which
> breakpoint has been set to the actual value for the PC where
> the breakpoint would be reported to have been hit.
>
> b. Define deprecated_target_wait_hook in the backend to
> restore the actual value of the PC for GDB to continue with
> its work.However as this is a deprecated hook I would not
> like to use this in a new port.
>
> c. Add a new notify_backend_breakpoint_deleted_hook since
> the backend needs notification for the breakpoint being
> deleted and hence free an entry in the breakpoint table.
>
>
>
> cheers
> Ramana