Skip to contentSkip to conversation

GDB 6.x + simulator

Xenomai-core Philippe Gerum 2 participants 2 messages Apr 9, 2006

lore
Share & tools
lore
#0 lore raw

The following patch enables GDB 6.x for the simulator. Please give this a try if you happen to use the Xenosim. TIA,

scope/gdbhelper.cc +3 -1
@@ -423,6 +423,8 @@
 
     char *ibuf = gdb_ibuf.gets(), *estart = gdb_ibuf.gets();
 
+    Tcl_ResetResult(tclInterp);
+
     for (;;)
 	{
 	if (*ibuf == '\0' || *ibuf == '\n')
@@ -504,7 +506,7 @@
 		// the contents of the log did not match anything known to
 		// the caller. We cannot return -1, which value is reserved
 		// to indicate that the connection with GDB has been lost.
-		
+
 		Tcl_AppendElement(tclInterp,CString(rc2 ? rc2 : nre).gets());
 		Tcl_AppendElement(tclInterp,matched);
 		Tcl_AppendElement(tclInterp,Tcl_DStringValue(&gdb_ilog));
scope/tcl/gdb.tcl +4 -2
Index: sim/scope/tcl/gdb.tcl
===================================================================
@@ -850,8 +850,10 @@
 	regexp "\[^\"\]+.(\[^\"\]+).*" $matched mvar curfocus
     }
 
-    # query stack information
-    set rl [gdb:command where ls]
+    # query stack information -- auto-limit to the inner last 32
+    # frames in order to work-around the issue GDB 6.x has with
+    # ucontext(2) driven co-routines.
+    set rl [gdb:command "where 32" ls]
     set stackinfo [lindex $rl 2]
 
     if {$stackinfo == {}} {
Signature · 1 line
Philippe.
#1 lore raw

Works fine here now with gdb 6.3 and svn trunk version.

Thanks !

--
Bruno

Quoted 54 lines · Philippe Gerum

The following patch enables GDB 6.x for the simulator. Please give this a try if you happen to use the Xenosim. TIA,

scope/gdbhelper.cc (working copy) renamed from scope/gdbhelper.cc (revision 904) +2 -0
@@ -423,6 +423,8 @@
 
      char *ibuf = gdb_ibuf.gets(), *estart = gdb_ibuf.gets();
 
+    Tcl_ResetResult(tclInterp);
+
      for (;;)
        {
        if (*ibuf == '\0' || *ibuf == '\n')
@@ -504,7 +506,7 @@
                // the contents of the log did not match anything known to
                // the caller. We cannot return -1, which value is

reserved

                // to indicate that the connection with GDB has been lost.
scope/gdbhelper.cc (working copy) renamed from scope/gdbhelper.cc (revision 904) +1 -1
-
+
                Tcl_AppendElement(tclInterp,CString(rc2 ? rc2 :
nre).gets());
                Tcl_AppendElement(tclInterp,matched);
                Tcl_AppendElement(tclInterp,Tcl_DStringValue(&gdb_ilog));

Index: sim/scope/tcl/gdb.tcl
===================================================================

scope/tcl/gdb.tcl (working copy) renamed from scope/tcl/gdb.tcl (revision 904) +4 -3
@@ -850,8 +850,10 @@
        regexp "\[^\"\]+.(\[^\"\]+).*" $matched mvar curfocus
      }
 
-    # query stack information
-    set rl [gdb:command where ls]
+    # query stack information -- auto-limit to the inner last 32
+    # frames in order to work-around the issue GDB 6.x has with
+    # ucontext(2) driven co-routines.
+    set rl [gdb:command "where 32" ls]
      set stackinfo [lindex $rl 2]
 
      if {$stackinfo == {}} {
 
--

Philippe.

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core