This is the mail archive of the
mailing list for the GCC project.
[incremental] Patch: FYI: improve 'pt' in gdbinit
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 05 Oct 2007 15:46:14 -0600
- Subject: [incremental] Patch: FYI: improve 'pt' in gdbinit
- Reply-to: Tom Tromey <tromey at redhat dot com>
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.
2007-10-05 Tom Tromey <firstname.lastname@example.org>
* gdbinit.in (pt): Accept argument.
--- gdbinit.in (revision 127650)
+++ gdbinit.in (working copy)
@@ -23,11 +23,17 @@
-set debug_tree ($)
+ if $argc == 0
+ set debug_tree ($)
+ set debug_tree ($arg0)
-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.