[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Eric Gallager changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |DUPLICATE --- Comment #9 from Eric Gallager --- (In reply to Allan Jensen from comment #8) > Duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78685 ok, closing as such *** This bug has been marked as a duplicate of bug 78685 ***
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Allan Jensen changed: What|Removed |Added CC||linux at carewolf dot com --- Comment #8 from Allan Jensen --- Duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78685
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 --- Comment #7 from Alexandre Oliva --- Thanks. Hmm, tricky. There's no inlining, and debug info is as complete as one could get. The problem is that the registers holding the variables are call-clobbered, and the variables are dead after the call. We emit debug binds right after the call for the variables to the entry values, but the entry values were not saved at the callers either. There's an argument to be made that, at the entry point of foo, the values are still available in the same registers: they haven't been modified yet, and the variables in the enclosing frames were in the same registers up to the point of the call, so one could infer they're still there, but maybe that's asking too much of a debugger. It would have to somehow know that none of the prologue insns changed the registers in a meaningful way to conclude that they still hold the variables that were passed in, to then conclude that the variables in the enclosing frames, that lived in the same registers up to the point of the call, held those values too. And that's the analysis for bar, because, for main, it would again have to somehow know that the value did not change between entry and the call, which is not given by debug info (all we know is that the *location* didn't change), to infer that the registers that held the value up to calling bar still hold the same values, that were held by the corresponding variables. Perhaps if we emitted locations indicating that the variable is unchanged, by naming the entry value as a location for the entire range, a debugger could more easily make that sort of reasoning and find suitable values. It still feels like pushing it a bit, though.
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Martin Liška changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID |--- Known to fail||8.2.0, 9.0 --- Comment #6 from Martin Liška --- Sorry for not providing a test-case, here we go: $ cat test.c #include void foo (int argc, char **argv) { fprintf (stderr, "%s%s\n", argv[0], argv[1]); } void bar (int argc, char **argv) { foo (argc, argv); } int main(int argc, char **argv) { bar (argc, argv); } $ gcc -Og test.c -g $ gdb ./a.out (gdb) b foo Breakpoint 1 at 0x401112: file test.c, line 4. (gdb) r Starting program: /home/marxin/BIG/Programming/linux/tools/perf/a.out Breakpoint 1, foo (argc=1, argv=0x7fffdbf8) at test.c:4 4 { (gdb) bt #0 foo (argc=1, argv=0x7fffdbf8) at test.c:4 #1 0x00401141 in bar (argc=, argv=) at test.c:10 #2 0x0040114f in main (argc=, argv=) at test.c:15
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Eric Gallager changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #5 from Eric Gallager --- (In reply to Richard Biener from comment #1) > Without a (guality?) testcase there's nothing to do here. Well, still no testcase, guality or otherwise, so closing due to being in WAITING for so long.
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Eric Gallager changed: What|Removed |Added CC||aoliva at gcc dot gnu.org --- Comment #4 from Eric Gallager --- (In reply to rguent...@suse.de from comment #3) > On Tue, 24 Jul 2018, egallager at gcc dot gnu.org wrote: > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 > > > > Eric Gallager changed: > > > >What|Removed |Added > > > > CC||egallager at gcc dot > > gnu.org > > > > --- Comment #2 from Eric Gallager --- > > (In reply to Richard Biener from comment #1) > > > Without a (guality?) testcase there's nothing to do here. But quite > > > likely > > > the reason is inlining. Alex new work _might_ help here. > > > > Which new work? > > stmt frontiers and location views ah right THAT alex
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 --- Comment #3 from rguenther at suse dot de --- On Tue, 24 Jul 2018, egallager at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 > > Eric Gallager changed: > >What|Removed |Added > > CC||egallager at gcc dot gnu.org > > --- Comment #2 from Eric Gallager --- > (In reply to Richard Biener from comment #1) > > Without a (guality?) testcase there's nothing to do here. But quite likely > > the reason is inlining. Alex new work _might_ help here. > > Which new work? stmt frontiers and location views
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment #2 from Eric Gallager --- (In reply to Richard Biener from comment #1) > Without a (guality?) testcase there's nothing to do here. But quite likely > the reason is inlining. Alex new work _might_ help here. Which new work?
[Bug debug/68836] GCC can't properly emit debug info for function arguments in a back-trace when using -Og
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68836 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed||2017-10-27 Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- Without a (guality?) testcase there's nothing to do here. But quite likely the reason is inlining. Alex new work _might_ help here.