Bug 180059 - Incorrect backtrace shown for anonymous namespace
Summary: Incorrect backtrace shown for anonymous namespace
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.3   Edit
Assignee: Alain Magloire CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-29 15:06 EDT by Elena Laskavaia CLA
Modified: 2008-06-19 23:49 EDT (History)
2 users (show)

See Also:


Attachments
Test Source Code (568 bytes, application/octet-stream)
2007-03-29 15:09 EDT, Elena Laskavaia CLA
no flags Details
Patch for MI Parser (1.77 KB, patch)
2007-03-30 12:27 EDT, Elena Laskavaia CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elena Laskavaia CLA 2007-03-29 15:06:40 EDT
Debug attached testcase (compiled with gcc 3.3.5), 
break on func() and you'll see the IDE showing this
stack:
Thread [1] (Suspended: Breakpoint hit.) 
        4 func() unnamed_namespace.cc:6 0x48040f50      
        3 <symbol is not available> 0x48040fd0  
        2 <symbol is not available> 0x4804257c  
        1 main() unnamed_namespace.cc:31 0x48041038     

Here is the debug MI output.  You can see that GDB is reporting frames 2 & 3
properly.

[1,175,181,114,284] 100-stack-info-depth
[1,175,181,114,284] (gdb)
[1,175,181,114,299] 100^done,depth="4"
[1,175,181,114,299] 101-stack-list-frames 0 4
[1,175,181,114,299] (gdb)
[1,175,181,114,315] 101^done,stack=[frame={level="0
",addr="0x48040f50",func="func()",file="unnamed_\
namespace.cc",line="6"},frame={level="1 ",addr="0x48040fd0",func="(anonymous
namespace)::func2()",fi\
le="unnamed_namespace.cc",line="14"},frame={level="2
",addr="0x4804257c",func="(anonymous namespace)\
::Test::doSomething()",file="unnamed_namespace.cc",line="23"},frame={level="3
",addr="0x48041038",fu\
nc="main",file="unnamed_namespace.cc",line="31"}]


gcc 2.95.3 works correctly but it has different syntax when reporting backtrace in this case. Error in MI parser. Issues still present in CDT 4.0 M5.
Comment 1 Elena Laskavaia CLA 2007-03-29 15:09:03 EDT
Created attachment 62421 [details]
Test Source Code
Comment 2 Elena Laskavaia CLA 2007-03-30 12:27:50 EDT
Created attachment 62514 [details]
Patch for MI Parser

This is patch for this problem for HEAD.
MI Parser incorrectly cut off all round brackets, instead of just parameter list.
Comment 3 Alain Magloire CLA 2007-04-02 11:39:40 EDT
The patch looks good
Comment 4 Alain Magloire CLA 2007-04-02 11:55:56 EDT
patch apply to the head and the cdt-3_1 branch.
Comment 5 Alain Magloire CLA 2007-04-02 11:57:12 EDT
Dave and Elena,
 You will need to commit a tester for this.