Commit Graph

10 Commits

Author SHA1 Message Date
Michał Górny
8666b9057f [lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hit
Explicitly consider the libraries reported on the initial rendezvous
breakpoint hit added.  This is necessary on FreeBSD since the dynamic
loader issues only a single 'consistent' state rendezvous breakpoint hit
for all the libraries present in DT_NEEDED.  It is also helpful on Linux
where it ensures that ld-linux is considered loaded as well
as the shared system libraries reported afterwards.

Reenable memory maps on FreeBSD since this fixed the issue triggered
by them.

Differential Revision: https://reviews.llvm.org/D92187
2020-12-17 09:31:10 +01:00
Michał Górny
733e2ae8cd Revert "[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action"
This reverts commit 09b08833f3.

This code is wrong on Linux, and causes ld-linux and linux-vdso to be
reported twice.  I need to work on it more.
2020-12-07 15:58:49 +01:00
Michał Górny
09b08833f3 [lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action
Explicitly consider the libraries reported on the initial eTakeSnapshot
action added, through adding them to the added soentry list
in DYLDRendezvous::SaveSOEntriesFromRemote().  This is necessary
on FreeBSD since the dynamic loader issues only a single 'consistent'
state rendezvous breakpoint hit for all the libraries present
in DT_NEEDED (while Linux issues an added-consistent event pair).

Reenable memory maps on FreeBSD since this fixed the issue triggered
by them.

Differential Revision: https://reviews.llvm.org/D92187
2020-12-07 09:56:51 +01:00
Michał Górny
98257c3006 [lldb] [test] Update XFAILs/skips for FreeBSD
Update expected failures and test skips based on common results
for the old and new FreeBSD plugins.
2020-11-03 22:01:59 +01:00
Jonas Devlieghere
61d5b0e663 [lldb/Driver] Exit with a non-zero exit code in case of error in batch mode.
We have the option to stop running commands in batch mode when an error
occurs. When that happens we should exit the driver with a non-zero exit
code.

Differential revision: https://reviews.llvm.org/D78825
2020-05-05 11:01:44 -07:00
Pavel Labath
2947da9ff7 [lldb] disable thread-step-out-ret-addr-check on windows
I'm unable to get this test working there.
2019-12-21 14:20:47 +01:00
Pavel Labath
ce3ce9f464 [lldb] Force the preprocessor to run in thread-step-out-ret-addr-check.test
It does not seem to run automatically on windows.
2019-12-21 12:25:02 +01:00
Jan Kratochvil
4706a60e8a [lldb] [testsuite] Fix Linux fail: Unwind/thread-step-out-ret-addr-check.test
D71372 introduced: `Unwind/thread-step-out-ret-addr-check.test` failing on
Fedora 30 Linux x86_64.
  [lldb] Add additional validation on return address in 'thread step-out'
  https://reviews.llvm.org/D71372

One problem is the underscored `_nonstandard_stub` in the `.s` file but not in
the LLDB command:
  (lldb) breakpoint set -n nonstandard_stub
  Breakpoint 1: no locations (pending).
  WARNING:  Unable to resolve breakpoint to any actual locations.
  (lldb) process launch
  Process 21919 exited with status = 0 (0x00000000)
  Process 21919 launched: '/home/jkratoch/redhat/llvm-monorepo-clangassert/tools/lldb/test/Unwind/Output/thread-step-out-ret-addr-check.test.tmp' (x86_64)
  (lldb) thread step-out
  error: invalid thread
  (lldb) _

Another problem is that Fedora Linux has executable stack by default and all
programs indicate non-executable stack by `PT_GNU_STACK`, after fixing the
underscore I was getting:
  (lldb) thread step-out
  Process 22294 exited with status = 0 (0x00000000)
  (lldb) _

A different approach was tried as:
  [lldb] Refactor thread-step-out-ret-addr-check test to use .data instead of stack variable
  https://reviews.llvm.org/D71789

Differential revision: https://reviews.llvm.org/D71784
2019-12-21 11:27:54 +01:00
Jim Ingham
05b2c6a52c Temporarily restrict the test for D71372 to darwin till we fix it on other systems. 2019-12-20 14:31:41 -08:00
Jim Ingham
2a42a5a2f4 In 'thread step-out' command, only insert a breakpoint in executable memory.
Previously, if the current function had a nonstandard stack layout/ABI, and had a valid
data pointer in the location where the return address is usually located, data corruption
would occur when the breakpoint was written. This could lead to an incorrectly reported
crash or silent corruption of the program's state. Now, if the above check fails, the command safely aborts.

Differential Revision: https://reviews.llvm.org/D71372
2019-12-20 11:02:24 -08:00