Subject: Re: GDB breakpoints / alpha
To: matthew green <mrg@eterna.com.au>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: tech-toolchain
Date: 12/10/2000 10:47:27
<mrg@eterna.com.au> (matthew green) writes:

> i'm trying to port gdb-current to the alpha, using the gnu/dist/gdb
> alpha bits.  i've finally gotten to the stage where it links and
> runs, but breakpoints don't work.  they just ignored.
> 
> 
> i'm fairly gdb clueless -- anyone have any ideas on where to begin looking?

When I was debugging a similar problem, I made heavy use of ktrace(1)
on gdb, keeping an eye on calls to ptrace(2). Setting a breakpoint is
done with a PT_READ_I to read the original instruction at a location,
followed by a PT_WRITE_D to set the instruction to something that
causes a breakpoint trap. (since the kernel does the same thing for _D
and _I ptrace requests, this inconsistency doesn't matter).

On the Alpha, gdb should be writing 0x00000080, which is the bpt
instruction (really a CALL_PAL bpt instruction); this comes out of the
BREAKPOINT define in gdb/config/alpha/tm-alpha.h.

        - Nathan