This is the mail archive of the gdb@sources.redhat.com 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 : Handling breakpoints on archs. with imprecise exceptions.


On Fri, 25 Mar 2005 01:16:12 +0530
Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> wrote:

> 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.

Another approach, different from the one you outlined, is to use a
branch-to-self as the breakpoint instruction.  The stub needs to
periodically check to see if the task being debugged is stopped at one
of these infinite loop instructions upon which a breakpoint has been
placed.  If so, it interrupts the task and reports a SIGTRAP to GDB. 
I know of at least one case where this was done - though, as I recall,
it was done because the processor provided no other suitable breakpoint
instruction.

This approach makes the stub somewhat more complicated, but has the
virtue of keeping the GDB implementation relatively simple.

Kevin


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