diff mbox series

gdbinit: add a new command and fix one

Message ID a1653178-2381-f43d-05a6-eea9a341d5e6@suse.cz
State New
Headers show
Series gdbinit: add a new command and fix one | expand

Commit Message

Martin Liška May 29, 2019, 9:46 a.m. UTC
Hi.

The patch is about a small change in .gdbinit file.

Ready for trunk?
Martin

gcc/ChangeLog:

2019-05-29  Martin Liska  <mliska@suse.cz>

	* gdbinit.in: Fix 'ptc' command.  Add tt
	that prints TREE_TYPE($).
---
 gcc/gdbinit.in | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Jeff Law May 29, 2019, 4:14 p.m. UTC | #1
On 5/29/19 3:46 AM, Martin Liška wrote:
> Hi.
> 
> The patch is about a small change in .gdbinit file.
> 
> Ready for trunk?
> Martin
> 
> gcc/ChangeLog:
> 
> 2019-05-29  Martin Liska  <mliska@suse.cz>
> 
> 	* gdbinit.in: Fix 'ptc' command.  Add tt
> 	that prints TREE_TYPE($).
> ---
>  gcc/gdbinit.in | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> 
OK
jeff
Segher Boessenkool May 29, 2019, 6:18 p.m. UTC | #2
On Wed, May 29, 2019 at 10:14:58AM -0600, Jeff Law wrote:
> On 5/29/19 3:46 AM, Martin Liška wrote:
> > Hi.
> > 
> > The patch is about a small change in .gdbinit file.
> > 
> > Ready for trunk?
> > Martin
> > 
> > gcc/ChangeLog:
> > 
> > 2019-05-29  Martin Liska  <mliska@suse.cz>
> > 
> > 	* gdbinit.in: Fix 'ptc' command.  Add tt
> > 	that prints TREE_TYPE($).
> > ---
> >  gcc/gdbinit.in | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)

There already *is* a "tt" command.  Not that that one is likely very
useful for debugging GCC, but still...  Please check before overriding
commands.


Segher
Martin Liška May 30, 2019, 7:49 a.m. UTC | #3
On 5/29/19 8:18 PM, Segher Boessenkool wrote:
> On Wed, May 29, 2019 at 10:14:58AM -0600, Jeff Law wrote:
>> On 5/29/19 3:46 AM, Martin Liška wrote:
>>> Hi.
>>>
>>> The patch is about a small change in .gdbinit file.
>>>
>>> Ready for trunk?
>>> Martin
>>>
>>> gcc/ChangeLog:
>>>
>>> 2019-05-29  Martin Liska  <mliska@suse.cz>
>>>
>>> 	* gdbinit.in: Fix 'ptc' command.  Add tt
>>> 	that prints TREE_TYPE($).
>>> ---
>>>  gcc/gdbinit.in | 10 +++++++++-
>>>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> There already *is* a "tt" command. 

Oops. I'm renaming that to trt and I'm going to install that.

Martin

> Not that that one is likely very
> useful for debugging GCC, but still...  Please check before overriding
> commands.
> 
> 
> Segher
>
diff mbox series

Patch

diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in
index e16c3c8ef87..81c65d2e7b4 100644
--- a/gcc/gdbinit.in
+++ b/gcc/gdbinit.in
@@ -113,7 +113,7 @@  Works only when an inferior is executing.
 end
 
 define ptc
-output (enum tree_code) $.common.code
+output (enum tree_code) $.base.code
 echo \n
 end
 
@@ -201,6 +201,14 @@  document pcfun
 Print current function.
 end
 
+define tt
+print ($.typed.type)
+end
+
+document tt
+Print TREE_TYPE of the tree node that is $
+end
+
 define break-on-diagnostic
 break diagnostic_show_locus
 end