Bug 1740927
Summary: | How to use libstdc++ debuginfo with Clang | ||
---|---|---|---|
Product: | DevTools | Reporter: | Paulo Andrade <pandrade> |
Component: | lldb | Assignee: | Tom Stellard <tstellar> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | llvm-toolset-7 | CC: | baconeater789, dsmith, jan, jistone |
Target Milestone: | rc | Keywords: | Reopened, Triaged |
Target Release: | 2019.3 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-01-31 23:56:12 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Paulo Andrade
2019-08-13 21:09:56 UTC
(In reply to Paulo Andrade from comment #0) > (Actually, lldb is crashing on rhel7, but that should be another issue) I guess it is crashing because that time it wasn't protected against DWZ debug info unknown to LLDB. That is now fixed which is why LLDB prints it is ignoring system debug info: > warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 > 0x1f21 Work on supporting DWZ debug info is tracked by Bug 1482854 and upstream let's say: https://reviews.llvm.org/D40474 I have a custom build of LLDB with this off-trunk DWZ patchset: dnf copr enable jankratochvil/lldb;dnf install lldb-experimental;lldb-experimental Although in this case it crashes for me (and I think it is unrelated to my DWZ support but maybe it is). Anyway that last lldb-experimental build is old now, I am making a new version (primarily for upstreaming). > It is uncertain if the issue is in clang++ or lldb, as lldb works with g++ > generated > code, and gdb works with clang++ generated code. Still I think Fedora/RHEL clang should probably have -fstandalone-debug as default as even with DWZ support in LLDB it looks to me it is needed. Probably because system debug info is from GCC while clang assumes clang-produced debug info in libraries. Also it looks to me GCC is using -fstandalone-debug implicitly. *** This bug has been marked as a duplicate of bug 1482854 *** Thanks for the information. I am afraid the lldb-experimental crashes on both rhel7 and fedora 30 with the example test.cpp when attempting to printing the 'msg' value. About gcc having -fstandalone-debug implicitly, at least based on binary size I believe this is the case. The binary generated by 'g++ -g' is slightly larger than one generated by clang++ -g -fstandalone-debug'. But then, gdb should be doing something special, because it works with the binary generated by 'clang++ -g'. My DWZ patchset for trunk crashes the same way so keeping it as separate Bug to verify it gets fixed. (lldb) p msg #0 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/lldb+0x41e8ef) #1 llvm::sys::RunSignalHandlers() (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/lldb+0x41ce42) #2 SignalHandler(int) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/lldb+0x41efb8) #3 __restore_rt (/lib64/libpthread.so.0+0x12e80) #4 clang::CXXRecordDecl::bases_begin() const (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xd66733) #5 clang::CXXRecordDecl::bases() const (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x257f0cd) #6 clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x257dfa6) #7 clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x257c6e3) #8 clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x257c993) #9 clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x257c5e0) #10 clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(clang::VarDecl const&, llvm::GlobalValue::LinkageTypes) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x26825dc) #11 clang::CodeGen::CodeGenFunction::EmitStaticVarDecl(clang::VarDecl const&, llvm::GlobalValue::LinkageTypes) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x26816cd) #12 clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x2681197) #13 clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x24dba1b) #14 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x24d314c) #15 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x24d1efb) #16 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x24dc55a) #17 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x251ee98) #18 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x2539cd3) #19 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x25336f2) #20 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x253ca37) #21 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x2495f5f) #22 lldb_private::ASTResultSynthesizer::HandleTopLevelDecl(clang::DeclGroupRef) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xefe9e7) #23 clang::ParseAST(clang::Sema&, bool, bool) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x2c45953) #24 lldb_private::ClangExpressionParser::ParseInternal(lldb_private::DiagnosticManager&, clang::CodeCompleteConsumer*, unsigned int, unsigned int) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xf22cc7) #25 lldb_private::ClangUserExpression::Parse(lldb_private::DiagnosticManager&, lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xefb08c) #26 lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&, lldb_private::EvaluateExpressionOptions const&, llvm::StringRef, llvm::StringRef, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::Status&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::shared_ptr<lldb_private::Module>*, lldb_private::ValueObject*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xd08bcc) #27 lldb_private::Target::EvaluateExpression(llvm::StringRef, lldb_private::ExecutionContextScope*, lldb_private::SharingPtr<lldb_private::ValueObject>&, lldb_private::EvaluateExpressionOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, lldb_private::ValueObject*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xe29f5c) #28 lldb_private::CommandObjectExpression::EvaluateExpression(llvm::StringRef, lldb_private::Stream*, lldb_private::Stream*, lldb_private::CommandReturnObject*) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x24294ce) #29 lldb_private::CommandObjectExpression::DoExecute(llvm::StringRef, lldb_private::CommandReturnObject&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x242a412) #30 lldb_private::CommandObjectRaw::Execute(char const*, lldb_private::CommandReturnObject&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xd3cfdf) #31 lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xd34508) #32 lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xd37a49) #33 lldb_private::IOHandlerEditline::Run() (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xc873d1) #34 lldb_private::Debugger::ExecuteIOHandlers() (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xc6c566) #35 lldb_private::CommandInterpreter::RunCommandInterpreter(bool, bool, lldb_private::CommandInterpreterRunOptions&) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0xd388c6) #36 lldb::SBDebugger::RunCommandInterpreter(bool, bool) (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/../lib/liblldb.so.10svn+0x9f0a66) #37 Driver::MainLoop() (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/lldb+0x409d11) #38 main (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/lldb+0x40ad79) #39 __libc_start_main /usr/src/debug/glibc-2.29-24-g2ec0b166bf/csu/../csu/libc-start.c:308:16 #40 _start (/home/jkratoch/redhat/llvm-monorepo-clangassert/bin/lldb+0x4072ee) *** Bug 1732593 has been marked as a duplicate of this bug. *** It works now with lldb-experimental DWZ patches, I did not bisect the upstream change fixing this Bug: https://copr.fedorainfracloud.org/coprs/jankratochvil/lldb/package/lldb-experimental/ dnf copr enable jankratochvil/lldb;dnf install lldb-experimental;lldb-experimental ... I was thinking it will need this patch by Pavel Labath but it does not: [lldb] Add basic -flimit-debug-info support to expression evaluator https://reviews.llvm.org/D81561 |