From a68128530cc39e10ef29c20c17f2e30900921b27 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 14 Aug 2002 22:58:30 +0000 Subject: 2002-08-14 Greg Menke * mips-stub.c: Re-debugged a breakpoint problem, zbreak target address was a char * which caused the target instruction to not be fully copied, so the zbreak logic corrupted the original instruction and didn't insert a valid break instruction. --- c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog | 13 ++++++++++--- c/src/lib/libbsp/mips/shared/gdbstub/gdb_if.h | 2 ++ c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c | 8 +++++++- c/src/lib/libbsp/mips/shared/gdbstub/rtems-stub-glue.c | 7 +++++++ 4 files changed, 26 insertions(+), 4 deletions(-) (limited to 'c/src/lib') diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog b/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog index 81d78653b2..26a86026d9 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog +++ b/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog @@ -1,8 +1,15 @@ -2001-03-08 Joel Sherrill +2002-08-14 Greg Menke + + * mips-stub.c: Re-debugged a breakpoint problem, zbreak target + address was a char * which caused the target instruction to not + be fully copied, so the zbreak logic corrupted the original + instruction and didn't insert a valid break instruction. + +2002-03-08 Joel Sherrill * mips-stub.c: Removed warnings. -2001-03-05 Greg Menke +2002-03-05 Greg Menke * mips-stub.c: Debugged & tweaked the gdb command processing, zbreak stuff, breakpoint and step code. Implemented 'T' command @@ -15,7 +22,7 @@ rtems_gdb_stub_get_offsets(): Implemented MIPS version. * README: Updated. -2001-03-01 Joel Sherrill +2002-03-01 Joel Sherrill * ChangeLog: Corrected previous entry. diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/gdb_if.h b/c/src/lib/libbsp/mips/shared/gdbstub/gdb_if.h index 464bff8bef..e2d94a89e5 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/gdb_if.h +++ b/c/src/lib/libbsp/mips/shared/gdbstub/gdb_if.h @@ -171,7 +171,9 @@ void mips_gdb_stub_install(int enableThreads) ; #define MEMOPT_READABLE 1 #define MEMOPT_WRITEABLE 2 +#ifndef NUM_MEMSEGS #define NUM_MEMSEGS 10 +#endif int gdbstub_add_memsegment(unsigned,unsigned,int); diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c index c7edbf0f96..9018ed36e9 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c +++ b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c @@ -249,7 +249,13 @@ struct z0break struct z0break *prev; /* Location, preserved data */ - unsigned char *address; + + /* the address pointer, really, really must be a pointer to + ** a 32 bit quantity (likely 64 on the R4k), so the full instruction is read & + ** written. Making it a char * as on the i386 will cause + ** the zbreaks to mess up the breakpoint instructions + */ + unsigned *address; unsigned instr; }; diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/rtems-stub-glue.c b/c/src/lib/libbsp/mips/shared/gdbstub/rtems-stub-glue.c index 8d17911abf..f99a38f7b5 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/rtems-stub-glue.c +++ b/c/src/lib/libbsp/mips/shared/gdbstub/rtems-stub-glue.c @@ -1391,6 +1391,13 @@ int rtems_gdb_stub_get_offsets( unsigned char **bss_addr ) { +/* +** These are the right symbols for the desired addresses, +** but giving them causes gdb to have fits, so we leave +** the reported values as 0. Doesn't hurt the stub's +** operation as far as I've observed. +*/ + /* extern unsigned32 _ftext; extern unsigned32 _fdata; -- cgit v1.2.3