-
Notifications
You must be signed in to change notification settings - Fork 434
Fix debug info for wide pointers #27969
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?
Conversation
11a41ca to
ce541b4
Compare
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
f0033e4 to
737ac6d
Compare
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
compiler/llvm/llvmDebug.cpp
Outdated
| } else if (type == dtLocaleID) { | ||
| // handle locale types | ||
| llvm::SmallVector<llvm::Metadata *, 1> EltTys; | ||
| llvm::Type* nodeTy = dtInt[INT_SIZE_32]->getLLVMType(); |
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.
Is it well-established that locales are backed by int32? is there somewhere in the compiler you can reference to be sure that it's dtInt[INT_SIZE_32]
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.
That would be ideal. info->lvt->getType("c_nodeid_t") should do the trick for this case
compiler/llvm/llvmDebug.cpp
Outdated
| layout.getTypeSizeInBits(nodeTy), | ||
| 8*layout.getABITypeAlign(nodeTy).value(), | ||
| layout.getTypeSizeInBits(nodeTy), /* offset, assume after node */ | ||
| llvm::DINode::FlagZero, |
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 see we do similar things below for other types, but how do we know this is the alignment of the locale type? Can we be sure?
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.
We don't know for certain, to know for certain we would need to compute the offset from the GEP to access subloc. But technically Chapel doesn't know that info (its an opaque record), so there is no GEP (because there is no member access).
But its a pretty good assumption to make. In a struct with 2 primitives of the same type the offset of the second var will just be the size of the primitive type
| 8*layout.getABITypeAlign(ty).value(), /* AlignInBits */ | ||
| llvm::DINode::FlagZero, /* Flags */ | ||
| nullptr, | ||
| dibuilder->getOrCreateArray(EltTys) /* Elements */ |
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.
std::move?
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.
Which of these lines are you suggesting std::move should go on?
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.
Sorry, EltTys
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.
The function takes an llvm::ArrayRef, which is a constant reference. I don't think the move is needed
| DW_TAG_structure_type | ||
| DW_AT_name ("DefaultDist") | ||
| DW_AT_byte_size (0x18) | ||
| DW_AT_byte_size (0x20) |
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.
Curious why this number might have changed?
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.
Because wide pointers affect the size/alignment
| @@ -1,8 +1,8 @@ | |||
| Reading symbols from basicTypes... | |||
| Breakpoint 1 at 0xXXXX: file debugger.c, line 28. | |||
| Breakpoint 1 at 0xXXXX: file debugger.c, line 31. | |||
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.
should there be a prediff for line numbers?
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.
These line numbers are the lines of the file basicTypes.chpl, and part of what this test is locking in is the line numbers. So no
| if [[ "$CHPL_COMM" != "none" ]]; then | ||
| echo "True" | ||
| exit 0 | ||
| fi | ||
|
|
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.
How come?
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.
Because --gdb and --lldb work differently with COMM!=none
| dom = 0xXXXX | ||
| data = 0xXXXX |
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.
This is because you removed the synthetic fields (you mentioned "array gets confused" in the comments)?
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.
Correct
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
|
Running testing after apply some reviewer feedback shows |
Fixes the debug info for wide pointers, by correctly creating debug info for localeIDs.
Having create debug info for wide pointers allows the pretty printer to properly resolve wide pointers, which this PR also implements. The pretty printer uses a new runtime function to submit GETs to resolve wide pointers. This enables pretty-printing domains and arrays with
--no-localorCHPL_COMM!=none. However, future work is still needed to handle true distributed arrays (arrays with data on more than one locale)start_test test/llvm/debugInfo/start_test test/llvm/debugInfo/with--no-localstart_test test/llvm/debugInfo/dwarfdump/with COMM=gasnetResolves #27778