From: Simon Marchi <simark@simark.ca>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix an issue with the gdb step-over aka. "n" command
Date: Sun, 15 Dec 2019 01:25:00 -0000 [thread overview]
Message-ID: <e1b94c54-6e8c-4eb8-bb21-73077d1f7a0f@simark.ca> (raw)
In-Reply-To: <VI1PR03MB4528BAD4E0EB8E72394FFCD8E44B0@VI1PR03MB4528.eurprd03.prod.outlook.com>
On 2019-11-24 7:17 a.m., Bernd Edlinger wrote:
> Hi,
>
> this fixes an issue with the gdb step-over aka. "n" command.
>
> Apologies, the motivation for this patch was from sub-optimal
> debug experience using some gcc code involving inlined functions,
> and initially I tried to convince gcc folks that it is in fact a
> gcc bug, but...
>
> It can be seen when you debug an optimized stage-3 cc1
> it does not affect -O0 code, though.
>
> Note: you can use "gcc -S hello.c -wrapper gdb,--args" to invoke cc1 with
> debugger attached.
>
> This example debug session will explain the effect.
>
> (gdb) b get_alias_set
> Breakpoint 5 at 0xa099f0: file ../../gcc-trunk/gcc/alias.c, line 837.
> (gdb) r
> Breakpoint 5, get_alias_set (t=t@entry=0x7ffff7ff7ab0) at ../../gcc-trunk/gcc/alias.c:837
> 837 if (t == error_mark_node
> (gdb) n
> 839 && (TREE_TYPE (t) == 0 || TREE_TYPE (t) == error_mark_node)))
> (gdb) n
> 3382 return __t; <-- now we have a problem: wrong line info here
> (gdb) bt
> #0 get_alias_set (t=t@entry=0x7ffff7ff7ab0) at ../../gcc-trunk/gcc/tree.h:3382
> #1 0x0000000000b25dfe in set_mem_attributes_minus_bitpos (ref=0x7ffff746f990, t=0x7ffff7ff7ab0, objectp=1, bitpos=...)
> at ../../gcc-trunk/gcc/emit-rtl.c:1957
> #2 0x0000000001137a55 in make_decl_rtl (decl=0x7ffff7ff7ab0) at ../../gcc-trunk/gcc/varasm.c:1518
> #3 0x000000000113b6e8 in assemble_variable (decl=0x7ffff7ff7ab0, top_level=<optimized out>, at_end=<optimized out>,
> dont_output_data=0) at ../../gcc-trunk/gcc/varasm.c:2246
> #4 0x000000000113f0ea in varpool_node::assemble_decl (this=0x7ffff745b000) at ../../gcc-trunk/gcc/varpool.c:584
> #5 0x000000000113fa17 in varpool_node::assemble_decl (this=0x7ffff745b000) at ../../gcc-trunk/gcc/varpool.c:750
I have a hard time understanding what is going wrong and what we should see
instead. I think it would help if you showed what's $pc at every place where
you are stopping, as well as the output for readelf --debug-dump=decodedline
for those regions. It would also help if you provided the same session without
and with your patch applied, so we could see the difference.
Simon
next prev parent reply other threads:[~2019-12-15 1:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-24 12:17 Bernd Edlinger
2019-12-01 20:47 ` [PING] " Bernd Edlinger
2019-12-14 13:52 ` [PING**2] " Bernd Edlinger
2019-12-30 22:12 ` Andrew Burgess
2020-01-01 9:40 ` Bernd Edlinger
2020-01-06 8:14 ` [PING**3] " Bernd Edlinger
2020-01-06 22:09 ` Andrew Burgess
2020-01-07 15:15 ` Bernd Edlinger
2019-12-15 1:25 ` Simon Marchi [this message]
2019-12-15 8:39 ` Bernd Edlinger
2019-12-19 22:53 ` Bernd Edlinger
2019-12-20 6:13 ` Simon Marchi
2019-12-20 19:57 ` Bernd Edlinger
2019-12-28 8:40 ` Bernd Edlinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1b94c54-6e8c-4eb8-bb21-73077d1f7a0f@simark.ca \
--to=simark@simark.ca \
--cc=bernd.edlinger@hotmail.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox