[Lldb-commits] [PATCH] D71372: [lldb] Add additional validation on return address in 'thread step-out'

Mark Mossberg via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 12 10:51:59 PST 2019


mossberg added a comment.

In D71372#1781316 <https://reviews.llvm.org/D71372#1781316>, @labath wrote:

> I'm not sure how easy it is to do that here, but it would certainly be nice to include these error messages in the actual error output from the "finish" command so that they are visible even without logging enabled.


Agreed!

> As for the test, you should be able to do something similar to the tests in the test/Shell/Unwind folder (e.g. eh-frame-dwarf-unwind.test). I.e., you could write an assembly function which uses a non-standard frame layout, but do *not* describe that layout via .eh_frame. Then, stop in that function and try to step out...

Thanks, will look into this.

> Are you sure there is nothing mapped at that address? I'm not a darwin expert, but I have a vague knowledge that the darwin loader (or some other component of the system) actually maps a couple of pages of unreadable memory around the address zero...

Here's how I checked:

  (lldb) fin
   SynthesizeTailCallFrames: can't find previous function
   Return address (0x22) did not point to executable memory.
   Discarding thread plans for thread tid = 0x1bd7b6, up to 0x7fe2f165a220
  error: Could not create return address breakpoint.
  (lldb) image list -a 0x22
  error: Couldn't find module containing address: 0x22.



  $ vmmap 94213 0x22
  0x22 is not in any region.  Bytes before following region: 4294967262




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71372





More information about the lldb-commits mailing list