This is the mail archive of the gdb-patches@sourceware.org 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]

Use the correct breakpoint instruction on mips-irix


The problem shows up when debugging multi-threaded applications.
When using the regular breakpoint, the process stops when hitting it,
but the debugger never gets a notification.  As a result, trying to
"run" a program just hangs, because GDB is waiting for breakpoint
notifications that never happen.

gdb/ChangeLog:

        * mips-tdep.c (mips_breakpoint_from_pc): Add new static variable
        containing the correct breakpoint instruction to use on mips-irix.
        Use it when the osabi is GDB_OSABI_IRIX.

-- 
Joel
gdb/ChangeLog:

        * mips-tdep.c (mips_breakpoint_from_pc): Add new static variable
        containing the correct breakpoint instruction to use on mips-irix.
        Use it when the osabi is GDB_OSABI_IRIX.
---
 gdb/mips-tdep.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 2748805..92fcd4a 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -5045,6 +5045,9 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
 	  static gdb_byte big_breakpoint[] = { 0, 0x5, 0, 0xd };
 	  static gdb_byte pmon_big_breakpoint[] = { 0, 0, 0, 0xd };
 	  static gdb_byte idt_big_breakpoint[] = { 0, 0, 0x0a, 0xd };
+	  /* Likewise, IRIX appears to expect a different breakpoint,
+	     although this is not apparent until you try to use pthreads. */
+	  static gdb_byte irix_big_breakpoint[] = { 0, 0, 0, 0xd };
 
 	  *lenptr = sizeof (big_breakpoint);
 
@@ -5054,6 +5057,8 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
 		   || strcmp (target_shortname, "pmon") == 0
 		   || strcmp (target_shortname, "lsi") == 0)
 	    return pmon_big_breakpoint;
+	  else if (gdbarch_osabi (gdbarch) == GDB_OSABI_IRIX)
+	    return irix_big_breakpoint;
 	  else
 	    return big_breakpoint;
 	}
-- 
1.5.4.3


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