-
Notifications
You must be signed in to change notification settings - Fork 13.6k
prologue_end since LLVM20 misleads gdb into setting flawed breakpoints #139549
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
Comments
@llvm/issue-subscribers-debuginfo Author: Jeremy Morse (jmorse)
While working on the reproducer from #135937, I discovered that gdb really doesn't like the new placement of `prologue_end` since #107849 and related patches. The code:
Compiled with clang 3b4f9c5
Which has this linetable:
i.e., the first line is part of
places the initial breakpoint for 'main' on the line entry /after/ prologue_end, which is past the first branch instruction. As a result, the path taken through DWARF5 describes the prologue_end flag thusly:
Which I feel naturally means that the address to suspend execution is that address where prologue_end is. i.e. 0x1160 in this example. gdb would appear to have an interpretation that I'm unfamiliar with. Next steps are, I believe:
|
I agree with your interpretation of prologue_end, but have no idea why gdb would interpret it differently. |
Guess it's something to do with the instruction being branching in some way? There's certainly going to be many common cases where there is a zero-length prologue, and I'd expect gdb handles most of them fine, eg:
and gdb breaking on f2 seems fine breaking at 0x1130 |
It looks like this is fixed with the latest version of gdb (or, a much more recent version). The one I've now got locally has the version string I suppose there's nothing to do here so I'll close the ticket. |
While working on the reproducer from #135937, I discovered that gdb really doesn't like the new placement of
prologue_end
since #107849 and related patches. The code:Compiled with clang 3b4f9c5
-g -O2
produces this code at the beginning of main:Which has this linetable:
i.e., the first line is part of
d
that's been inlined, and the prologue immediately ends. LLDB is happy with this, the SCE debugger is happy with this, however gdb:places the initial breakpoint for 'main' on the line entry /after/ prologue_end, which is past the first branch instruction. As a result, the path taken through
main
isn't completely covered by that breakpoint, and the program never stops. This is undesirable. The gdb version string I have locally isGNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
.DWARF5 describes the prologue_end flag thusly:
Which I feel naturally means that the address to suspend execution is that address where prologue_end is. i.e. 0x1160 in this example. gdb would appear to have an interpretation that I'm unfamiliar with.
Next steps are, I believe:
The text was updated successfully, but these errors were encountered: