[Lldb-commits] [PATCH] D109738: [lldb] Fix bug 38317 - Address breakpoints don't work if set before the process launches

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 8 16:56:44 PDT 2021


jingham added a comment.

In D109738#3052661 <https://reviews.llvm.org/D109738#3052661>, @ted wrote:

> In D109738#3052624 <https://reviews.llvm.org/D109738#3052624>, @jingham wrote:
>
>> That is clearly wrong: an address is never enough to restore a breakpoint from one session to the next even if you can turn ASLR off.  After all, the breakpoint could be in a dlopened library.
>
> This is usually true.
>
> In cases where you're debugging an embedded application that doesn't involve shared libraries, it's not. The main area where I see this is when debugging application startup code. My coworker who's responsible for that is the one who reported the problem originally. In that case, the address of the breakpoint is always valid on subsequent runs.
>
> On the other hand, when you're running under our RTOS, the application is a PIE, and we support shared libraries, so the address is never valid on subsequent runs.
>
> Maybe we need a flag to "break set" that means "this address is always valid; don't garbage collect it".

I'd almost suggest making another breakpoint type (like --fixed-address or something).  That way you won't have to fight the normal address resolver, and just keep trying to write a breakpoint at that address on each load event till it succeeds.  Note, you could trivially do this with scripted breakpoints.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109738/new/

https://reviews.llvm.org/D109738



More information about the lldb-commits mailing list