Commit Graph

18207 Commits

Author SHA1 Message Date
Kazu Hirata
a01d7df090 [lldb] Avoid repeated map lookups (NFC) (#112823) 2024-10-18 10:40:13 -07:00
Benjamin Kramer
8e6abf526e Fix -Wswitch after 508fd966fb 2024-10-18 12:30:16 +02:00
Jacob Lalonde
5033ea73bb [LLDB][Minidump] Add breakpoint stop reasons to the minidump. (#108448)
Recently my coworker @jeffreytan81 pointed out that Minidumps don't show
breakpoints when collected. This was prior blocked because Minidumps
could only contain 1 exception, now that we support N signals/sections
we can save all the threads stopped on breakpoints.
2024-10-17 15:26:05 -07:00
Pavel Labath
98b419ca76 [lldb] Don't exit the main loop when in runs out of things to listen on (#112565)
This behavior made sense in the beginning as the class was completely
single threaded, so if the source count ever reached zero, there was no
way to add new ones. In https://reviews.llvm.org/D131160, the class
gained the ability to add events (callbacks) from other threads, which
means that is no longer the case (and indeed, one possible use case for
this class -- acting as a sort of arbiter for multiple threads wanting
to run code while making sure it runs serially -- has this class sit in
an empty Run call most of the time). I'm not aware of us having a use
for such a thing right now, but one of my tests in another patch turned
into something similar by accident.

Another problem with the current approach is that, in a
distributed/dynamic setup (multiple things using the main loop without a
clear coordinator), one can never be sure whether unregistering a
specific event will terminate the loop (it depends on whether there are
other listeners). We had this problem in lldb-platform.cpp, where we had
to add an additional layer of synchronization to avoid premature
termination. We can remove this if we can rely on the loop terminating
only when we tell it to.
2024-10-17 17:29:38 +02:00
Jonas Devlieghere
4897fc44a9 [lldb] Narrow scope of -Wno-deprecated-declarations (NFC) (#112276)
Currently all of LLDB is being compiled with
-Wno-deprecated-declarations. That's not desirable, especially as part
of the LLVM monorepo, as we miss deprecation warnings from LLVM and
clang.

According to the git history, this was first introduced to suppress
warnings related to auto_ptr. Since then, other things have been
deprecated and gone unnoticed. This patch limits the flag to Host.mm
which uses a handful of LSApplication headers that have no replacement.

rdar://112040718
2024-10-17 08:22:56 -07:00
Jonas Devlieghere
8c7f80f775 [lldb] Disable warning about codecvt_utf8 deprecation (NFC) (#112446)
Disable -Wdeprecated-declarations for codecvt_utf8 in Editline. This is
in preparation for #112276 which narrows the scope of
-Wno-deprecated-declarations for building LLDB.
2024-10-17 08:19:58 -07:00
Kazu Hirata
9173fd7739 [lldb] Avoid repeated map lookups (NFC) (#112655) 2024-10-17 07:45:50 -07:00
Benjamin Kramer
9c80eb7c83 Silence -Wswitch after cb43021e57
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4885:13: warning: enumeration value 'SveMFloat8' not handled in switch [-Wswitch]
 4885 |     switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind()) {
      |
2024-10-17 13:15:05 +02:00
Nikita Popov
255a99c29f [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)
This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in tests. That is,
cases where the value passed to the APInt constructor is not an N-bit
signed/unsigned integer, where N is the bit width and signedness is
determined by the isSigned flag.

The fixes either set the correct value for isSigned, set the
implicitTrunc flag, or perform more calculations inside APInt.

Note that the assertion is currently still disabled by default, so this
patch is mostly NFC.
2024-10-17 08:48:08 +02:00
Brooks Davis
ad5e2bf6e9 [llbd] Finish Turn lldb_private::Status into a value type. (#10616) (#112420)
Fix a few bare Status() invocations that were missed in the conversion.
This is sufficent to build lldb on FreeBSD/aaarch64.

Fixes: 0642cd768b
2024-10-16 20:41:38 +01:00
Adrian Prantl
8046f15dfa [lldb] Fix offset calculation when printing diagnostics in multiple ranges (#112466)
depends on https://github.com/llvm/llvm-project/pull/112451
2024-10-16 09:46:35 -07:00
Adrian Prantl
889e6ad24b [lldb] Fix a crash when two diagnostics are on the same column or in … (#112451)
…reverse order

The second inner loop (only) was missing the check for offset > column.
Also this patch sorts the diagnostics before printing them.
2024-10-16 09:45:39 -07:00
Kazu Hirata
282ab2f189 [lldb] Avoid repeated hash lookups (NFC) (#112471) 2024-10-15 23:11:30 -07:00
Jonas Devlieghere
cc13d4fb4a [lldb] Make the system log a NOOP on non-Darwin platforms
As discussed in #111911, we have consensus that as it stands, the system
log is only meaningful on Darwin and that by default it should be a NOOP
on other platforms.
2024-10-15 16:13:42 -07:00
Dmitrii Galimzianov
5f2cf99e14 DynamicLoaderDarwin load images in parallel with preload (#110646)
This change enables `DynamicLoaderDarwin` to load modules in parallel
using the thread pool. This new behavior is controlled by a new setting
`plugin.dynamic-loader.darwin.experimental.enable-parallel-image-load`,
which is enabled by default. When disabled, DynamicLoaderDarwin will
load modules sequentially as before.
2024-10-15 13:25:01 -07:00
Jonas Devlieghere
74eb079e06 [lldb] Use BasicBlock::iterator instead of InsertPosition (NFC) (#112307)
InsertPosition has been deprecated in favor of using
BasicBlock::iterator. (See #102608)
2024-10-15 08:25:28 -07:00
Kazu Hirata
a7b7af7ad5 [lldb] Avoid repeated map lookups (NFC) (#112315) 2024-10-15 07:37:00 -07:00
Vy Nguyen
4d78881406 [LLDB]Provide clearer error message for invalid commands. (#111891)
Sometimes users (esp. gdb-longtime users) accidentally use GDB syntax,
such as `breakpoint foo`, and they would get an error message from LLDB
saying simply `Invalid command "breakpoint foo"`, which is not very
helpful.

This change provides additional suggestions to help correcting the
mistake.
2024-10-15 10:14:48 -04:00
Adrian Prantl
9eddc8b9bf [lldb] Expose structured command diagnostics via the SBAPI. (#112109)
This allows IDEs to render LLDB expression diagnostics to their liking
without relying on characterprecise ASCII art from LLDB. It is exposed
as a versioned SBStructuredData object, since it is expected that this
may need to be tweaked based on actual usage.
2024-10-14 16:29:26 -07:00
Shubham Sandeep Rastogi
d8de2391eb Revert "[lldb] Improve unwinding for discontinuous functions (#111409)"
This reverts commit a89e01634f.

This is being reverted because it broke the test:

Unwind/trap_frame_sym_ctx.test

/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/test/Shell/Unwind/trap_frame_sym_ctx.test:21:10: error: CHECK: expected string not found in input
 CHECK: frame #2: {{.*}}`main
2024-10-14 15:27:05 -07:00
Pavel Labath
a89e01634f [lldb] Improve unwinding for discontinuous functions (#111409)
Currently, our unwinder assumes that the functions are continuous (or at
least, that there are no functions which are "in the middle" of other
functions). Neither of these assumptions is true for functions optimized
by tools like propeller and (probably) bolt.

While there are many things that go wrong for these functions, the
biggest damage is caused by the unwind plan caching code, which
currently takes the maximalist extent of the function and assumes that
the unwind plan we get for that is going to be valid for all code inside
that range. If a part of the function has been moved into a "cold"
section, then the range of the function can be many megabytes, meaning
that any function within that range will probably fail to unwind.

We end up with this maximalist range because the unwinder asks for the
Function object for its range. This is only one of the strategies for
determining the range, but it is the first one -- and also the most
incorrect one. The second choice would is asking the eh_frame section
for the range of the function, and this one returns something reasonable
here (the address range of the current function fragment) -- which it
does because each fragment gets its own eh_frame entry (it has to,
because they have to be continuous).

With this in mind, this patch moves the eh_frame (and debug_frame) to
the front of the queue. I think that preferring this range makes sense
because eh_frame is one of the unwind plans that we return, and some
others (augmented eh_frame) are based on it. In theory this could break
some functions, where the debug info and eh_frame disagree on the extent
of the function (and eh_frame is the one who's wrong), but I don't know
of any such scenarios.
2024-10-14 18:56:37 +02:00
Jonas Devlieghere
3dedcab6d9 [lldb] Make the system log a NOOP on Windows (#112052)
Windows doesn't have a built-in system log. Previously we got away with
writing to stdout and stderr because it was used only sporadically. As
we're trying to make the system log more useful on the other platforms,
the increased use become a concern. Make it a NOOP until someone figures
out a reasonable alternative.
2024-10-14 15:02:02 +01:00
Adrian Prantl
c2750807ba [lldb] Rename CommandReturnObject::Get.*Data -> Get.*String (#112062)
In a later commit, I want to add a method to access diagnostics as
actual structured data, which will make these function names rather
confusing.
2024-10-12 13:36:33 -07:00
Adrian Prantl
089227feaf Support inline diagnostics in CommandReturnObject (#110901)
and implement them for dwim-print (a.k.a. `p`) as an example.

The next step will be to expose them as structured data in
SBCommandReturnObject.
2024-10-11 09:08:52 -07:00
Jason Molenda
3bef742559 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 4f297566b3.
2024-10-10 16:24:38 -07:00
Jason Molenda
a28e7ce378 Revert "[lldb] SetErrorStringWithFormatv -> FromErrorStringWithFormatv (NFC)"
This reverts commit fae7d6848b.
2024-10-10 16:24:38 -07:00
Jonas Devlieghere
fae7d6848b [lldb] SetErrorStringWithFormatv -> FromErrorStringWithFormatv (NFC) 2024-10-10 16:08:19 -07:00
Robert O'Callahan
4f297566b3 [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).
2024-10-10 16:08:19 -07:00
Jacob Lalonde
e9c8f75d45 [LLDB][Minidump] Have Minidumps save off and properly read TLS data (#109477)
This patch adds the support to `Process.cpp` to automatically save off
TLS sections, either via loading the memory region for the module, or
via reading `fs_base` via generic register. Then when Minidumps are
loaded, we now specify we want the dynamic loader to be the `POSIXDYLD`
so we can leverage the same TLS accessor code as `ProcessELFCore`. Being
able to access TLS Data is an important step for LLDB generated
minidumps to have feature parity with ELF Core dumps.
2024-10-10 15:59:51 -07:00
Augusto Noronha
2ff4c25b7e Revert "[lldb] Implement basic support for reverse-continue (#99736)"
This reverts commit d5e1de6da9.
2024-10-10 15:05:58 -07:00
Augusto Noronha
f02252e1fd Revert "[lldb] SetErrorStringWithFormatv -> FromErrorStringWithFormatv (NFC)"
This reverts commit b77fdf5799.
2024-10-10 15:05:58 -07:00
Jonas Devlieghere
b77fdf5799 [lldb] SetErrorStringWithFormatv -> FromErrorStringWithFormatv (NFC) 2024-10-10 13:23:06 -07:00
Jonas Devlieghere
69b0b7e7ac [lldb] Return an llvm::Error from GetFrameBaseValue (#111882)
This fixes the following assertion: "Cannot create Expected<T> from
Error success value." The problem was that GetFrameBaseValue return
false without updating the Status argument. This patch eliminates the 
opportunity for mistakes by returning an llvm:Error.
2024-10-10 13:11:08 -07:00
Robert O'Callahan
d5e1de6da9 [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).
2024-10-10 13:01:47 -07:00
Adrian Vogelsgesang
7e16571eb0 [lldb][libc++] Hide all libc++ implementation details from stacktraces (#108870)
This commit changes the libc++ frame recognizer to hide implementation
details of libc++ more aggressively. The applied heuristic is rather
straightforward: We consider every function name starting with `__` as
an implementation detail.

This works pretty neatly for `std::invoke`, `std::function`,
`std::sort`, `std::map::emplace` and many others. Also, this should
align quite nicely with libc++'s general coding convention of using the
`__` for their implementation details, thereby keeping the future
maintenance effort low.

However, this heuristic by itself does not work in 100% of the cases:
E.g., `std::ranges::sort` is not a function, but an object with an
overloaded `operator()`, which means that there is no actual call
`std::ranges::sort` in the call stack. Instead, there is a
`std::ranges::__sort::operator()` call. To make sure that we don't hide
this stack frame, we never hide the frame which represents the entry
point from user code into libc++ code
2024-10-10 19:27:27 +02:00
Jonas Devlieghere
f2c5aa9200 [lldb] Fix a variety of LLDB_LOG format strings
LLVM now triggers an assertion when the format string and arguments
don't match. Fix a variety of incorrect format strings I discovered when
enabling logging with a debug build.
2024-10-10 09:56:31 -07:00
Jonas Devlieghere
c77b107461 [lldb] Introduce an always-on system log category/channel (#108495)
Add an "always on" log category and channel. Unlike other, existing log
channels, it is not exposed to users. The channel is meant to be used
sparsely and deliberately for logging high-value information to the
system log.

We have a similar concept in the downstream Swift fork and this has
proven to be extremely valuable. This is especially true on macOS where
system log messages are automatically captured as part of a sysdiagnose.
2024-10-10 08:47:30 -07:00
jeffreytan81
61a46780d1 Improve type lookup using .debug_names parent chain (#108907)
## Summary
This PR improves `SymbolFileDWARF::FindTypes()` by utilizing the newly
added parent chain `DW_IDX_parent` in `.debug_names`. The proposal was
originally discussed in [this
RFC](https://discourse.llvm.org/t/rfc-improve-dwarf-5-debug-names-type-lookup-parsing-speed/74151).

## Implementation
To leverage the parent chain for `SymbolFileDWARF::FindTypes()`, this PR
adds a new API: `GetTypesWithQuery` in `DWARFIndex` base class. The API
performs the same function as `GetTypes` with additional filtering using
`TypeQuery`. Since this only introduces filtering, the callback
mechanisms at all call sites remain unchanged. A default implementation
is given in `DWARFIndex` class which parses debug info and performs the
matching. In the `DebugNameDWARFIndex` override, the parent_contexts in
the `TypeQuery` is cross checked with parent chain in `.debug_names` for
for much faster filtering before fallback to base implementation for
final filtering.

Unlike the `GetFullyQualifiedType` API, which fully consumes the
`DW_IDX_parent` parent chain for exact matching, these new APIs perform
partial subset matching for type/namespace queries. This is necessary to
support queries involving anonymous or inline namespaces. For instance,
a user might request `NS1::NS2::NS3::Foo`, while the index table's
parent chain might contain `NS1::inline_NS2::NS3::Foo`, which would fail
exact matching.

## Performance Results
In one of our internal target using `.debug_names` + split dwarf.
Expanding a "this" pointer in locals view in VSCode:
94s => 48s. (Not sure why I got 94s this time instead of 70s last week).

---------

Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
2024-10-09 16:29:39 -07:00
AbdAlRahman Gad
6f2ebc435f [lldb] Change SymbolContext::GetAddressRangeFromHereToEndLine to return Expected (NFC) (#110718)
Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>
Co-authored-by: Adrian Prantl <adrian.prantl@gmail.com>
2024-10-08 10:04:52 -07:00
Dmitrii Galimzianov
d2457e6d8f Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (#102835)
When we search for a symbol, we first check if it is in the module_sp of
the current SymbolContext, and if not, we check in the target's modules.
However, the target's ModuleList also includes the already checked
module, which leads to a redundant search in it.
2024-10-07 13:45:27 -07:00
Jacob Lalonde
5d372ea6a1 [LLDB][DYLD] Remove logic around not rebasing when main executable has a load address (#110885)
This is a part of #109477 that I'm making into it's own patch. Here we
remove logic from the DYLD that prevents it's logic from running if the
main executable already has a load address. Instead we let the DYLD
fully determine what should be loaded and what shouldn't.
2024-10-07 09:45:56 -07:00
Tom Yang
835b5e278e Add warning message to session save when transcript isn't saved. (#109020)
Somewhat recently, we made the change to hide the behavior to save LLDB
session history to the transcript buffer behind the flag
`interpreter.save-transcript`. By default, `interpreter.save-transcript`
is false. See #90703 for context.

I'm making a small update here to our `session save` messaging and some
help docs to clarify for users that aren't aware of this change. Maybe
`interpreter.save-transcript` could be true by default as well. Any
feedback welcome.

# Tests
```
bin/lldb-dotest -p TestSessionSave
```

---------

Co-authored-by: Tom Yang <toyang@fb.com>
2024-10-05 00:29:44 -07:00
Felipe de Azevedo Piovezan
6294679faa [lldb] Add isConstant mode for FA locations (#110726)
This is similar to 9fe455fd0c, but for FA locations instead of
register locations.
This is useful for unwind plans that cannot create abstract unwind
rules, but instead must inspect the state of the program to determine
the current CFA.
2024-10-04 05:01:52 -07:00
Dmitry Vasilyev
2e89312419 [lldb] Removed gdbserver ports map from lldb-server (#104238)
Listen to gdbserver-port, accept the connection and run `lldb-server gdbserver --fd` on all platforms.
Parameters --min-gdbserver-port and --max-gdbserver-port are deprecated now.

This is the part 2 of #101283.

Fixes #97537.
2024-10-03 21:00:47 +04:00
Jason Molenda
00c1989a01 [lldb] Improve mid-function epilogue scanning for x86 (#110965)
The x86 assembly instruction scanner creates incorrect UnwindPlans when
a mid-function epilogue has a non-epilogue instruction in it.

The x86 instruction analysis which creates an UnwindPlan handles
mid-function epilogues by tracking "epilogue instructions" (register
loads from stack, stack pointer increasing, etc) and any UnwindPlan
updates which are NOT epilogue instructions update the "prologue
UnwindPlan" saved row. It detects a LEAVE/RET/unconditional JMP out of
the function and after that instruction, re-instates the "prologue Row".

There's a parallel piece of data tracked across the duration of the
function, current_sp_bytes_offset_from_fa, and we reflect the "value
after prologue instructions" in
prologue_completed_sp_bytes_offset_from_cfa. When the CFA is calculated
in terms of the frame pointer ($ebp/$rbp), we don't add changes to the
stack pointer to the UnwindPlan, so this separate mechanism is used for
the "current value" and the "last value at prologue setup".

(the x86 UnwindPlan generated writes "sp=CFA+0" as a register rule which
is formally correct, but it could also track the stack pointer value as
sp=$rsp+<x> and update this register rule every time $rsp is modified.)

This leads to a bug when there is an instruction in an epilogue which
isn't recognzied as an epilogue instruction.
prologue_completed_sp_bytes_offset_from_cfa is always set to the value
of current_sp_bytes_offset_from_fa unless the current instruction is an
epilogue instruction. With a non-epilogue instruction in the middle of
the epilogue, we suddenly copy a current_sp_bytes_offset_from_fa value
from the middle of the epilogue into this
prologue_completed_sp_bytes_offset_from_cfa. Once the epilogue is
finished, we restore the "prologue Row" and
prologue_completed_sp_bytes_offset_from_cfa. But now $rsp has a very
incorrect value in it.

This patch tracks when we've updated current_sp_bytes_offset_from_fa in
the current instruction analysis. If it was updated looking at an
epilogue instruction, `is_epilogue` will be set correctly. Otherwise
it's a "prologue" instruction and we should update
prologue_completed_sp_bytes_offset_from_cfa. Any instruction that is
unrecognized will leave prologue_completed_sp_bytes_offset_from_cfa
unmodified.

The actual instruction we hit this with was a BTRQ but I added a NOP to
the unit test which is only 1 byte and made the update to the unit test
a little simpler. This bug is hit with a NOP just as well.

UnwindAssemblyInstEmulation has a much better algorithm for handling
mid-function epilogues, which "forward" the current unwind state Row
when it sees branches within the function, to the target instruction
offset. This avoids detecting prologue/epilogue instructions altogether.

rdar://137153323
2024-10-03 09:59:37 -07:00
Adrian Prantl
8789c96698 [lldb] Unify implementation of CommandReturnObject::SetError(NFC) (#110707)
This is a cleanup that moves the API towards value semantics.
2024-10-02 09:11:47 -07:00
Pavel Labath
15f90203bc [lldb/DWARF] Respect member layout for types parsed through declarations (#110648)
LLDB code for using the type layout data from DWARF was not kicking in
for types which were initially parsed from a declaration. The problem
was in these lines of code:

```
  if (type)
    layout_info.bit_size = type->GetByteSize(nullptr).value_or(0) * 8;
```

which determine the types layout size by getting the size from the
lldb_private::Type object. The problem is that if the type object does
not have this information cached, this request can trigger another
(recursive) request to lay out/complete the type. This one, somewhat
surprisingly, succeeds, but does that without the type layout
information (because it hasn't been computed yet). The reasons why this
hasn't been noticed so far are:
- this is a relatively new bug. I haven't checked but I suspect it was
introduced in the "delay type definition search" patchset from this
summer -- if we search for the definition eagerly, we will always have a
cached size value.
- it requires the presence of another bug/issue, as otherwise the
automatically computed layout will match the real thing.
- it reproduces (much) more easily with -flimit-debug-info (though it is
possible to trigger it without that flag).

My fix consists of always fetching type size information from DWARF
(which so far existed as a fallback path). I'm not quite sure why this
code was there in the first place (the code goes back to before the
Great LLDB Reformat), but I don't believe it is necessary, as the type
size (for types parsed from definition DIEs) is set exactly from this
attribute (in ParseStructureLikeDIE).
2024-10-02 11:13:43 +02:00
dlav-sc
87121403e2 [lldb][RISCV] function calls support in lldb expressions (#99336)
[lldb][RISCV] add jitted function calls to ABI
Function calls support in LLDB expressions for RISCV: 1 of 4

Augments corresponding functionality to RISCV ABI, which allows to jit
lldb expressions and thus make function calls inside them. Only function
calls with integer and void function arguments and return value are
supported.

[lldb][RISCV] add JIT relocations resolver
Function calls support in LLDB expressions for RISCV: 2 of 4

Adds required RISCV relocations resolving functionality in lldb
ExecutionEngine.

[lldb][RISCV] RISC-V large code model in lldb expressions
Function calls support in LLDB expressions for RISCV: 3 of 4

This patch sets large code model in MCJIT settings for RISC-V 64-bit targets
that allows to make assembly jumps at any 64bit address. This is needed,
because resulted jitted code may contain more that +-2GB jumps, that are
not available in RISC-V with medium code model.

[lldb][RISCV] doubles support in lldb expressions
Function calls support in LLDB expressions for RISCV: 4 of 4

This patch adds desired feature flags in MCJIT compiler to enable
hard-float instructions if target supports them and allows to use floats
and doubles in lldb expressions.
2024-10-02 12:08:22 +03:00
Zequan Wu
4206c37bd1 [lldb][DWARF] Replace lldb's DWARFDebugArangeSet with llvm's (#110058)
They are close enough to swap lldb's `DWARFDebugArangeSet` with the llvm
one.

The difference is that llvm's `DWARFDebugArangeSet` add empty ranges
when extracting. To accommodate this, `DWARFDebugAranges` in lldb
filters out empty ranges when extracting.
2024-10-01 13:52:51 -04:00
Jay Foad
fe61dbf1d3 [AMDGPU] Specify width and align for all AMDGPU builtin types. NFC. (#109656)
This will be used in ASTContext::getTypeInfo which needs this
information for all builtin types, not just pointers.
2024-10-01 14:12:34 +01:00