-
Notifications
You must be signed in to change notification settings - Fork 139
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
[DebugInfo] Flang should generate debug location for limited instructions in prolog #940
Conversation
Due to this wrong debug_line section entry is created with wrong instruction marked as 'prologue_end'. More details in commited test cases.
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 passes our tests on OpenPOWER for LLVM 9 and LLVM 10.
Hi @jiel-nv , @bryanpkc , @kiranchandramohan , do you have any comments ? |
return (!strncmp(name_str, "@fort_init", strlen("@fort_init")) || | ||
!strncmp(name_str, "@f90_", strlen("@f90_"))); |
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.
What about fortran statements like allocate which in turn generate runtime calls, @f90_alloc*. Will this patch disable generation of line-numbers for these runtime calls also?
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.
Generation of debug info is suppressed only for the statements in prologue, other occurrences would have debug location.
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.
What about fortran statements like allocate which in turn generate runtime calls, @f90_alloc*. Will this patch disable generation of line-numbers for these runtime calls also?
Generation of debug info is suppressed only for the statements in prologue, other occurrences would keep having debug location.
I tested this patch on our AArch64 server. I didn't see any failure but also didn't see any improvement; I had thought that this patch would make gdb skip the prologue when stepping. Running the debugger on a Fortran "hello, world", I see the following behaviour:
|
Running the test case failed for me:
For some reason,
|
This would need an updated gdb containing below commit. Can you please confirm whether required gdb is being used ? commit c2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1 |
@alokkrsharma Thanks, I built GDB 10.1 which contains that commit, and it does work fine on a binary built with this branch (rebased on master), and classic-flang-llvm-project/release_100. |
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.
LGTM.
- to match coding style of newly added functions to rest of the file. - to reduce optimization option to -O0 in test case.
Thanks @bryanpkc for approving this. |
Hi @kiranchandramohan , do you have any comment on this ? |
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.
LGTM.
@bryanpkc @alokkrsharma @shivaramaarao : This failure happened in the postcommit CI on an aarch64 machine. Did this finally work for you? |
Things that can be done are...
Let me explain why, Another test prolog.f90 is sufficient to check the (fix) PR. The test case dwarfdump_prolog.f90 depends not only on how Flang (compiler frontend) behaves but also on how compiler backend works. |
That error didn't happen on my end, but I think that might have been thanks to an internal patch that prevented the (0, 0) lines. |
Due to this wrong debug_line section entry is created with wrong instruction
marked as 'prologue_end'. More details in committed test cases.
This causes debugger not skipping prologue when inserting break-point with
function/subroutine name.
To make breakpoint work as expected, some debugger (GDB) changes were
also required which are already committed as
commit c2fd7faea8f2c3a267f276ceb6a95f9f537ea7c1
Author: Alok Kumar Sharma [email protected]
Date: Thu Aug 20 10:35:27 2020 +0530