Revision tags: llvmorg-21-init |
|
#
22561cfb |
| 22-Jan-2025 |
Pavel Labath <pavel@labath.sk> |
Revert "[lldb] Implement basic support for reverse-continue" (#123906)
Reverts llvm/llvm-project#112079 due to failures on the arm bot.
|
#
b7b9ccf4 |
| 22-Jan-2025 |
Robert O'Callahan <rocallahan@google.com> |
[lldb] Implement basic support for reverse-continue (#112079)
This commit adds support for a `SBProcess::ContinueInDirection()` API. A user-accessible command for this will follow in a later commit.
[lldb] Implement basic support for reverse-continue (#112079)
This commit adds support for a `SBProcess::ContinueInDirection()` API. A user-accessible command for this will follow in a later commit.
This feature depends on a gdbserver implementation (e.g. `rr`) providing support for the `bc` and `bs` packets. `lldb-server` does not support those packets, and there is no plan to change that. For testing purposes, this commit adds a Python implementation of *very limited* record-and-reverse-execute functionality, implemented as a proxy between lldb and lldb-server in `lldbreverse.py`. This should not (and in practice cannot) be used for anything except testing.
The tests here are quite minimal but we test that simple breakpoints and watchpoints work as expected during reverse execution, and that conditional breakpoints and watchpoints work when the condition calls a function that must be executed in the forward direction.
show more ...
|
Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2 |
|
#
3bef7425 |
| 10-Oct-2024 |
Jason Molenda <jmolenda@apple.com> |
Revert "[lldb] Implement basic support for reverse-continue (#99736)"
Reverting this again; I added a commit which added @skipIfDarwin markers to the TestReverseContinueBreakpoints.py and TestRevers
Revert "[lldb] Implement basic support for reverse-continue (#99736)"
Reverting this again; I added a commit which added @skipIfDarwin markers to the TestReverseContinueBreakpoints.py and TestReverseContinueNotSupported.py API tests, which use lldb-server in gdbserver mode which does not work on Darwin. But the aarch64 ubuntu bot reported a failure on TestReverseContinueBreakpoints.py, https://lab.llvm.org/buildbot/#/builders/59/builds/6397
File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py", line 63, in test_reverse_continue_skip_breakpoint self.reverse_continue_skip_breakpoint_internal(async_mode=False) File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py", line 81, in reverse_continue_skip_breakpoint_internal self.expect( File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2372, in expect self.runCmd( File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1002, in runCmd self.assertTrue(self.res.Succeeded(), msg + output) AssertionError: False is not true : Process should be stopped due to history boundary Error output: error: Process must be launched.
This reverts commit 4f297566b3150097de26c6a23a987d2bd5fc19c5.
show more ...
|
#
4f297566 |
| 10-Oct-2024 |
Robert O'Callahan <robert@ocallahan.org> |
[lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command for this
will follow in a later com
[lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command for this
will follow in a later commit.
This feature depends on a gdbserver implementation (e.g. `rr`) providing
support for the `bc` and `bs` packets. `lldb-server` does not support
those packets, and there is no plan to change that. So, for testing
purposes, `lldbreverse.py` wraps `lldb-server` with a Python
implementation of *very limited* record-and-replay functionality for use
by *tests only*.
The majority of this PR is test infrastructure (about 700 of the 950
lines added).
show more ...
|
#
2ff4c25b |
| 10-Oct-2024 |
Augusto Noronha <anoronha@apple.com> |
Revert "[lldb] Implement basic support for reverse-continue (#99736)"
This reverts commit d5e1de6da96c1ab3b8cae68447e8ed3696a7006e.
|
#
d5e1de6d |
| 10-Oct-2024 |
Robert O'Callahan <robert@ocallahan.org> |
[lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command for this
will follow in a later com
[lldb] Implement basic support for reverse-continue (#99736)
This commit only adds support for the
`SBProcess::ReverseContinue()` API. A user-accessible command for this
will follow in a later commit.
This feature depends on a gdbserver implementation (e.g. `rr`) providing
support for the `bc` and `bs` packets. `lldb-server` does not support
those packets, and there is no plan to change that. So, for testing
purposes, `lldbreverse.py` wraps `lldb-server` with a Python
implementation of *very limited* record-and-replay functionality for use
by *tests only*.
The majority of this PR is test infrastructure (about 700 of the 950
lines added).
show more ...
|
Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
f838fa82 |
| 06-Aug-2024 |
jeffreytan81 <jeffreytan@meta.com> |
New ThreadPlanSingleThreadTimeout to resolve potential deadlock in single thread stepping (#90930)
This PR introduces a new `ThreadPlanSingleThreadTimeout` that will be
used to address potential de
New ThreadPlanSingleThreadTimeout to resolve potential deadlock in single thread stepping (#90930)
This PR introduces a new `ThreadPlanSingleThreadTimeout` that will be
used to address potential deadlock during single-thread stepping.
While debugging a target with a non-trivial number of threads (around
5000 threads in one example target), we noticed that a simple step over
can take as long as 10 seconds. Enabling single-thread stepping mode
significantly reduces the stepping time to around 3 seconds. However,
this can introduce deadlock if we try to step over a method that depends
on other threads to release a lock.
To address this issue, we introduce a new
`ThreadPlanSingleThreadTimeout` that can be controlled by the
`target.process.thread.single-thread-plan-timeout` setting during
single-thread stepping mode. The concept involves counting the elapsed
time since the last internal stop to detect overall stepping progress.
Once a timeout occurs, we assume the target is not making progress due
to a potential deadlock, as mentioned above. We then send a new async
interrupt, resume all threads, and `ThreadPlanSingleThreadTimeout`
completes its task.
To support this design, the major changes made in this PR are:
1. `ThreadPlanSingleThreadTimeout` is popped during every internal stop
and reset (re-pushed) to the top of the stack (as a leaf node) during
resume. This is achieved by always returning `true` from
`ThreadPlanSingleThreadTimeout::DoPlanExplainsStop()` and
`ThreadPlanSingleThreadTimeout::MischiefManaged()`.
2. A new thread-specific async interrupt stop is introduced, which can
be detected/consumed by `ThreadPlanSingleThreadTimeout`.
3. The clearing of branch breakpoints in the range thread plan has been
moved from `DoPlanExplainsStop()` to `ShouldStop()`, as it is not
guaranteed that it will be called.
The detailed design is discussed in the RFC below:
[https://discourse.llvm.org/t/improve-single-thread-stepping/74599](https://discourse.llvm.org/t/improve-single-thread-stepping/74599)
---------
Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
show more ...
|
Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
208a08c3 |
| 01-Jul-2024 |
David Spickett <david.spickett@linaro.org> |
Reland "[lldb] Parse and display register field enums" (#97258)" (#97270)
This reverts commit d9e659c538516036e40330b6a98160cbda4ff100.
I could not reproduce the Mac OS ASAN failure locally but I
Reland "[lldb] Parse and display register field enums" (#97258)" (#97270)
This reverts commit d9e659c538516036e40330b6a98160cbda4ff100.
I could not reproduce the Mac OS ASAN failure locally but I narrowed it
down to the test `test_many_fields_same_enum`. This test shares an enum
between x0, which is 64 bit, and cpsr, which is 32 bit.
My theory is that when it does `register read x0`, an enum type is
created where the undlerying enumerators are 64 bit, matching the
register size.
Then it does `register read cpsr` which used the cached enum type, but
this register is 32 bit. This caused lldb to try to read an 8 byte value
out of a 4 byte allocation:
READ of size 8 at 0x60200014b874 thread T0
<...>
=>0x60200014b800: fa fa fd fa fa fa fd fa fa fa fd fa fa fa[04]fa
To fix this I've added the register's size in bytes to the constructed
enum type's name. This means that x0 uses:
__lldb_register_fields_enum_some_enum_8
And cpsr uses:
__lldb_register_fields_enum_some_enum_4
If any other registers use this enum and are read, they will use the
cached type as long as their size matches, otherwise we make a new type.
show more ...
|
#
d9e659c5 |
| 01-Jul-2024 |
David Spickett <david.spickett@linaro.org> |
Revert "[lldb] Parse and display register field enums" (#97258)
Reverts llvm/llvm-project#95768 due to a test failure on macOS with
ASAN:
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/ll
Revert "[lldb] Parse and display register field enums" (#97258)
Reverts llvm/llvm-project#95768 due to a test failure on macOS with
ASAN:
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/425/console
show more ...
|
#
ba60d8a1 |
| 27-Jun-2024 |
David Spickett <david.spickett@linaro.org> |
[lldb] Parse and display register field enums (#95768)
This teaches lldb to parse the enum XML elements sent by lldb-server,
and make use of the information in `register read` and `register info`.
[lldb] Parse and display register field enums (#95768)
This teaches lldb to parse the enum XML elements sent by lldb-server,
and make use of the information in `register read` and `register info`.
The format is described in
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Enum-Target-Types.html.
The target XML parser will drop any invalid enum or evalue. If we find
multiple evalue for the same value, we will use the last one we find.
The order of evalues from the XML is preserved as there may be good
reason they are not in numerical order.
show more ...
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1 |
|
#
8bdddcf0 |
| 06-Mar-2024 |
jeffreytan81 <jeffreytan@meta.com> |
Fix lldb crash while handling concurrent vfork() (#81564)
We got user reporting lldb crash while the debuggee is calling vfork()
concurrently from multiple threads.
The crash happens because the c
Fix lldb crash while handling concurrent vfork() (#81564)
We got user reporting lldb crash while the debuggee is calling vfork()
concurrently from multiple threads.
The crash happens because the current implementation can only handle
single vfork, vforkdone protocol transaction.
This diff fixes the crash by lldb-server storing forked debuggee's <pid,
tid> pair in jstopinfo which will be decoded by lldb client to create
StopInfoVFork for follow parent/child policy. Each StopInfoVFork will
later have a corresponding vforkdone packet. So the patch also changes
the `m_vfork_in_progress` to be reference counting based.
Two new test cases are added which crash/assert without the changes in
this patch.
---------
Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
show more ...
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6 |
|
#
c73a3f16 |
| 27-Nov-2023 |
Jason Molenda <jmolenda@apple.com> |
[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)
This patch is rearranging code a bit to add WatchpointResources to Process. A WatchpointResource is meant to represent a hardwar
[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)
This patch is rearranging code a bit to add WatchpointResources to Process. A WatchpointResource is meant to represent a hardware watchpoint register in the inferior process. It has an address, a size, a type, and a list of Watchpoints that are using this WatchpointResource.
This current patch doesn't add any of the features of WatchpointResources that make them interesting -- a user asking to watch a 24 byte object could watch this with three 8 byte WatchpointResources. Or a Watchpoint on 1 byte at 0x1002 and a second watchpoint on 1 byte at 0x1003, these must both be served by a single WatchpointResource on that doubleword at 0x1000 on a 64-bit target, if two hardware watchpoint registers were used to track these separately, one of them may not be hit. Or if you have one Watchpoint on a variable with a condition set, and another Watchpoint on that same variable with a command defined or different condition, or ignorecount, both of those Watchpoints need to evaluate their criteria/commands when their WatchpointResource has been hit.
There's a bit of code movement to rearrange things in the direction I'll need for implementing this feature, so I want to start with reviewing & landing this mostly NFC patch and we can focus on the algorithmic choices about how WatchpointResources are shared and handled as they're triggeed, separately.
This patch also stops printing "Watchpoint <n> hit: old value: <x>, new vlaue: <y>" for Read watchpoints. I could make an argument for print "Watchpoint <n> hit: current value <x>" but the current output doesn't make any sense, and the user can print the value if they are particularly interested. Read watchpoints are used primarily to understand what code is reading a variable.
This patch adds more fallbacks for how to print the objects being watched if we have types, instead of assuming they are all integral values, so a struct will print its elements. As large watchpoints are added, we'll be doing a lot more of those.
To track the WatchpointSP in the WatchpointResources, I changed the internal API which took a WatchpointSP and devolved it to a Watchpoint*, which meant touching several different Process files. I removed the watchpoint code in ProcessKDP which only reported that watchpoints aren't supported, the base class does that already.
I haven't yet changed how we receive a watchpoint to identify the WatchpointResource responsible for the trigger, and identify all Watchpoints that are using this Resource to evaluate their conditions etc. This is the same work that a BreakpointSite needs to do when it has been tiggered, where multiple Breakpoints may be at the same address.
There is not yet any printing of the Resources that a Watchpoint is implemented in terms of ("watchpoint list", or SBWatchpoint::GetDescription).
"watchpoint set var" and "watchpoint set expression" take a size argument which was previously 1, 2, 4, or 8 (an enum). I've changed this to an unsigned int. Most hardware implementations can only watch 1, 2, 4, 8 byte ranges, but with Resources we'll allow a user to ask for different sized watchpoints and set them in hardware-expressble terms soon.
I've annotated areas where I know there is work still needed with LWP_TODO that I'll be working on once this is landed.
I've tested this on aarch64 macOS, aarch64 Linux, and Intel macOS.
https://discourse.llvm.org/t/rfc-large-watchpoint-support-in-lldb/72116 (cherry picked from commit fc6b72523f3d73b921690a713e97a433c96066c6)
show more ...
|
#
b0af8a1e |
| 28-Nov-2023 |
David Spickett <david.spickett@linaro.org> |
Revert "[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)"
...and follow ups.
As it has caused test failures on Linux Arm and AArch64: https://lab.llvm.org/buildbot/#/builders/9
Revert "[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)"
...and follow ups.
As it has caused test failures on Linux Arm and AArch64: https://lab.llvm.org/buildbot/#/builders/96/builds/49126 https://lab.llvm.org/buildbot/#/builders/17/builds/45824
``` lldb-shell :: Subprocess/clone-follow-child-wp.test lldb-shell :: Subprocess/fork-follow-child-wp.test lldb-shell :: Subprocess/vfork-follow-child-wp.test ```
This reverts commit a6c62bf1a4717accc852463b664cd1012237d334, commit a0a1ff3ab40e347589b4e27d8fd350c600526735 and commit fc6b72523f3d73b921690a713e97a433c96066c6.
show more ...
|
#
fc6b7252 |
| 27-Nov-2023 |
Jason Molenda <jmolenda@apple.com> |
[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)
This patch is rearranging code a bit to add WatchpointResources to
Process. A WatchpointResource is meant to represent a hardwa
[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)
This patch is rearranging code a bit to add WatchpointResources to
Process. A WatchpointResource is meant to represent a hardware
watchpoint register in the inferior process. It has an address, a size,
a type, and a list of Watchpoints that are using this
WatchpointResource.
This current patch doesn't add any of the features of
WatchpointResources that make them interesting -- a user asking to watch
a 24 byte object could watch this with three 8 byte WatchpointResources.
Or a Watchpoint on 1 byte at 0x1002 and a second watchpoint on 1 byte at
0x1003, these must both be served by a single WatchpointResource on that
doubleword at 0x1000 on a 64-bit target, if two hardware watchpoint
registers were used to track these separately, one of them may not be
hit. Or if you have one Watchpoint on a variable with a condition set,
and another Watchpoint on that same variable with a command defined or
different condition, or ignorecount, both of those Watchpoints need to
evaluate their criteria/commands when their WatchpointResource has been
hit.
There's a bit of code movement to rearrange things in the direction I'll
need for implementing this feature, so I want to start with reviewing &
landing this mostly NFC patch and we can focus on the algorithmic
choices about how WatchpointResources are shared and handled as they're
triggeed, separately.
This patch also stops printing "Watchpoint <n> hit: old value: <x>, new
vlaue: <y>" for Read watchpoints. I could make an argument for print
"Watchpoint <n> hit: current value <x>" but the current output doesn't
make any sense, and the user can print the value if they are
particularly interested. Read watchpoints are used primarily to
understand what code is reading a variable.
This patch adds more fallbacks for how to print the objects being
watched if we have types, instead of assuming they are all integral
values, so a struct will print its elements. As large watchpoints are
added, we'll be doing a lot more of those.
To track the WatchpointSP in the WatchpointResources, I changed the
internal API which took a WatchpointSP and devolved it to a Watchpoint*,
which meant touching several different Process files. I removed the
watchpoint code in ProcessKDP which only reported that watchpoints
aren't supported, the base class does that already.
I haven't yet changed how we receive a watchpoint to identify the
WatchpointResource responsible for the trigger, and identify all
Watchpoints that are using this Resource to evaluate their conditions
etc. This is the same work that a BreakpointSite needs to do when it has
been tiggered, where multiple Breakpoints may be at the same address.
There is not yet any printing of the Resources that a Watchpoint is
implemented in terms of ("watchpoint list", or
SBWatchpoint::GetDescription).
"watchpoint set var" and "watchpoint set expression" take a size
argument which was previously 1, 2, 4, or 8 (an enum). I've changed this
to an unsigned int. Most hardware implementations can only watch 1, 2,
4, 8 byte ranges, but with Resources we'll allow a user to ask for
different sized watchpoints and set them in hardware-expressble terms
soon.
I've annotated areas where I know there is work still needed with
LWP_TODO that I'll be working on once this is landed.
I've tested this on aarch64 macOS, aarch64 Linux, and Intel macOS.
https://discourse.llvm.org/t/rfc-large-watchpoint-support-in-lldb/72116
show more ...
|
Revision tags: llvmorg-17.0.5 |
|
#
805a36aa |
| 02-Nov-2023 |
David Spickett <david.spickett@linaro.org> |
[lldb][AArch64] Simplify handing of scalable registers using vg and svg (#70914)
This removes explicit invalidation of vg and svg that was done in
`GDBRemoteRegisterContext::AArch64Reconfigure`. Th
[lldb][AArch64] Simplify handing of scalable registers using vg and svg (#70914)
This removes explicit invalidation of vg and svg that was done in
`GDBRemoteRegisterContext::AArch64Reconfigure`. This was in fact
covering up a bug elsehwere.
Register information says that a write to vg also invalidates svg (it
does not unless you are in streaming mode, but we decided to keep it
simple and say it always does).
This invalidation was not being applied until *after* AArch64Reconfigure
was called. This meant that without those manual invalidates this
happened:
* vg is written
* svg is not invalidated
* Reconfigure uses the written vg value
* Reconfigure uses the *old* svg value
I have moved the AArch64Reconfigure call to after we've processed the
invalidations caused by the register write, so we no longer need the
manual invalidates in AArch64Reconfigure.
In addition I have changed the order in which expedited registers as
parsed. These registers come with a stop notification and include,
amongst others, vg and svg.
So now we:
* Parse them and update register values (including vg and svg)
* AArch64Reconfigure, which uses those values, and invalidates every
register, because offsets may have changed.
* Parse the expedited registers again, knowing that none of the values
will have changed due to the scaling.
This means we use the expedited registers during the reconfigure, but
the invalidate does not mean we throw all of them away.
The cost is we parse them twice client side, but this is cheap compared
to a network packet, and is limited to AArch64 targets only.
On a system with SVE and SME, these are the packets sent for a step:
```
(lldb) b-remote.async> < 803> read packet:
$T05thread:p1f80.1f80;name:main.o;threads:1f80;thread-pcs:000000000040056c<...>a1:0800000000000000;d9:0400000000000000;reason:trace;#fc
intern-state < 21> send packet: $xfffffffff200,200#5e
intern-state < 516> read packet:
$e4f2ffffffff000000<...>#71
intern-state < 15> send packet: $Z0,400568,4#4d
intern-state < 6> read packet: $OK#9a
dbg.evt-handler < 16> send packet: $jThreadsInfo#c1
dbg.evt-handler < 224> read packet:
$[{"name":"main.o","reason":"trace","registers":{"161":"0800000000000000",<...>}],"signal":5,"tid":8064}]]#73
```
You can see there are no extra register reads which means we're using
the expedited registers.
For a write to vg:
```
(lldb) register write vg 4
lldb < 37> send packet:
$Pa1=0400000000000000;thread:1f80;#4a
lldb < 6> read packet: $OK#9a
lldb < 20> send packet: $pa1;thread:1f80;#29
lldb < 20> read packet: $0400000000000000#04
lldb < 20> send packet: $pd9;thread:1f80;#34
lldb < 20> read packet: $0400000000000000#04
```
There is the initial P write, and lldb correctly assumes that SVG is
invalidated by this also so we read back the new vg and svg values
afterwards.
show more ...
|
Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init |
|
#
8402ad23 |
| 11-Jul-2023 |
Jim Ingham <jingham@apple.com> |
Add a generic Process method to dump plugin history.
I need to call this to figure out why the assert in StopInfoMachException::CreateStopReasonWithMachException is triggering, but it isn't appropri
Add a generic Process method to dump plugin history.
I need to call this to figure out why the assert in StopInfoMachException::CreateStopReasonWithMachException is triggering, but it isn't appropriate to directly access the GDBRemoteCommunication there. And dumping whatever history the process plugin has collected during the run isn't gdb-remote specific...
Differential Revision: https://reviews.llvm.org/D154992
show more ...
|
#
9442e81f |
| 24-Jun-2023 |
Alex Langford <alangford@apple.com> |
[lldb][NFCI] Remove ConstString from Process::ConfigureStructuredData
This is a follow-up to b4827a3c0a7ef121ca376713e115b04eff0f5194.
Differential Revision: https://reviews.llvm.org/D153675
|
Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init |
|
#
54981bb7 |
| 13-Jan-2023 |
David Spickett <david.spickett@linaro.org> |
[lldb] Read register fields from target XML
This teaches ProcessGDBRemote to look for "flags" nodes in the target XML that tell you what fields a register has.
https://sourceware.org/gdb/onlinedocs
[lldb] Read register fields from target XML
This teaches ProcessGDBRemote to look for "flags" nodes in the target XML that tell you what fields a register has.
https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html
It will check for various invalid inputs like: * Flags nodes with 0 fields in them. * Start or end being > the register size. * Fields that overlap. * Required properties not being present (e.g. no name). * Flag sets being redefined.
If anything untoward is found, we'll just drop the field or the flag set altogether. Register fields are a "nice to have" so LLDB shouldn't be crashing because of them, instead just log anything we throw away. So the user can fix their XML/file a bug with their vendor.
Once that is done it will sort the fields and pass them to the RegisterFields class I added previously.
There is no way to see these fields yet, so tests for this code will come later when the formatting code is added.
The fields are stored in a map of unique pointers on the ProcessGDBRemote class. It will give out raw pointers on the assumption that the GDB process lives longer than the users of those pointers do. Which means RegisterInfo is still a trivial struct but we are properly destroying the fields when the GDB process ends.
We can't store the fields directly in the map because adding new items may cause its storage to be reallocated, which would invalidate pointers we've already given out.
Reviewed By: jasonmolenda, JDevlieghere
Differential Revision: https://reviews.llvm.org/D145574
show more ...
|
#
eaeb8ddd |
| 14-Feb-2023 |
Jason Molenda <jason@molenda.com> |
[LLDB] add arch-specific watchpoint behavior defaults to lldb
lldb was originally designed to get the watchpoint exception behavior from the gdb remote serial protocol stub -- exceptions are either
[LLDB] add arch-specific watchpoint behavior defaults to lldb
lldb was originally designed to get the watchpoint exception behavior from the gdb remote serial protocol stub -- exceptions are either received before the instruction executes, or after the instruction has executed. This behavior was reported via two lldb extensions to gdb RSP, so generic remote stubs like gdbserver or a JTAG stub, would not tell lldb which behavior was correct, and it would default to "exceptions are received after the instruction has executed". Two architectures hard coded their correct "exceptions before instruction" behavior, to work around this issue.
Most architectures have a fixed behavior of watchpoint exceptions, and we can center that information in lldb. We can allow a remote stub to override the default behavior via our packet extensions if it's needed on a specific target.
This patch also separates the fetching of the number of watchpoints from whether exceptions are before/after the insn. Currently if lldb couldn't fetch the number of watchpoints (not really needed), it also wouldn't get when exceptions are received, and watchpoint handling would fail. lldb doesn't actually use the number of watchpoints for anything beyond printing it to the user.
Differential Revision: https://reviews.llvm.org/D143215 rdar://101426626
show more ...
|
#
db223b7f |
| 18-Jan-2023 |
Jason Molenda <jason@molenda.com> |
Do qProcessInfo-hint binary loading later in Process setup
The remote stub may give lldb hints about binaries to be loaded, especially in a firmware type environment, and relay those hints in the qP
Do qProcessInfo-hint binary loading later in Process setup
The remote stub may give lldb hints about binaries to be loaded, especially in a firmware type environment, and relay those hints in the qProcessInfo response. The binary loading was done very early in Process setup, before we had any threads, and this made it complicated for people to write dSYM python scripts which need access to a thread. Delay the binary loading until a bit later in the Process startup.
Differential Revision: https://reviews.llvm.org/D141972 rdar://104235301
show more ...
|
Revision tags: llvmorg-15.0.7 |
|
#
2fe83274 |
| 07-Jan-2023 |
Kazu Hirata <kazu@google.com> |
[lldb] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to clean up the "using" declarations, #include "llvm/
[lldb] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to clean up the "using" declarations, #include "llvm/ADT/Optional.h", etc.
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
f190ce62 |
| 07-Jan-2023 |
Kazu Hirata <kazu@google.com> |
[lldb] Add #include <optional> (NFC)
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>.
I'll post a separate patch to actually replace llvm::Optiona
[lldb] Add #include <optional> (NFC)
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>.
I'll post a separate patch to actually replace llvm::Optional with std::optional.
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
ee11ef6d |
| 13-Dec-2022 |
Jason Molenda <jason@molenda.com> |
Launch state discoverable in Darwin, use for SafeToCallFunctions
The dynamic linker on Darwin, dyld, can provide status of the process state for a few significant points early on, most importantly,
Launch state discoverable in Darwin, use for SafeToCallFunctions
The dynamic linker on Darwin, dyld, can provide status of the process state for a few significant points early on, most importantly, when libSystem has been initialized and it is safe to call functions behind the scenes. Pipe this information up from debugserver to DynamicLoaderMacOS, for the DynamicLoader::IsFullyInitialized() method, then have Thread::SafeToCallFunctions use this information. Finally, for the two utility functions in the AppleObjCRuntimeV2 LanguageRuntime plugin that I was fixing, call this method before running our utility functions to collect the list of objc classes registered in the runtime.
User expressions will still be allowed to run any time - we assume the user knows what they are doing - but these two additional utility functions that they are unaware of will be limited by this state.
Differential Revision: https://reviews.llvm.org/D139054 rdar://102436092 can probably make function calls.
show more ...
|
Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1 |
|
#
97495874 |
| 13-Sep-2022 |
Felipe de Azevedo Piovezan <fpiovezan@apple.com> |
[lldb] Reset breakpoint hit count before new runs
A common debugging pattern is to set a breakpoint that only stops after a number of hits is recorded. The current implementation never resets the hi
[lldb] Reset breakpoint hit count before new runs
A common debugging pattern is to set a breakpoint that only stops after a number of hits is recorded. The current implementation never resets the hit count of breakpoints; as such, if a user re-`run`s their program, the debugger will never stop on such a breakpoint again.
This behavior is arguably undesirable, as it renders such breakpoints ineffective on all but the first run. This commit changes the implementation of the `Will{Launch, Attach}` methods so that they reset the _target's_ breakpoint hitcounts.
Differential Revision: https://reviews.llvm.org/D133858
show more ...
|
Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3 |
|
#
9ba71d03 |
| 12-Aug-2022 |
Michał Górny <mgorny@moritz.systems> |
[lldb] [gdb-remote] Remove unimplemented ProcessIDIsValid() (NFC)
This method is not implemented and not referenced anywhere in the code.
Sponsored by: The FreeBSD Foundation
|