Commit Graph

1080 Commits

Author SHA1 Message Date
Greg Clayton
a118f5f398 Fix type lookup bug where wrong decl context was being used for a DIE. (#94846)
The function that calculated the declaration context for a DIE was incorrectly transparently traversing acrosss DW_TAG_subprogram dies when climbing the parent DIE chain. This meant that types defined in functions would appear to have the declaration context of anything above the function. I fixed the GetTypeLookupContextImpl(...) function in DWARFDIE.cpp to not transparently skip over functions, lexical blocks and inlined functions and compile and type units. Added a test to verify things are working.
2024-06-11 13:58:26 -07:00
Dmitry Vasilyev
3e39328b62 [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (#94672)
The different build configuration and target Linux system can load a
different number of .so libraries. Add and check own libraries.
2024-06-10 18:51:47 +04:00
Dmitry Vasilyev
23b8f59f09 [lldb] Gracefully down TestCoroutineHandle test in case the 'coroutine' feature is missing (#94903)
Do not let the compiler gets failed in case the target platform does not
support the 'coroutine' C++ features. Just compile without it and let
lldb know about missed/unsupported feature.
2024-06-10 13:02:55 +04:00
Alex Langford
ba7f52ccf4 [lldb] Fix TestStatisticsAPI after 9293fc7981 (#94683) 2024-06-06 14:25:53 -07:00
Jonas Devlieghere
539b72f2e1 [lldb] Return an llvm::Expected from DWARFExpression::Evaluate (NFCI) (#94420)
Change the signature of `DWARFExpression::Evaluate` and
`DWARFExpressionList::Evaluate` to return an `llvm::Expected` instead of a
boolean. This eliminates the `Status` output parameter and generally improves
error handling.
2024-06-05 10:57:46 -07:00
Alexey Merzlyakov
d3a9043ec2 [lldb][RISCV] Add RegisterContextPOSIXCore for RISC-V 64 (#93297)
The PR adds the support of CoreDump debugging for RISC-V 64. It
implements new `RegisterContextCorePOSIX_riscv64` class.

Also, the contribution fixes `GetRegisterCount()` ->
`GetRegisterSetCount()` misprint in
`RegisterContextPOSIX_riscv64::GetRegisterSetCount()` method, which
leaded to `set && "Register set should be valid."` assertion during
`register info aX` command call.

The patch was tested (on coredumps generated for simple Integer/FP
calculation code) for _cross x86_64 -> RISCV_ and _native RISCV_ LLDB
builds. There were performed basic LLDB functionality tests, such as:

 - CoreDump file load
 - Backtrace / frames
 - GP/FP registers read/info/list
 - Basic switch between threads
 - Disassembler code
 - Memory regions read / display
2024-06-05 10:14:48 +01:00
Michael Buch
aad7874000 [lldb][test][NFC] TestBreakpointSetRestart.py: split up assertion to determine which check specifically fails in CI
This test consistently fails on the public macOS ASAN CI (and isn't
reproducible locally):
```
FAIL: test_breakpoint_set_restart_dwarf
(TestBreakpointSetRestart.BreakpointSetRestart)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1756, in test_method
    return attrvalue(self)
  File
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py",
line 150, in wrapper
    return func(*args, **kwargs)
  File
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py",
line 36, in test_breakpoint_set_restart
    self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1,
VALID_BREAKPOINT)
AssertionError: False is not true : Got a valid breakpoint
```

From this error we're not quite sure what about the breakpoint here is
the problem.

This patch splits up the assertion to narrow down the issue.
2024-06-03 17:04:16 +01:00
Pavel Labath
763b96c86d [lldb] Avoid (unlimited) GetNumChildren calls when printing values (#93946)
For some data formatters, even getting the number of children can be an
expensive operations (e.g., needing to walk a linked list to determine
the number of elements). This is then wasted work when we know we will
be printing only small number of them.

This patch replaces the calls to GetNumChildren (at least those on the
"frame var" path) with the calls to the capped version, passing the
value of `max-children-count` setting (plus one)
2024-06-03 10:34:44 +02:00
Pavel Labath
a2bcb932f3 [lldb] Attempt to fix TestCompletion on macos
Macos will automatically load dependent modules when creating a target,
resulting in more modules than the test expects.
2024-05-30 15:28:13 +00:00
Pavel Labath
d554f2379b [lldb] Fix module name tab completion (#93458)
Module names can be matched either by a full path or just their
basename. The completion machinery tried to do both, but had several
bugs:
- it always inserted the basename as a completion candidate, even if the
string being completed was a full path
- due to FileSpec canonicalization, it lost information about trailing
slashes (it treated "lib/<TAB>" as "lib<TAB>", even though it's clear
the former was trying to complete a directory name)
- due to both of the previous issues, the completion candidates could
end up being shorter than the string being completed, which caused
crashes (string out of range errors) when attempting to substitute the
results.

This patch rewrites to logic to remove these kinds of issues:
- basename and full path completion are handled separately
- full path completion is attempted always, basename only if the input
string does not contain a slash
- the code remembers both the canonical and original spelling or the
completed argument. The canonical arg is used for matching, while the
original spelling is used for completion. This way "/foo///.//b<TAB>"
can still match "/foo/bar", but it will complete to "/foo///.//bar".
2024-05-30 09:57:13 +02:00
Dmitry Vasilyev
e37da2cef7 [lldb] Fixed the TestExitDuringExpression test in case of a remote target (#93119)
Sometimes this test failed on the assert `The thread exited` in case of
a remote target. Increase the timeout to 1 second to avoid a racing
condition.
2024-05-23 14:01:10 +04:00
Dmitry Vasilyev
4d9e7b14e4 [lldb][Windows] Fixed the TestBreakpointCommand test (#93122)
The TestBreakpointCommand test is incorrectly disabled for Windows
target. We can disable it for Windows host instead or just fix the
issue. This patch fixes the path separator in
BreakpointResolverFileLine::DeduceSourceMapping() and the Windows
specific absolute path in the test in case of the Windows host.
2024-05-23 13:59:02 +04:00
Med Ismail Bennani
ae3f68066c Revert "[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392)" (#93153)
Reverts llvm/llvm-project#93149 since it breaks
https://lab.llvm.org/buildbot/#/builders/68/builds/74799
2024-05-23 01:46:29 -07:00
Med Ismail Bennani
4cc6d0f4df [lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan (Reland #70392) (#93149)
This patch makes ScriptedThreadPlan conforming to the ScriptedInterface
& ScriptedPythonInterface facilities by introducing 2
ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes.

This allows us to get rid of every ScriptedThreadPlan-specific SWIG
method and re-use the same affordances as other scripting offordances,
like Scripted{Process,Thread,Platform} & OperatingSystem.

To do so, this adds new transformer methods for `ThreadPlan`, `Stream` &
`Event`, to allow the bijection between C++ objects and their python
counterparts.

This just re-lands #70392 after fixing test failures.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-05-23 01:25:48 -07:00
Pavel Labath
bbd54e08b0 Reapply "[lldb/aarch64] Fix unwinding when signal interrupts a leaf f… (#92503)
…unction (#91321)"

This reapplies fd1bd53ba5, which was
reverted due to a test failure on aarch64/windows. The failure was
caused by a combination of several factors:
- clang targeting aarch64-windows (unlike msvc, and unlike clang
targeting other aarch64 platforms) defaults to -fomit-frame-pointers
- lldb's code for looking up register values for `<same>` unwind rules
is recursive
- the test binary creates a very long chain of fp-less function frames
(it manages to fit about 22k frames before it blows its stack)

Together, these things have caused lldb to recreate the same deep
recursion when unwinding through this, and blow its own stack as well.
Since lldb frames are larger, about 4k frames like this was sufficient
to trigger the stack overflow.

This version of the patch works around this problem by increasing the
frame size of the test binary, thereby causing it to blow its stack
sooner. This doesn't fix the issue -- the same problem can occur with a
real binary -- but it's not very likely, as it requires an infinite
recursion in a simple (so it doesn't use the frame pointer) function
with a very small frame (so you can fit a lot of them on the stack).

A more principled fix would be to make lldb's lookup code non-recursive,
but I believe that's out of scope for this patch.

The original patch description follows:

A leaf function may not store the link register to stack, but we it can
still end up being a non-zero frame if it gets interrupted by a signal.
Currently, we were unable to unwind past this function because we could
not read the link register value.

To make this work, this patch:
- changes the function-entry unwind plan to include the `fp|lr = <same>`
rules. This in turn necessitated an adjustment in the generic
instruction emulation logic to ensure that `lr=[sp-X]` can override the
`<same>` rule.
- allows the `<same>` rule for pc and lr in all
`m_all_registers_available` frames (and not just frame zero).

The test verifies that we can unwind in a situation like this, and that
the backtrace matches the one we computed before getting a signal.
2024-05-21 10:56:26 +02:00
Dmitry Vasilyev
2217d1706a [lldb][Windows] Fixed LibcxxChronoTimePointSecondsSummaryProvider() (#92701)
This patch fixes #92574. It is a replacement for #92575.
2024-05-20 13:44:52 +04:00
Pavel Labath
b27eb0ae82 [lldb] Avoid modifying the source tree in TestCompletion.py
This was a side-effect of the "optimization" in #92281. Deoptimize the
code slightly.
2024-05-17 07:33:26 +00:00
Jacob Lalonde
47d80ec180 [LLDB/Coredump] Only take the Pthread from stack start to the stackpointer + red_zone (#92002)
Currently in Core dumps, the entire pthread is copied, including the
unused space beyond the stack pointer. This causes large amounts of core
dump inflation when the number of threads is high, but the stack usage
is low. Such as when an application is using a thread pool.

This change will optimize for these situations in addition to generally
improving the core dump performance for all of lldb.
2024-05-16 14:17:19 -07:00
Dmitry Vasilyev
ce961c5607 [lldb] Fixed the TestFdLeak test (#92273)
Use `os.devnull` instead of `/dev/null`.
2024-05-16 07:44:08 +04:00
Dave Lee
8530b1c464 [lldb] Support custom LLVM formatting for variables (#91868)
Re-apply https://github.com/llvm/llvm-project/pull/81196, with a fix that handles the 
absence of llvm formatting: 
https://github.com/llvm/llvm-project/pull/91868/commits/3ba650e91eded3543764f37921dcce3b
b47d425f
2024-05-15 14:44:42 -07:00
Dmitry Vasilyev
7645269710 [lldb] Fixed the TestNetBSDCore test (#92285)
TestNetBSDCore.py contains 3 classes with the same test names
test_aarch64 and test_amd64. It causes conflicts because the same build
dir. Add suffixes to avoid conflicts.
2024-05-15 21:06:30 +04:00
Dmitry Vasilyev
eb822dc258 [lldb] Fixed the TestCompletion test running on a remote target (#92281)
Install the image to the remote target if necessary.
2024-05-15 21:03:15 +04:00
Dmitry Vasilyev
fc1df55bcf [lldb][Windows] Fixed the test gdb_remote_client/TestGDBRemotePlatformFile (#92088)
The tests `test_file_permissions` and `test_file_permissions_fallback`
are disabled for Windows target. These tests use MockGDBServerResponder
and do not depend on the real target. These tests failed in case of
Windows host and Linux target. Disable them for Windows host too.
2024-05-15 20:50:58 +04:00
Dmitry Vasilyev
eacefba9aa [lldb][Windows] Fixed tests TestPty and TestPtyServer (#92090)
The tests TestPty and TestPtyServer use the Unix specific python builtin
module termios. They are failed in case of Windows host and Linux
target. Disable them for Windows host too.
2024-05-15 14:44:24 +04:00
David Spickett
03bdfb6561 [lldb][test][FreeBSD] Fix some concurrent event tests (#84155)
A lot of `TestConcurrent*.py` expect one of the threads to crash, but we
weren't checking for it properly.

Possibly because signal reporting got better on FreeBSD at some point,
and it now shows the same info as Linux does.

```
  lldb-api :: functionalities/inferior-changed/TestInferiorChanged.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashing.py
  lldb-api :: functionalities/inferior-crashing/TestInferiorCrashingStep.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
  lldb-api :: functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
  lldb-api :: functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
```

Fixes #48777

`TestConcurrentTwoBreakpointsOneSignal.py` no longer fails, at least on
an AWS instance, so I've removed the xfail there.
2024-05-15 11:25:15 +01:00
Dmitry Vasilyev
0f17d9a28c [lldb] Fixed the test TestThreadStates when run with a remote target (#92086)
self.wait_for_running_event(process) is always called after
self.runCmd("continue"). It is strange to expect eStateConnected here.
This test failed in case of a remote target. The correct state is
eStateRunning. Removed incorrect checking.
2024-05-14 20:05:22 +04:00
Dmitry Vasilyev
f658d84e01 [lldb] Fixed the test TestExec (#92082)
Install `secondprog` to the remote target if necessary.
2024-05-14 14:02:31 +04:00
Dmitry Vasilyev
ac42f7689d [lldb] Fixed the test TestDyldLaunchLinux (#92080)
Install a.out and libsignal_file.so to the remote target if necessary.
2024-05-14 14:00:16 +04:00
Med Ismail Bennani
b3a835e129 [lldb] Verify target stop-hooks support with scripted process (#91107)
This patch makes sure that scripted process are compatible with target
stop-hooks. This wasn't tested in the past, but it turned out to be
working out of the box.

rdar://124396534

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-05-09 10:39:05 -07:00
David Spickett
fbaba780f6 [lldb][test][FreeBSD] Remove xfails from TestGDBRemoteLoad (#84026)
Fixes #48758

These are now passing on AArch64 FreeBSD 14.
2024-05-02 16:55:42 +01:00
David Spickett
a015f015db [lldb][test][FreeBSD] Remove corefile test xfails (#84022)
Fixes #48759

As stated on the issue this was fixed by a change in FreeBSD 13, and
I've confirmed that it passes on 14 as well.
2024-05-02 08:48:40 +01:00
Dave Lee
0f628fdb1a Revert "[lldb] Support custom LLVM formatting for variables (#81196)"
This reverts commit 7a8d15e919.
2024-04-30 16:15:19 -07:00
Dave Lee
7a8d15e919 [lldb] Support custom LLVM formatting for variables (#81196)
Adds support for applying LLVM formatting to variables.

The reason for this is to support cases such as the following.

Let's say you have two separate bytes that you want to print as a
combined hex value. Consider the following summary string:

```
${var.byte1%x}${var.byte2%x}
```

The output of this will be: `0x120x34`. That is, a `0x` prefix is
unconditionally applied to each byte. This is unlike printf formatting
where you must include the `0x` yourself.

Currently, there's no way to do this with summary strings, instead
you'll need a summary provider in python or c++.

This change introduces formatting support using LLVM's formatter system.
This allows users to achieve the desired custom formatting using:

```
${var.byte1:x-}${var.byte2:x-}
```

Here, each variable is suffixed with `:x-`. This is passed to the LLVM
formatter as `{0:x-}`. For integer values, `x` declares the output as
hex, and `-` declares that no `0x` prefix is to be used. Further, one
could write:

```
${var.byte1:x-2}${var.byte2:x-2}
```

Where the added `2` results in these bytes being written with a minimum
of 2 digits.

An alternative considered was to add a new format specifier that would
print hex values without the `0x` prefix. The reason that approach was
not taken is because in addition to forcing a `0x` prefix, hex values
are also forced to use leading zeros. This approach lets the user have
full control over formatting.
2024-04-30 10:45:10 -07:00
David Spickett
0c8151ac80 [lldb][Test] Disable concurrent vfork tests on Arm and AArch64 Linux (again)
5f3e106de3 made them a lot more stable but
there are still occasions where they will timeout and leave behind stale
processes.

For example https://lab.llvm.org/buildbot/#/builders/96/builds/56699.
2024-04-29 11:41:14 +01:00
Chelsea Cassanova
a4c21d17fe [lldb][sbapi] Fix API break in SBDebugger broadcast bits (#90261)
https://github.com/llvm/llvm-project/pull/87409 removed the broadcast
bits from SBDebugger and placed them in `lldb-enumerations.h`. This is
API-breaking so this commits places the enum back into `SBDebugger.h`
and references the bits from `lldb-enumerations.h`.

rdar://127128536
2024-04-26 13:18:45 -07:00
Zequan Wu
d3993ac189 [lldb][test] Correctly fix break at _dl_debug_state test on arm.
If lldb finds the dynamic linker in the search path or if the binary is linked staticlly, it will fail at `lldbutil.run_break_set_by_symbol` because the breakpoint is resolved. Otherwise, it's not resolved at this point. But we don't care if it's resolved or not. This test cares about if the breakpoint is hit or not after launching.

This changes the num_expected_locations to -2, which means don't assert on if this breakpoint resolved or not.
2024-04-18 11:13:17 -04:00
Zequan Wu
a1e7c83af1 [lldb] Disable break at _dl_debug_state test on arm 2024-04-18 10:40:35 -04:00
Zequan Wu
60b90b5233 [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (#88792)
If user sets a breakpoint at `_dl_debug_state` before the process
launched, the breakpoint is not resolved yet. When lldb loads dynamic
loader module, it's created with `Target::GetOrCreateModule` which
notifies any pending breakpoint to resolve. However, the module's
sections are not loaded at this time. They are loaded after returned
from
[Target::GetOrCreateModule](0287a5cc4e/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (L574-L577)).
This change fixes it by manually resolving breakpoints after creating
dynamic loader module.
2024-04-17 16:09:38 -04:00
Pavel Labath
5f3e106de3 [lldb/linux] Make sure the process continues running after a detach (#88494)
Fixes #85084

Whenever an inferior thread stops, lldb-server sends a SIGSTOP to all
other threads in the process to force them to stop as well. If those
threads stop on their own before they get a signal, this SIGSTOP will
remain pending and be delivered the next time the process resumes.

Normally, this is not a problem, because lldb-server will detect this
stale SIGSTOP and resume the process. However, if we detach from the
process while it has these SIGSTOPs pending, they will get immediately
delivered, and the process will remain stopped (most likely forever).

This patch fixes that by sending a SIGCONT just before detaching from
the process. This signal cancels out any pending SIGSTOPs, and ensures
it is able to run after we detach. It does have one somewhat unfortunate
side-effect that in that the process's SIGCONT handler (if it has one)
will get executed spuriously (from the process's POV).

This could be _sometimes_ avoided by tracking which threads got send a
SIGSTOP, and whether those threads stopped due to it. From what I could
tell by observing its behavior, this is what gdb does. I have not tried
to replicate that behavior here because it adds a nontrivial amount of
complexity and the result is still uncertain -- we still need to send a
SIGCONT (and execute the handler) when any thread stops for some other
reason (and leaves our SIGSTOP hanging). Furthermore, since SIGSTOPs
don't stack, it's also possible that our SIGSTOP/SIGCONT combination
will cancel a genuine SIGSTOP being sent to the debugger application (by
someone else), and there is nothing we can do about that. For this
reason I think it's simplest and most predictible to just always send a
SIGCONT when detaching, but if it turns out this is breaking something,
we can consider implementing something more elaborate.

One alternative I did try is to use PTRACE_INTERRUPT to suspend the
threads instead of a SIGSTOP. PTRACE_INTERUPT requires using
PTRACE_SEIZE to attach to the process, which also made this solution
somewhat complicated, but the main problem with that approach is that
PTRACE_INTERRUPT is not considered to be a signal-delivery-stop, which
means it's not possible to resume it while injecting another signal to
the inferior (which some of our tests expect to be able to do). This
limitation could be worked around by forcing the thread into a signal
delivery stop whenever we need to do this, but this additional
complication is what made me think this approach is also not worthwhile.

This patch should fix (at least some of) the problems with
TestConcurrentVFork, but I've also added a dedicated test for checking
that a process keeps running after we detach. Although the problem I'm
fixing here is linux-specific, the core functinoality of not stopping
after a detach should function the same way everywhere.
2024-04-17 13:05:15 +02:00
Usama Hameed
988ffd0672 Add asan tests for libsanitizers. (#88349) (#88962)
The previous patch was reverted because the test fails to build when
libsanitizers is not present. This patch catches the BuildError
exception and skips the test appropriately.

This patch tests LLDB integration with libsanitizers for ASan.

rdar://111856681
2024-04-16 16:00:14 -07:00
Adrian Prantl
f8e2ec13a8 Revert "Add asan tests for libsanitizers. (#88349)"
This reverts commit 82f479ba31 due to bot breakage.
2024-04-16 08:29:09 -07:00
Usama Hameed
82f479ba31 Add asan tests for libsanitizers. (#88349)
This patch tests LLDB integration with libsanitizers for ASan.

rdar://111856681
2024-04-15 19:42:45 -07:00
Mark de Wever
a34887550b [LLDB][libc++] Adds valarray proxy data formatters. (#88613)
These proxies are returned by operator[](...). These proxies all
"behave" the same. They store a pointer to the data of the valarray they
are a proxy for and they have an internal array of indices. This
internal array is considered its contents.
2024-04-15 18:46:58 +02:00
Mark de Wever
e481f56528 [lldb][libc++] Adds local_t clock data formatters. (#88178) 2024-04-13 11:50:02 +02:00
Chelsea Cassanova
8c3cb6b55b Reland "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into ll… (#88331)
…db-enumerations.h" (#88324)"

This reverts commit 9f6d08f256. This broke
the build because of a usage of one of the original SBDebugger broadcast
bits that wasn't updated in the original commit.
2024-04-11 09:56:22 -07:00
Chelsea Cassanova
9f6d08f256 Revert "[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h" (#88324)
Reverts llvm/llvm-project#87409 due a missed update to the broadcast bit
causing a build failure on the x86_64 Debian buildbot.
2024-04-10 14:54:30 -07:00
Chelsea Cassanova
af7c196fb8 [lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h (#87409)
When the `eBroadcastBitProgressCategory` bit was originally added to
Debugger.h and SBDebugger.h, each corresponding bit was added in order
of the other bits that were previously there. Since `Debugger.h` has an
enum bit that `SBDebugger.h` does not, this meant that their offsets did
not match.

Instead of trying to keep the bit offsets in sync between the two, it's
preferable to just move SBDebugger's enum into the main enumerations
header and use the bits from there. This also requires that API tests using the bits from SBDebugger update their usage.
2024-04-10 14:45:49 -07:00
Jordan Rupprecht
a6caceed8d [lldb] Don't crash when attempting to parse breakpoint id N. as N.* (#87263)
We check if the next character after `N.` is `*` before we check its
length. Using `split` on the string is cleaner and less error prone than
using indices with `find` and `substr`.

Note: this does not make `N.` mean anything, it just prevents assertion
failures. `N.` is treated the same as an unrecognized breakpoint name:

```
(lldb) breakpoint enable 1
1 breakpoints enabled.
(lldb) breakpoint enable 1.*
1 breakpoints enabled.
(lldb) breakpoint enable 1.
0 breakpoints enabled.
(lldb) breakpoint enable xyz
0 breakpoints enabled.
```

Found via LLDB fuzzers.
2024-04-01 16:02:12 -05:00
Pablo Busse
154cea4673 [lldb] Fix type lookup in DWARF .o files via debug map (#87177)
An inverted condition causes `SymbolFileDWARFDebugMap::FindTypes` to
bail out after inspecting the first .o file in each module.

The same kind of bug is found in
`SymbolFileDWARFDebugMap::ParseDeclsForContext`.

Correct both early exit conditions and add a regression test for lookup
of up a type defined in a secondary compilation unit.

Fixes #87176
2024-03-31 17:17:32 +01:00
Felipe de Azevedo Piovezan
12329648e2 [lldb] Omit --show-globals in help target var (#85855)
This option doesn't exist. It is currently displayed by `help target
var` due to a bug introduced by 41ae8e7445 in 2018.

Some code for `target var` and `frame var` is shared, and some hard-code
constants are used in order to filter out options that belong only to
`frame var`. However, the aforementioned commit failed to update these
constants properly. This patch addresses the issue by having a _single_
place where the filtering of options needs to be done.
2024-03-20 07:03:24 -07:00