This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[incremental] Patch: FYI: improve 'pt' in gdbinit


I'm checking this in on the incremental compiler branch.

For years I've had my own 'pt' in ~/.gdbinit that takes an argument
instead of using $.  Sometimes when debugging using gdb in emacs, I
pick up gcc's definition rather than mine.

This patch changes gcc's 'pt' to optionally accept an argument.

This same treatment could be applied to all the other user command.
I didn't do this because I only ever really use pt.

Tom

ChangeLog:
2007-10-05  Tom Tromey  <tromey@redhat.com>

	* gdbinit.in (pt): Accept argument.

Index: gdbinit.in
===================================================================
--- gdbinit.in	(revision 127650)
+++ gdbinit.in	(working copy)
@@ -23,11 +23,17 @@
 end
 
 define pt
-set debug_tree ($)
+  if $argc == 0
+    set debug_tree ($)
+  else
+    set debug_tree ($arg0)
+  end
 end
 
 document pt
-Print the full structure of the tree that is $.
+Print the full structure of a tree.
+The tree may be passed as an argument to pt.
+If no argument is given, uses $.
 Works only when an inferior is executing.
 end
 


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