-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Improve LLDB watchpoints on linux/android for arm/arm64/aarch32/aarch64 targets #26405
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
Some LLDB Watchpoints tests marked as Xfail for ARM/ARM64 or AArch32/AArch64 on linux and android due to one reason or another. This bug report tracks the progress on their resolution or provides and explanation into those failures. |
Ok, I think this is the same problem that I'm hitting on FreeBSD. Basically: (lldb) p &g_watch_me_read Currently LLDB 'rounds' watchpoint addresses down, so the second wp would have the same address as first wp, and this is unsupported -- probably because we couldn't say which one was hit. I was thinking we could improve the current code by using BAS to select specific bytes rather than extending the range but I'm not sure if this will change how watchpoints are reported. This could be easily illustrated using the following sample program: volatile char a = 1; int main() { If you set watchpoint on b, you'd get hits on both assignments. |
Oh, and if I read AArch64 documentation right (it's really hard to read), I think that 4-byte alignment is necessary, not 8-byte. |
Hm, on Darwin, this works correctly - at the gdb-remote protocol level
On Darwin systems, the watchpoint hit is delivered as a mach exception which includes the FAR_EL1 register contents -- in this case, the address that was modified, 0x100004001, that we were watching. debugserver uses BAS style watchpoints on arm64 right now, although I want to change that to mask style watchpoints to allow for more flexible watchpoints. The instruction sequence, may be important; in my binary, clang is writing a single byte ( |
With
I believe this is fixed now. |
Extended Description
Following tests fail on arm-linux:
TestWatchLocationWithWatchSet.py
TestStepOverWatchpoint.py
Ptrace interface fails to set read/write watchpoints on single byte variables which are not word aligned.
Following commands fail, in case of TestStepOverWatchpoint:
watchpoint set variable -w read g_watch_me_write
Following commands fail, in case of TestWatchLocationWithWatchSet:
watchpoint set expression -w write -s 1 -- g_char_ptr + 7
Need to do further investigation on how to make sure we can select individual bytes while setting watchpoints on arm.
The text was updated successfully, but these errors were encountered: