Typing "call debug_function (current_function_decl, 0)" every time I want to see
the current function is bothersome, the more so if I accidentally tap TAB and 
gdb
tries to autocomplete the current word (argh!).  The following adds an alias so 
I
can just type "pcfun" and be happy.

Ok?

2015-03-10  Marek Polacek  <pola...@redhat.com>

        * gdbinit.in (pcfun): Define and document.

diff --git gcc/gdbinit.in gcc/gdbinit.in
index 10fe5ad..436de06 100644
--- gcc/gdbinit.in
+++ gcc/gdbinit.in
@@ -199,6 +199,15 @@ document pel
 Print expanded location of $.
 end
 
+define pcfun
+output debug_function (current_function_decl, 0)
+echo \n
+end
+
+document pcfun
+Print current function.
+end
+
 # Define some macros helpful to gdb when it is expanding macros.
 macro define __FILE__ "gdb"
 macro define __LINE__ 1

        Marek

Reply via email to