Re: Displaying structure members named like C keywords.

2014-08-26 Thread Emilio Lopes
2014-08-26 21:30 GMT+02:00 Sergio Durigan Junior :
> Aha, yeah, I was indeed suspecting that libstdc++'s debuginfo would be
> the cause.  I managed to reproduce it here. [...]

Hello Sergio,

that's indeed good news, thank you very much for your efforts!

> Meanwhile, I strongly advise you to file a bug against GDB on
> .  Also, please be aware that this
> list () is not used by most of GDB developers
> anymore; there's just a few of us hanging around here.  Instead,
> the official mailing list for users is .

Yes, I'm aware of this.  Nevertheless the fact that I need to create
yet another account kept me from using the bugzilla interface.
It seems to me like an unnecessary barrier for an occasional bug reporter.

All the best!

 Emílio

___
bug-gdb mailing list
bug-gdb@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gdb


Re: Displaying structure members named like C keywords.

2014-08-26 Thread Sergio Durigan Junior
On Tuesday, August 26 2014, Emilio Lopes wrote:

> Hello Sergio,
>
> I was able to reproduce this issue on the host (x86_64 GNU/Linux)!
>

[...]

> It seems that something in the debug info of libstdc++ is causing the problem.

Aha, yeah, I was indeed suspecting that libstdc++'s debuginfo would be
the cause.  I managed to reproduce it here.  I still need to investigate
this in order to identify what's going on, and I think I'll be able to
do this only on the weekend.  Meanwhile, I strongly advise you to file a
bug against GDB on .  Also, please be
aware that this list () is not used by most of GDB
developers anymore; there's just a few of us hanging around here.
Instead, the official mailing list for users is .

I will let you know if I make any progress about this issue.

Cheers,

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

___
bug-gdb mailing list
bug-gdb@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gdb


Re: Displaying structure members named like C keywords.

2014-08-26 Thread Emilio Lopes
Hello Sergio,

I was able to reproduce this issue on the host (x86_64 GNU/Linux)!

Here we go:

$ cat gdb-reproducer.c
#include 

using std::cout;

typedef struct {
int rlevel;
int complex;
} param_t;

int main(int argc, char *argv[]) {
param_t foo;

foo.rlevel = 4;
foo.complex= foo.rlevel + 11;

cout << "foo.complex: " << foo.complex << "\n";

return(0);
}

$ g++ -Wall -ggdb3  gdb-reproducer.c && ./a.out
foo.complex: 15

$ gdb a.out
GNU gdb (Debian 7.7.1+dfsg-3) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...done.
(gdb) b main
Breakpoint 1 at 0x4007c6: file gdb-reproducer.c, line 13.
(gdb) r
Starting program: /home/lopes/projects/c/a.out

Breakpoint 1, main (argc=1, argv=0x7fffe958) at gdb-reproducer.c:13
13foo.rlevel = 4;
(gdb) n
14foo.complex= foo.rlevel + 11;
(gdb) n
16cout << "foo.complex: " << foo.complex << "\n";
(gdb) p foo
$1 = {rlevel = 4, complex = 15}
(gdb) ptype foo
type = struct param_t {
int rlevel;
int complex;
}
(gdb) p foo.complex
A syntax error in expression, near `'.
(gdb) info shared
FromTo  Syms Read   Shared Object Library
0x77ddcae0  0x77df5170  Yes
/lib64/ld-linux-x86-64.so.2
No  linux-vdso.so.1
0x77b2c8e0  0x77b9480a  Yes
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
0x777d5580  0x77840de6  Yes
/lib/x86_64-linux-gnu/libm.so.6
0x775bcab0  0x775cc995  Yes
/lib/x86_64-linux-gnu/libgcc_s.so.1
0x772304a0  0x7735a613  Yes
/lib/x86_64-linux-gnu/libc.so.6
(gdb) noshared
(gdb) p foo.complex
$2 = 15
(gdb) p foo
$3 = {rlevel = 4, complex = 15}
(gdb) p foo.complex
$4 = 15
(gdb) shared libstdc.*
Reading symbols from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6...Reading symbols from
/usr/lib/debug//usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20...done.
done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) p foo.complex
A syntax error in expression, near `'.
(gdb) p foo
$5 = {rlevel = 4, complex = 15}
(gdb) ptype foo
type = struct param_t {
int rlevel;
int complex;
}

It seems that something in the debug info of libstdc++ is causing the problem.

Some info about the system I'm using:

$ uname -a
Linux lopes 3.14-1-amd64 #1 SMP Debian 3.14.12-1 (2014-07-11)
x86_64 GNU/Linux
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian
4.9.1-4' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --with-arch-32=i586 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.1 (Debian 4.9.1-4)
$ dpkg -l | grep -F 'libstdc++'
ii  libstdc++-4.9-dev:amd64 4.9.1-4  amd64GNU
Standard C++ Library v3 (development files)
ii  libstdc++6:amd644.9.1-4  amd64