[PATCH] Add cfun printing to gdbinit.in
Richard Biener
richard.guenther@gmail.com
Tue Mar 10 11:11:00 GMT 2015
On Tue, Mar 10, 2015 at 11:38 AM, Marek Polacek <polacek@redhat.com> wrote:
> On Tue, Mar 10, 2015 at 11:33:13AM +0100, Richard Biener wrote:
>> Isn't cfun->decl much more likely to work?
>
> Dunno, if that's the case, then:
Ok (or use cfun ? cfun->decl : current_function_decl).
Thanks,
Richard.
> 2015-03-10 Marek Polacek <polacek@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 (cfun->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
More information about the Gcc-patches
mailing list