Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLDB does not print 'anonymous namespace' prefix for variable names (if inferior built with GCC on Linux) #15674

Closed
llvmbot opened this issue Feb 19, 2013 · 5 comments
Labels
bugzilla Issues migrated from bugzilla lldb

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 19, 2013

Bugzilla Link 15302
Resolution FIXED
Resolved on Sep 26, 2016 09:21
Version unspecified
OS Linux
Attachments dump of DWARF generated by clang (passes test), dump of DWARF generated by gcc (fails test)
Reporter LLVM Bugzilla Contributor
CC @emaste,@labath

Extended Description

TestNamespace.py is failing with GCC. The DWARF output by GCC looks correct in that it contains a DW_TAG_namespace node, although it is not identical to what Clang outputs.

Attaching dumps both clang and gcc emitted dwarf for comparison.

To reproduce this failure, run:

python dotest.py -C gcc lang/cpp/namespace

@llvmbot
Copy link
Collaborator Author

llvmbot commented May 29, 2013

The test variant 'data_formatter_commands_after_steps' exposes a loss of every second "next" command. This variant sets a breakpoint before a list is populated, and steps 4 times to populate the list with 4 items.

When this script is run using dotest, dosep or manually at the lldb command prompt, 2 "next" commands are required to populate a single list item. Note that this does not occur if the std::list contains integers rather than elements of type std::string. Note that a single line of code constructs an std::string and adds an element to the list.

Also, this specific failure cannot be reproduced with clang r182733, whereas it reproduces reliably with gcc 4.6.3 (Ubuntu 12.04) gcc 4.6.2 (Debian buildbot) and icc 13.1 (Ubuntu 12.04).

@emaste
Copy link
Member

emaste commented Jul 25, 2013

Related issue on FreeBSD:

runCmd: frame variable --show-declaration --show-globals i
output: main.cpp:12: (int) _GLOBAL__N_1::i = 3

Expecting start string: main.cpp:12: (int) (anonymous namespace)::i = 3
Not matched

FAILURE

@emaste
Copy link
Member

emaste commented Sep 16, 2013

The FreeBSD issue is just a bug in FreeBSD's __cxa_demangle in libcxxrt. For example, using one of the testcases from libcxxabi:

% ./demangle-cxxrt _ZN12_GLOBAL__N_113ASTTypeWriter15VisitVectorTypeEPKN5clang10VectorTypeE
_GLOBAL__N_1::ASTTypeWriter::VisitVectorType(clang::VectorType const*)

% c++filt _ZN12_GLOBAL__N_113ASTTypeWriter15VisitVectorTypeEPKN5clang10VectorTypeE
(anonymous namespace)::ASTTypeWriter::VisitVectorType(clang::VectorType const*)

@emaste
Copy link
Member

emaste commented Nov 15, 2013

The FreeBSD issue is now fixed in two ways - the in-tree __cxa_demangle has been updated to address this case, and FreeBSD now uses the built-in demangler recently re-added to lldb (because the in-tree __cxa_demangle still has some other limitations).

@labath
Copy link
Collaborator

labath commented Sep 26, 2016

Looks like the test passes now.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 4, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla lldb
Projects
None yet
Development

No branches or pull requests

3 participants