This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

generic remote support for arm-aout



Hello,

I've added code to gdb 4.17 to support a remote arm-aout
using gdb's generic remote protocol (not RDI or RDP).
I've implemented an arm-stub.c with the same level of
remote command support as the sparc and i386 stubs.
Also, since the ARM architecture doesn't support
h/w single stepping (or does it?), I've #define'd
NO_SINGLE_STEP in tm-arm.h and added the
following single_step() function to arm-tdep.c:

int one_stepped;

void
single_step (ignore)
    enum target_signal ignore; /* sig, but we don't need it */
{
    static CORE_ADDR next_pc;
    static char break_mem[BREAKPOINT_MAX];

    if (!one_stepped) {

	next_pc = arm_get_next_pc(read_register(PC_REGNUM));
	target_insert_breakpoint (next_pc, break_mem);
	
	/* We are ready to let it go.  */
	one_stepped = 1;
    }
    else {
	/* Remove breakpoints.  */
	target_remove_breakpoint (next_pc, break_mem);

	one_stepped = 0;
    }
}


I've got almost everything working reliably, but there is still
the following strange behavior:

- when stepping out of the function foo(), single_step() correctly
  calculates the address of the caller just after the call to
  foo() (i.e. the instr after "bl _foo"), but then another bp is
  set somewhere back inside foo()! (and another continue ('c') command
  is given!) The step should have ended when the program reached the
  bp at the instr following "bl _foo".

- sometimes a nested stack frame chain is corrupted, and only the last
  two stack frames are reported by a backtrace.

- "nexting" over function calls sometimes fails, but I don't have
  a remotedebug dump of what is happening in this case. Stepping works
  always, into functions or otherwise (as well as nexting when the
  source line doesn't include a function call).


I don't have a whole lot of understanding of the guts of gdb, so
hopefully someone more familiar might be able to help. BTW,
is there interest in generic remote protocol support for arm-aout?

Thanks,

-Steve