Discussion:
[Bug gdb/23713] New: gdb doesn't switch source language properly
rguenth at gcc dot gnu.org
2018-09-25 14:13:23 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23713

Bug ID: 23713
Summary: gdb doesn't switch source language properly
Product: gdb
Version: 8.2
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
cat 1.C
extern "C" int foo (int);
int main()
{
return foo (1);
}
cat 2.c
int foo (int i)
{
if (!i)
__builtin_abort ();
volatile int j = i;
return j - 1;
}
gcc-8 1.C 2.c -g -flto
gdb ./a.out
(gdb) b foo
Breakpoint 2 at 0x40051d: file 2.c, line 3.
(gdb) start
Temporary breakpoint 3 at 0x400506: file 1.C, line 4.
Starting program: /home/abuild/rguenther/obj-tmp-g/gcc/a.out

Temporary breakpoint 3, main () at 1.C:4
4 return foo (1);
(gdb) show lang
The current source language is "auto; currently c++".
(gdb) c
Continuing.

Breakpoint 2, foo (i=1) at 2.c:3
3 if (!i)
(gdb) show lang
The current source language is "auto; currently c++".

I would have expected C here.

gdb seems to be confused by the concrete instances sitting in a GNU GIMPLE
created CU with C++ language but the abstract instances are in properly
languaged CUs.

If you build with -O -flto -g you should see the same for inline instances
but this seems to be a small testcase for PR23712 as well ...
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...