]> code.delx.au - gnu-emacs/blobdiff - src/.gdbinit
TODO update
[gnu-emacs] / src / .gdbinit
index c0a1bbfffd815c68d8f1f5c0d90a661c44113ec1..ef1839fe109fe6570a8f9fc67c78e87a1f47128d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-1998, 2000-201 Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2000-2013 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Emacs; see the file COPYING.  If not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
+# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 # Force loading of symbols, enough to give us VALBITS etc.
-set main
+set $dummy = main + 8
 # With some compilers, we need this to give us struct Lisp_Symbol etc.:
-set Fmake_symbol
+set $dummy = Fmake_symbol + 8
 
 # Find lwlib source files too.
 dir ../lwlib
@@ -89,7 +87,7 @@ define pp
   set $tmp = $arg0
   set $output_debug = print_output_debug_flag
   set print_output_debug_flag = 0
-  set safe_debug_print ($tmp)
+  call safe_debug_print ($tmp)
   set print_output_debug_flag = $output_debug
 end
 document pp
@@ -102,7 +100,7 @@ define pv
   set $tmp = "$arg0"
   set $output_debug = print_output_debug_flag
   set print_output_debug_flag = 0
-  set safe_debug_print (find_symbol_value (intern ($tmp)))
+  call safe_debug_print (find_symbol_value (intern ($tmp)))
   set print_output_debug_flag = $output_debug
 end
 document pv
@@ -495,7 +493,8 @@ define pgx
   end
   xgettype ($g.object)
   if ($type == Lisp_String)
-    printf " str=%x[%d]", $g.object, $g.charpos
+    xgetptr $g.object
+    printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->data, $g.charpos
   else
     printf " pos=%d", $g.charpos
   end
@@ -1121,15 +1120,15 @@ end
 define xbacktrace
   set $bt = backtrace_list
   while $bt
-    xgettype (*$bt->function)
+    xgettype ($bt->function)
     if $type == Lisp_Symbol
-      xprintsym (*$bt->function)
+      xprintsym ($bt->function)
       printf " (0x%x)\n", $bt->args
     else
-      xgetptr *$bt->function
+      xgetptr $bt->function
       printf "0x%x ", $ptr
       if $type == Lisp_Vectorlike
-       xgetptr (*$bt->function)
+       xgetptr ($bt->function)
         set $size = ((struct Lisp_Vector *) $ptr)->header.size
         if ($size & PSEUDOVECTOR_FLAG)
          output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
@@ -1162,7 +1161,7 @@ end
 define xwhichsymbols
   set $output_debug = print_output_debug_flag
   set print_output_debug_flag = 0
-  set safe_debug_print (which_symbols ($arg0, $arg1))
+  call safe_debug_print (which_symbols ($arg0, $arg1))
   set print_output_debug_flag = $output_debug
 end
 document xwhichsymbols
@@ -1213,24 +1212,9 @@ set print sevenbit-strings
 show environment DISPLAY
 show environment TERM
 
-# People get bothered when they see messages about non-existent functions...
-xgetptr globals.f_Vsystem_type
-# $ptr is NULL in temacs
-if ($ptr != 0)
-  set $tem = (struct Lisp_Symbol *) $ptr
-  xgetptr $tem->name
-  set $tem = (struct Lisp_String *) $ptr
-  set $tem = (char *) $tem->data
-
-  # Don't let abort actually run, as it will make stdio stop working and
-  # therefore the `pr' command above as well.
-  if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd'
-    # The windows-nt build replaces abort with its own function.
-    break w32_abort
-  else
-    break abort
-  end
-end
+# When debugging, it is handy to be able to "return" from
+# terminate_due_to_signal when an assertion failure is non-fatal.
+break terminate_due_to_signal
 
 # x_error_quitter is defined only on X.  But window-system is set up
 # only at run time, during Emacs startup, so we need to defer setting