Bug 10898 - gdb 7.0/mi reports strange bogus type names.
Summary: gdb 7.0/mi reports strange bogus type names.
Status: RESOLVED INVALID
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: 7.0
: P2 normal
Target Milestone: 7.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-03 17:06 UTC by Andre'
Modified: 2010-03-30 09:14 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andre' 2009-11-03 17:06:45 UTC
Compile

   #include <string>
   struct QString { static inline QString fromStdString(const std::string &); };
   int main() { std::string str; }

using 

   g++ -g.

Then run

  ~/bin/gdb-7.0 -ex 'b main' -ex r -i mi  --args ./a.out debug

Typing 

  -stack-list-locals 2


results in 

  ^done,locals=[{name="str",type="QString::string"}]

Note the bogus 'type' field. 

Removing the "QString::fromStdString()" and repeating the procedure yields

  ^done,locals=[{name="str",type="string"}]

as does gdb 6.8 in both scenarios.
Comment 1 Andre' 2009-11-04 07:10:02 UTC
It's not 100% reproducible. Every now and then I get the correct answer
"std::string", but in most cases it's "QString::string". This is  stock ubuntu
9.04 with gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3  here.

Archer version is dad6b53fe4a6df586dcd0a57e2151e7663191f18, the 7.0 case is
using a build from an unmodified source package of the gdb 7.0 release.
Comment 2 Tom Tromey 2010-03-03 17:31:27 UTC
FWIW, I couldn't reproduce this at all on my F11 box.
I ran gdb under valgrind, on the off chance that this would
show a latent bug, but that didn't report one either.
It is possible that this is something that was fixed by
one of the dwarf2read.c allocation bug fixes; could you
try CVS HEAD?
Comment 3 Vladimir Prus 2010-03-29 20:43:44 UTC
Andre,
I believe the ball is yours. Are you planning to recheck this?
Comment 4 Andre' 2010-03-30 09:14:10 UTC
Thanks for reminding me.

The problem is still reproducible with current git master and released 7.1.

However, I had to go back to gcc 4.2.4 to reproduce it (even the updated Ubuntu
9.04 gcc 4.3 is fine), so this pretty much looks more like a gcc issue than a
gdb issue, and it's even one that is fixed there by now.

I doubt gdb is interested in working around old gcc issues, so I guess this
issue can be closed.