-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Fix GetDIE is outside of its CU error from .debug_names #157574
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /// Check that LLDB does not emit "GetDIE for DIE {{0x[0-9a-f]+}} is outside of its CU" | ||
| /// error message when user is searching for a matching symbol from .debug_names | ||
| /// and fail to locate the corresponding .dwo file. | ||
|
|
||
| /// -gsplit-dwarf is supported only on Linux. | ||
|
||
| // REQUIRES: system-linux | ||
|
|
||
| // RUN: %clang_host -g -gsplit-dwarf -gpubnames -gdwarf-5 %s -o main | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks the test looks much easier to understand now. I think there is a problem with where it is writing the files though. The lit tests to not automatically get a unique build directory for the test outputs, but uses a shared directory for all the tests in that directory. That means writing and deleting files can interfere with other tests in the directory. We can use the %t to create unique a temporary directory for the test. |
||
| /// Remove the DWO file away from the expected location so that LLDB won't find the DWO next to the binary. | ||
| // RUN: rm *.dwo | ||
| // RUN: %lldb --no-lldbinit main \ | ||
| // RUN: -o "b main" --batch 2>&1 | FileCheck %s | ||
|
|
||
| // CHECK: warning: {{.*}}main unable to locate separate debug file (dwo, dwp). Debugging will be degraded. | ||
dmpots marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // CHECK-NOT: main GetDIE for DIE {{0x[0-9a-f]+}} is outside of its CU {{0x[0-9a-f]+}} | ||
|
|
||
| int num = 5; | ||
|
|
||
| int main(void) { return 0; } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems suprising that the
GetNonSkeletonUnit()call can actually return a skeleton unit. Maybe a better approach here would be to model the fact that we can actually fail to find the non-skeleton unit by returning anExpectedI did a quick search and see other
examples where it looks like we might hit this same bug.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this in general. Actually, that's the original approach I suggested while discussing with Greg.
Unfortunately, there are many existing other callers/code paths of
DWARFUnit::GetNonSkeletonUnitare expecting the default behavior to fallback to return skeleton unit if failing to find dwo files. ChangingDWARFUnit::GetNonSkeletonUnit's semantics requiring auditing all other callers/code paths to ensure the behaviors are expected which is a much bigger task than I thought. Yesterday, I tried to change all callers ofDWARFUnit::GetNonSkeletonUnitto use new API/semantics, it is failing several tests. Some tests are related with apple debug names, -gmodules flag, PCH modules containing CU with only dwo_id without dwo_name (resulting in dwo error) which I am not feeling comfortable/justified to fix.Overall, I feel fixing this known code path is safer (not failing any tests) with better scope to reason about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for trying out that approach. Do you have a WIP patch you can push to a branch somewhere? Might be something we want to tackle later.
Your fix seems targeted and reasonable given the amount of code relying on existing behavior.