]> code.delx.au - gnu-emacs/blobdiff - src/.gdbinit
(gdb_pvec_type): A dummy variable for GDB's sake.
[gnu-emacs] / src / .gdbinit
index 94169be78958ed508816d0498c5fbb71d544a8ae..9f99b50deb7ef15473a6ba71d531eb7447790811 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 2000, 01, 2004
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 2000, 01, 2004, 2005
 #   Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
@@ -31,6 +31,9 @@ dir ../lwlib
 # However, C-z works just as well in that case.
 handle 2 noprint pass
 
+# Make it work like SIGINT normally does.
+handle SIGTSTP nopass
+
 # Don't pass SIGALRM to Emacs.  This makes problems when
 # debugging.
 handle SIGALRM ignore
@@ -66,7 +69,7 @@ end
 # Print out s-expressions
 define pp
   set $tmp = $arg0
-  set debug_print ($tmp)
+  set safe_debug_print ($tmp)
 end
 document pp
 Print the argument as an emacs s-expression
@@ -78,7 +81,7 @@ define pp1
   set $tmp = $arg0
   echo $arg0
   printf " = "
-  set debug_print ($tmp)
+  set safe_debug_print ($tmp)
 end
 document pp1
 Print the argument as an emacs s-expression
@@ -88,6 +91,31 @@ where the variable name would not otherwise
 be recorded in the GUD buffer.
 end
 
+# Print value of lisp variable
+define pv
+  set $tmp = "$arg0"
+  set safe_debug_print ( find_symbol_value (intern ($tmp)))
+end
+document pv
+Print the value of the lisp variable given as argument.
+Works only when an inferior emacs is executing.
+end
+
+# Print value of lisp variable
+define pv1
+  set $tmp = "$arg0"
+  echo $arg0
+  printf " = "
+  set safe_debug_print (find_symbol_value (intern ($tmp)))
+end
+document pv1
+Print the value of the lisp variable given as argument.
+Works only when an inferior emacs is executing.
+For use on tool bar when debugging in Emacs
+where the variable name would not otherwise
+be recorded in the GUD buffer.
+end
+
 # Print out current buffer point and boundaries
 define ppt
   set $b = current_buffer
@@ -137,7 +165,7 @@ define pitx
     printf " HL"
   end
   if ($it->n_overlay_strings > 0)
-    printf " nov=%d"
+    printf " nov=%d", $it->n_overlay_strings
   end
   if ($it->sp != 0)
     printf " sp=%d", $it->sp
@@ -600,7 +628,7 @@ Print the contents of $, assuming it is an Emacs Lisp cons.
 end
 
 define nextcons
-  p $.cdr
+  p $.u.cdr
   xcons
 end
 document nextcons
@@ -620,7 +648,7 @@ end
 define xcdr
   xgetptr $
   xgettype $
-  print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->cdr : 0)
+  print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0)
 end
 document xcdr
 Print the cdr of $, assuming it is an Emacs Lisp pair.
@@ -628,7 +656,7 @@ end
 
 define xfloat
   xgetptr $
-  print ((struct Lisp_Float *) $ptr)->data
+  print ((struct Lisp_Float *) $ptr)->u.data
 end
 document xfloat
 Print $ assuming it is a lisp floating-point number.
@@ -687,6 +715,16 @@ document xbacktrace
   an error was signaled.
 end
 
+# Show Lisp backtrace after normal backtrace.
+define hookpost-backtrace
+  set $bt = backtrace_list
+  if $bt
+    echo \n
+    echo Lisp Backtrace:\n
+    xbacktrace
+  end
+end
+
 define xreload
   set $tagmask = (((long)1 << gdb_gctypebits) - 1)
   set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1
@@ -726,10 +764,19 @@ show environment DISPLAY
 show environment TERM
 set args -geometry 80x40+0+0
 
+# People get bothered when they see messages about non-existent functions...
+echo \n
+echo  If you see messages below about functions not being defined,\n
+echo  don\'t worry about them.  Nothing is wrong.\n
+echo \n
+
 # Don't let abort actually run, as it will make
 # stdio stop working and therefore the `pr' command above as well.
 break abort
 
+# The MS-Windows build replaces abort with its own function.
+break w32_abort
+
 # If we are running in synchronous mode, we want a chance to look around
 # before Emacs exits.  Perhaps we should put the break somewhere else
 # instead...