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

[DWARF]Set uuid for symbol file spec #110066

Closed
wants to merge 1 commit into from
Closed

Conversation

GeorgeHuyubo
Copy link
Contributor

The gnu build id was lost while creating the new module spec, this result in the SymbolLocatorDebuginfod not able to locate symbol file.

before this change while connecting to debuginfod server I am seeing this warning unable to locate debug file, also parameter not shown.

warning: (x86_64) /home/hyubo/.cache/llvm-debuginfod/client/llvmcache-18224759554195557949 unable to locate separate debug file (dwo, dwp). Debugging will be degraded. (troubleshoot with https://fburl.com/missing_dwo)
(lldb) bt
* thread #1, name = 'crasher', stop reason = signal SIGABRT
  * frame #0: 0x00007fe9f909c993 libc.so.6`__GI___pthread_kill [inlined] __pthread_kill_internal(signo=6, threadid=<unavailable>) at pthread_kill.c:46:37
...
    frame #4: 0x000000000020c46a llvmcache-18224759554195557949`c4crasher::Crasher::crasher(unsigned long) at crasher.h:428
...

After this change:

# no warnings
(lldb) bt
* thread #1, name = 'crasher', stop reason = signal SIGABRT
  * frame #0: 0x00007fe9f909c993 libc.so.6`__GI___pthread_kill [inlined] __pthread_kill_internal(signo=6, threadid=<unavailable>) at pthread_kill.c:46:37
...
    frame #4: 0x000000000020c46a llvmcache-18224759554195557949`c4crasher::Crasher::crasher(this=0x00007fff44c51998, depth=0) at crasher.h:428

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 26, 2024

@llvm/pr-subscribers-lldb

Author: None (GeorgeHuyubo)

Changes

The gnu build id was lost while creating the new module spec, this result in the SymbolLocatorDebuginfod not able to locate symbol file.

before this change while connecting to debuginfod server I am seeing this warning unable to locate debug file, also parameter not shown.

warning: (x86_64) /home/hyubo/.cache/llvm-debuginfod/client/llvmcache-18224759554195557949 unable to locate separate debug file (dwo, dwp). Debugging will be degraded. (troubleshoot with https://fburl.com/missing_dwo)
(lldb) bt
* thread #<!-- -->1, name = 'crasher', stop reason = signal SIGABRT
  * frame #<!-- -->0: 0x00007fe9f909c993 libc.so.6`__GI___pthread_kill [inlined] __pthread_kill_internal(signo=6, threadid=&lt;unavailable&gt;) at pthread_kill.c:46:37
...
    frame #<!-- -->4: 0x000000000020c46a llvmcache-18224759554195557949`c4crasher::Crasher::crasher(unsigned long) at crasher.h:428
...

After this change:

# no warnings
(lldb) bt
* thread #<!-- -->1, name = 'crasher', stop reason = signal SIGABRT
  * frame #<!-- -->0: 0x00007fe9f909c993 libc.so.6`__GI___pthread_kill [inlined] __pthread_kill_internal(signo=6, threadid=&lt;unavailable&gt;) at pthread_kill.c:46:37
...
    frame #<!-- -->4: 0x000000000020c46a llvmcache-18224759554195557949`c4crasher::Crasher::crasher(this=0x00007fff44c51998, depth=0) at crasher.h:428

Full diff: https://github.com/llvm/llvm-project/pull/110066.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (+1)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index a40d6d9e37978b..811f41702fb63a 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4357,6 +4357,7 @@ const std::shared_ptr<SymbolFileDWARFDwo> &SymbolFileDWARF::GetDwpSymbolFile() {
     FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
     ModuleSpec module_spec;
     module_spec.GetFileSpec() = m_objfile_sp->GetFileSpec();
+    module_spec.GetUUID() = m_objfile_sp->GetUUID();
     FileSpec dwp_filespec;
     for (const auto &symfile : symfiles.files()) {
       module_spec.GetSymbolFileSpec() =

@JDevlieghere
Copy link
Member

Change makes sense, but is there a way to test this?

@kevinfrei
Copy link
Contributor

The DWP tests I tried to land turned into a nightmare of "your change to test infra requires you learn about all the wacky ways obscure test infra may or may not be configured" so there are tests, but they're disabled. If folks are okay with using yaml2obj as a mechanism to test .dwp+corefiles, that would be doable, but the API tests that use DWP aren't enabled, currently...

@clayborg
Copy link
Collaborator

Change looks good to me, but we should find a way to test. We just need a test file + .dwp file and load that into lldb and force it to try and find the symbols right? Shouldn't require a core file. Then both the executable + .dwp file can be obj2yaml'ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants