Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317960 - Incorrect handling of namespaces in debugger
Summary: Incorrect handling of namespaces in debugger
Status: RESOLVED DUPLICATE of bug 308678
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-25 08:39 EDT by Martin Jakl CLA
Modified: 2010-07-26 15:23 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jakl CLA 2010-06-25 08:39:05 EDT
CDT asks gdb incorrectly for member variables in base classes when namespace is defined. When I click on such variable in Variables window I get error:

Failed to execute MI command:
-data-evaluate-expression "(((*(palo::Commitable*) ((server).px))).comm_name)"
Error message from debugger back end:
A syntax error in expression, near `) ((server).px))).comm_name)'.

That's because gdb requires quotation marks aroud type with namespace like: (((*('palo::Commitable'*) ((server).px))).comm_name) 

-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0520 (org.eclipse.epp.package.linuxtools.product)
Installed Features:
 org.eclipse.platform 3.6.0.v20100602-9gF78GpqFt6trOGhL60z0oEx3fz-JKNwxPY
Comment 1 Marc Khouzam CLA 2010-06-25 15:55:59 EDT
Can you add a snippet of code to reproduce the problem?
Comment 2 Martin Jakl CLA 2010-06-26 10:51:16 EDT
Just create new C++ project and add this code:

#include <string>

namespace test {

class testbase {
public:
	testbase() : str("test") {}
private:
	std::string str;
};

class test : public testbase {
};

}

int main(void)
{
	test::test t;
	return 0;
}


Now debug it and make one step. Go to variables windows and expand t and test::testbase and click on str. You get error message "Failed to execute MI command:
-data-evaluate-expression "((((test::testbase) t)).str)"
Error message from debugger back end:
A syntax error in expression, near `t)).str)'."

When you right click str and select watch and then edit the expression to be: (((('test::testbase') t)).str), than you'll get the value.
Comment 3 Axel Mueller CLA 2010-07-19 10:48:14 EDT
Looks like a duplicate of bug #308678
Comment 4 Marc Khouzam CLA 2010-07-19 11:50:24 EDT
Thanks Axel, it does indeed look like a duplicate.

*** This bug has been marked as a duplicate of bug 308678 ***