* Strange backtrace from GDB 7.5.91
@ 2013-03-20 17:45 Eli Zaretskii
2013-03-20 17:58 ` Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-03-20 17:45 UTC (permalink / raw)
To: gdb
I saw today a very strange backtrace, while debugging with GDB 7.5.91,
which I got by stepping through relocate_gdb_directory:
(top-gdb) s
relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb",
progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe")
at main.c:124
124 dir = relocate_path (gdb_program_name, initial, flag);
(top-gdb) bt
#0 relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb",
progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe")
at main.c:124
#1 relocate_gdb_directory (
initial=initial@entry=0x71a51b "d:/usr/share/gdb", flag=flag@entry=1)
at main.c:124
#2 0x004f0b1d in captured_main (data=data@entry=0x572ff10) at main.c:399
But relocate_path's argument list is this:
relocate_path (const char *progname, const char *initial, int flag)
i.e., the FLAG argument is the last one, not the first one.
After one more "step", relocate_path appears twice in the backtrace,
once with correct order of arguments, the other one with an incorrect
order:
(top-gdb) s
relocate_path (initial=0x71a51b "d:/usr/share/gdb",
progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe",
flag=<optimized out>) at main.c:109
109 return make_relative_prefix (progname, BINDIR, initial);
(top-gdb) bt
#0 relocate_path (initial=0x71a51b "d:/usr/share/gdb",
progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe",
flag=<optimized out>) at main.c:109
#1 relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb",
progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe")
at main.c:120
#2 relocate_gdb_directory (
initial=initial@entry=0x71a51b "d:/usr/share/gdb", flag=flag@entry=1)
at main.c:124
#3 0x004f0b1d in captured_main (data=data@entry=0x572ff10) at main.c:399
Is this due to inlining or something? Is this a bug?
The compiler was GCC 4.7.2, if that matters, and the compilation
switches were "-g3 -O2". MinGW GCC produced DWARF-2 debug info.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Strange backtrace from GDB 7.5.91
2013-03-20 17:45 Strange backtrace from GDB 7.5.91 Eli Zaretskii
@ 2013-03-20 17:58 ` Jan Kratochvil
2013-03-20 18:04 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2013-03-20 17:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
On Wed, 20 Mar 2013 18:45:02 +0100, Eli Zaretskii wrote:
> #0 relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb",
> progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe")
> at main.c:124
> #1 relocate_gdb_directory (
> initial=initial@entry=0x71a51b "d:/usr/share/gdb", flag=flag@entry=1)
> at main.c:124
[...]
> But relocate_path's argument list is this:
>
> relocate_path (const char *progname, const char *initial, int flag)
>
> i.e., the FLAG argument is the last one, not the first one.
It needs a fix in GDB:
Bug 15223 - reversed order of inlined function parameters
http://sourceware.org/bugzilla/show_bug.cgi?id=15223
> #0 relocate_path (initial=0x71a51b "d:/usr/share/gdb",
> progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe",
> flag=<optimized out>) at main.c:109
> #1 relocate_path (flag=1, initial=0x71a51b "d:/usr/share/gdb",
> progname=0x260ed0 "d:\\usr\\eli\\utils\\gdb-7.5.91\\gdb\\gdb.exe")
> at main.c:120
> #2 relocate_gdb_directory (
> initial=initial@entry=0x71a51b "d:/usr/share/gdb", flag=flag@entry=1)
> at main.c:124
> #3 0x004f0b1d in captured_main (data=data@entry=0x572ff10) at main.c:399
>
> Is this due to inlining or something? Is this a bug?
Probably all the frames #0..#2 are inlined, see "info frame". It is not a bug
a single function is there multiple times, GCC does so.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Strange backtrace from GDB 7.5.91
2013-03-20 17:58 ` Jan Kratochvil
@ 2013-03-20 18:04 ` Eli Zaretskii
2013-03-20 18:07 ` Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-03-20 18:04 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb
> Date: Wed, 20 Mar 2013 18:57:40 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb@sourceware.org
>
> > But relocate_path's argument list is this:
> >
> > relocate_path (const char *progname, const char *initial, int flag)
> >
> > i.e., the FLAG argument is the last one, not the first one.
>
> It needs a fix in GDB:
> Bug 15223 - reversed order of inlined function parameters
> http://sourceware.org/bugzilla/show_bug.cgi?id=15223
Thanks.
Any chance of fixing this before 7.6 is released?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Strange backtrace from GDB 7.5.91
2013-03-20 18:04 ` Eli Zaretskii
@ 2013-03-20 18:07 ` Jan Kratochvil
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2013-03-20 18:07 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
On Wed, 20 Mar 2013 19:04:09 +0100, Eli Zaretskii wrote:
> > It needs a fix in GDB:
> > Bug 15223 - reversed order of inlined function parameters
> > http://sourceware.org/bugzilla/show_bug.cgi?id=15223
>
> Thanks.
>
> Any chance of fixing this before 7.6 is released?
I do not think so, it is not a regression and I do not even think such change
is safe so late in the release process.
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-20 18:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 17:45 Strange backtrace from GDB 7.5.91 Eli Zaretskii
2013-03-20 17:58 ` Jan Kratochvil
2013-03-20 18:04 ` Eli Zaretskii
2013-03-20 18:07 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox