When we're unwinding out of frame 0 and we end up with a bogus frame
authorJason Molenda <jmolenda@apple.com>
Fri, 16 Dec 2011 04:30:31 +0000 (04:30 +0000)
committerJason Molenda <jmolenda@apple.com>
Fri, 16 Dec 2011 04:30:31 +0000 (04:30 +0000)
commit9d828ac0aadf3f6822749a10dc7f840677e96c75
treefba190768bf6d0d7bfd2b6842f4c4d2d6c889dfe
parentab1ec82e0404d843228a25ad9eab2c235393df47
When we're unwinding out of frame 0 and we end up with a bogus frame
1 -- an address pointing off into non-executable memory -- don't
abort the unwind.  We'll use the ABI's default UnwindPlan to try
to get out of frame 1 and on many platforms with a standard frame
chain stack layout we can get back on track and get a valid frame
2.  This preserves the lldb behavior to-date; the change last week
to require the memory region to be executable broke it.

I'd like to mark this frame specially when displayed to the user;
I tried to override the places where the frame's pc value is returned
to change it to a sentinel value (e.g. LLDB_INVALID_ADDRESS) but
couldn't get that to work cleanly so I backed that part out for
now.  When this happens we'll often miss one of the user's actual
frames, the one that's of most interest to the user, so I'd like
to make this visually distinctive.

Note that a frame in non-executable memory region is only allowed
for frame 1.  After that we should be solid on the unwind and any
pc address in non-executable memory indicates a failure and we
should stop unwinding.

llvm-svn: 146723
lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h