Commit Graph

28609 Commits

Author SHA1 Message Date
Alex Langford
5876eee1ff [lldb][NFCI] Add some missing SB class forward declarations
I noticed these were missing.

Differential Revision: https://reviews.llvm.org/D155653
2023-07-24 10:33:30 -07:00
David Spickett
cf2f433458 [lldb] Remove Windows XFAIL for TestDollarInVariable.py
Since 5d66f9fd8e this test has
been upassing on Linaro's Windows on Arm lldb bot:
https://lab.llvm.org/buildbot/#/builders/219/builds/4320

I can't explain exactly how that happened, but I do see a bunch
of QEnvironment packets going by in that test. It is very likely
that the order would have been different on Windows.

Indeed, when it was xfailed back in df9051e7cf
the reason was not known either.
2023-07-24 13:25:34 +00:00
Fangrui Song
e126fa27c0 [unittest] Fix HighlighterTest.cpp after D151683
:: is now parsed as tok::coloncolon even in C mode.
2023-07-22 18:30:02 -07:00
Fangrui Song
5d66f9fd8e [gdb-remote] Sort entries in QEnvironment*
Similar to ae316ac66f for
QEMU_(UN)SET_ENV.
The iteration order of StringMap is not guaranteed to be deterministic.
Sort the entries to give deterministic packets for the tests added by
D108018.
2023-07-22 16:45:32 -07:00
Nikolas Klauser
874217f99b [clang] Enable C++11-style attributes in all language modes
This also ignores and deprecates the `-fdouble-square-bracket-attributes` command line flag, which seems to not be used anywhere. At least a code search exclusively found mentions of it in documentation: https://sourcegraph.com/search?q=context:global+-fdouble-square-bracket-attributes+-file:clang/*+-file:test/Sema/*+-file:test/Parser/*+-file:test/AST/*+-file:test/Preprocessor/*+-file:test/Misc/*+archived:yes&patternType=standard&sm=0&groupBy=repo

RFC: https://discourse.llvm.org/t/rfc-enable-c-11-c2x-attributes-in-all-standard-modes-as-an-extension-and-remove-fdouble-square-bracket-attributes

This enables `[[]]` attributes in all C and C++ language modes without warning by default. `-Wc++-extensions` does warn. GCC has enabled this extension in all C modes since GCC 10.

Reviewed By: aaron.ballman, MaskRay

Spies: #clang-vendors, beanz, JDevlieghere, Michael137, MaskRay, sstefan1, jplehr, cfe-commits, lldb-commits, dmgreen, jdoerfert, wenlei, wlei

Differential Revision: https://reviews.llvm.org/D151683
2023-07-22 09:34:15 -07:00
Med Ismail Bennani
57bd882343 [lldb] Convert script native types to StructuredData counterpart
This patch adds the ability to pass native types from the script
interpreter to methods that use a {SB,}StructuredData argument.

To do so, this patch changes the `ScriptedObject` struture that holds
the pointer to the script object as well as the originating script
interpreter language. It also exposes that to the SB API via a new class
called `SBScriptObject`.

This structure allows the debugger to parse the script object and
convert it to a StructuredData object. If the type is not compatible
with the StructuredData types, we will store its pointer in a
`StructuredData::Generic` object.

This patch also adds some SWIG typemaps that checks the input argument to
ensure it's either an SBStructuredData object, in which case it just
passes it throught, or a python object that is NOT another SB type, to
provide some guardrails for the user.

rdar://111467140

Differential Revision: https://reviews.llvm.org/D155161

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-07-21 18:47:46 -07:00
Felipe de Azevedo Piovezan
f09f0a6b10 [lldb] Consider OP_addrx in DWARFExpression::Update_DW_OP_addr
This rewrites DW_OP_addrx inside DWARFExpression as an DW_OP_addr so
that we can update addresses that are originally located in the
debug_addr section.

The full discussion behind this can be found in
https://discourse.llvm.org/t/dwarfexpression-and-dw-op-addrx/71627/12, but a
summary follows.

When SymbolFileDWARF::ParseVariableDIE creates DWARFExpressions for
variables whose location is an OP_addr, it knows how to remap
addresses appropriately in the DebugMap case. It then calls
DWARFExpression::Update_DW_OP_addr, which updates the value associated
with OP_addr.

However, when we have an OP_addrx, the update function does
nothing. This makes sense, as the DWARFExpression does not have a
mutable view of the debug_addr section. In non-DebugMap flows this is
not an issue, as the debug_addr contains the correct addresses of
variables. In DebugMap flows, this is problematic because the work
done by RelinkOSOAddress is lost. By updating the OP to OP_addr, we
can also update the address as required,

We also explored the alternative of relinking the debug_addr section
when we are initializing OSOs (InitOSO). However, this creates an
inconsistent story for users of
DWARFExpression::GetLocation_DW_OP_addr. This function returns an
address without telling callers whether that address came from an
OP_addr or an OP_addrx. If we preemptively relink OP_addrx results
without doing the same for OP_addr results, then callers can’t know
whether the address they got was an executable address or an object
file address. In other words, they can’t know whether they need to
call LinkOSOFileAddress on those results or not.

This patch addresses the majority of test failures when enabling DWARF
5 for MachO (over 200 test failures).

Differential Revision: https://reviews.llvm.org/D155198
2023-07-21 16:42:16 -07:00
Jie Fu
8a45a54d59 [lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)
/data/llvm-project/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp:319:1: error: non-void function does
not return a value in all control paths [-Werror,-Wreturn-type]
}
^
1 error generated.
2023-07-21 11:42:42 +08:00
Dave Lee
a6ff60ecdd [lldb] Delete unused LibcxxOptionalSummaryProvider (NFC)
No longer needed following refactoring in D115178.
2023-07-20 19:32:58 -07:00
Dave Lee
e19339f5f8 [lldb] Identify Swift-implemented ObjC classes
Classes implemented in Swift can be exposed to ObjC. For those classes, the ObjC
metadata is incomplete. Specifically, the encoded types of the ivars are incomplete. As
one might expect, the Swift metadata _is_ complete. In such cases, the Swift runtime
should be consulted when determining the dynamic type of a value.

Differential Revision: https://reviews.llvm.org/D152837
2023-07-20 19:32:12 -07:00
Jeffrey Tan
49b3c3355f [lldb][x86_64] Support fs_base/gs_base register in Linux
Summary:
[lldb][x86_64] This patch adds fs_base/gs_base support for Linux x86_64.

Originally, I plan to split the diff into two parts, one to refactoring lldb_xxx_x86_64 => x86_64::lldb_xxx across code base and the other one for adding fs_base/gs_base, but it turns out to be a non-trivial effort to split and very error prone so I decided to keep a single diff to get feedback.

GDB supports fs_base/gs_base registers while LLDB does not. Since both linux coredump note section and ptrace
supports them it is a missing feature.

For context, this is a required feature to support getting pthread pointer on linux from both live and dump debugging.
See thread below for details:
https://discourse.llvm.org/t/how-to-get-pthread-pointer-from-lldb/70542/2?u=jeffreytan81

Implementation wise, we have initially tried `#ifdef` approach to reuse the code but it is introducing very tricky bugs and proves
hard to maintain. Instead the diff completely separates the registers between x86_64 and x86_64_with_base so that non-linux related
implementations can use x86_64 registers while linux uses x86_64_with_base.
Here are the list of changes done in the patch:
* Registers in lldb-x86-register-enums.h are separated into two: x86_64 and x86_64_with_base
* fs_base/gs_base are added into x86_64_with_base
* All linux files are change to use x86_64::lldb_xxx => x86_64_with_base::lldb_xxx
* Support linux elf-core:
	* A new RegisterContextLinuxCore_x86_64 class is added for ThreadElfCore
	* RegisterContextLinuxCore_x86_64 overrides and uses its own register set supports fs_base/gs_base
	* RegisterInfos_x86_64_with_base/RegisterInfos_x86_64_with_base_shared ared added to provide g_contained_XXX/g_invalidate_XXX and RegInfo related code sharing.
* `RegisterContextPOSIX_x86 ::m_gpr_x86_64` seems to be unused so I removed it.
* `NativeRegisterContextDBReg_x86::GetDR()` is overridden in `NativeRegisterContextLinux_x86_64` to make watchpoint work.

Reviewers:clayborg,labath,jingham,jdoerfert,JDevlieghere,kusmour,GeorgeHuyubo

Subscribers:

Tasks:

Tags:

Differential Revision: https://reviews.llvm.org/D155256
2023-07-20 16:32:47 -07:00
Jason Molenda
259e3f2a4f Remove IncrementFalseAlarmsAndReviseHitCount, unused ivars
Reading through the Watchpoint class, I found this method
that wasn't being used properly, and a couple of ivars that
weren't used at all.  Cleanup.

Differential Revision: https://reviews.llvm.org/D155768
2023-07-20 15:16:02 -07:00
Jonas Devlieghere
bbffda645a
[lldb] Skip unsupported CTF types
This ensures we we don't crash when parsing a type that references an
unsupported type.
2023-07-20 10:21:33 -07:00
Yaxun (Sam) Liu
8ef04488d1 Reland "[CUDA][HIP] Use the same default language std as C++""
Reland after fixing regression in lldb.

Differential Revision: https://reviews.llvm.org/D155539
2023-07-20 12:02:33 -04:00
Felipe de Azevedo Piovezan
8b19d13fde [lldb] Make frame var --regex always search globals
Currently frame var --regex sometimes searches globals, sometimes it doesn't.
This happens because `StackFrame::GetVariableList` always returns the biggest
list it has, regardless of whether only globals were requested or not. In other
words, if a previous call to `GetVariableList` requested globals, all subsequent
calls will see them.

The implication here is that users of `StackFrame::GetVariableList` are expected
to filter the results of this function. This is what we do for a vanilla
`frame var` command. But it is not what we do when `--regex` is used. This
commit solves the issue by:

1. Making `--regex` imply `--globals`. This matches the behavior of `frame var
<some_name>`, which will also search the global scope.
2. Making the `--regex` search respect the command object options.

See the added test for an example of the oddities this patch addresses. Without
the patch, the test fails. However it could be made to pass by calling a plain
`frame var` before calling `frame var --regex A::`.

Differential Revision: https://reviews.llvm.org/D155334
2023-07-19 17:11:21 -04:00
John Harrison
3d1f89c2e3 [lldb-vscode] Creating a new flag for adjusting the behavior of evaluation repl expressions to allow users to more easily invoke lldb commands.
This adds a new flag and lldb runtime command to allow users to manage the behavior of the lldb-vscode evaluate repl request.

When evaluating a repl context this now has runtime managed flag for control how the repl behaviors with the follow values:

* `variable` - the existing behavior, with this mode requests are evaluted in the current frame context as variable expressions. To trigger a lldb command prefix an expression with ` and it will be evaluted as an lldb command.
* `command` - all expressions are evaluated as lldb commands.
* `auto` - An alternative mode that will attempt to determine if the expression is an lldb command or a variable expression. Based off the intepreted results the expression will be evaluted either as a command or an expression.

Additionally, I enabled completions and ensured they work with the new repl expression behavior to provide auto-completes.

This commit includes updates to the tests to verify the new behavior after the previous failures from submitting https://reviews.llvm.org/D154030.

Differential Revision: https://reviews.llvm.org/D155248
2023-07-19 21:04:12 +00:00
Felipe de Azevedo Piovezan
00c6049677 [lldb][NFC] Refactor test to enable subsequent reuse
On a subsequent commit, I intend to update the expression and call the evaluate
function more times. This refactors enables reusing some of the existing code
for that.

Differential Revision: https://reviews.llvm.org/D155197
2023-07-19 09:15:48 -04:00
Felipe de Azevedo Piovezan
8bc97a3ee4 [lldb][NFC] Factor out CommandObject code filtering results based on scope
We will need this code in a subsequent commit.

Differential Revision: https://reviews.llvm.org/D155332
2023-07-19 09:14:02 -04:00
David Spickett
865b1190e6 [lldb] XFAIL command-disassemble-mixed.c on Windows
Either clang-cl has different assembly output or we're not mapping
source to assembly properly on Windows. We (Linaro) will find out which.

https://lab.llvm.org/buildbot/#/builders/219/builds/4195
2023-07-19 09:04:56 +00:00
Pavel Labath
b71ac7eea4 [lldb/test] Fix command-disassemble-mixed.c
Add it to lit.local.cfg so that it's actually run, and change it to
(properly) use the %clang_host substitution.
2023-07-18 10:17:09 +02:00
Alex Langford
1b29a848ff [lldb][NFCI] Avoid construction of temporary std::strings in RegisterValue
Differential Revision: https://reviews.llvm.org/D155030
2023-07-17 12:53:34 -07:00
Jim Ingham
b9541b6707 Fix the root directory completion test.
It was implicitly assumning that "/" would have no files in it, only
directories.  That's not true, for instance on macOS if you've navigated
to the root directory in the Finder...

Since we're assuming everything we check against is a directory, then we
need to filter the completion for that coming in.
2023-07-17 10:52:29 -07:00
David Spickett
3ebd6f65cb [lldb][AArch64] Add test predicate for systems with SME enabled
"sme" is just one of many cpuinfo features for SME but it's the
only one we need for testing.

The rest are related to the use of certain instructions and
don't change the register state available.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D154823
2023-07-17 09:27:12 +01:00
David Spickett
fdf36c3d4b [lldb][AArch64] Fix flakiness in TestSVEThreadedDynamic
This test runs to a breakpoint on thread 0. Thread 0 then starts
thread 2 and 3, which both have breakpoints in them.

In https://lab.llvm.org/buildbot/#/builders/96/builds/41674
I think that we managed to do the first check on thread 2 before
thread 3 had started. Therefore "thread continue 3" failed.

So wait for all three to startup before we check their status.

I considered putting a timeout on the while like the wait_for... methods,
but the test itself already has a global timeout. Plus, I'd rather
not be tuning a timeout per piece of hardware this runs on.

99% of the time we will already have 3 threads when the check is done.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D154705
2023-07-17 08:11:15 +00:00
Kazuki Sakamoto
39299f0d36 [lldb][LocateModuleCallback] Fix LocateModuleCallbackTest
ModuleList unexpectedly caches module beyond test.
Tear it down.

- https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/2260/testReport/junit/lldb-unit/Target___TargetTests_LocateModuleCallbackTest/GetOrCreateModuleWithCachedModule/
- https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/2260/testReport/junit/lldb-unit/Target___TargetTests_LocateModuleCallbackTest/GetOrCreateModuleWithCachedModuleAndSymbol/

Differential Revision: https://reviews.llvm.org/D155333
2023-07-15 11:53:06 -07:00
Alex Langford
7ee633a24b [lldb][NFCI] Remove unneeded temporary std::string allocations in SBAPI
This uses some friend class trickery to avoid some unneeded temporary
std::string allocations.

Differential Revision: https://reviews.llvm.org/D155035
2023-07-14 10:46:42 -07:00
Shubham Sandeep Rastogi
ce225982af Disable GetOrCreateModuleWithCachedModule and GetOrCreateModuleWithCachedModuleAndSymbol tests on arm64, because of test failures 2023-07-14 13:41:27 -04:00
Kazuki Sakamoto
43b9d62018 [lldb][Windows] Fix TestLocateModuleCallback
D153735 added the tests but it is failing due to POSIX path vs Windows path.
https://lab.llvm.org/buildbot/#/builders/219/builds/4084

Fix it.
- MODULE_PLATFORM_PATH is POSIX path.
- Normalize self.input_dir, FileSpec and SymbolFileSpec fullpath.

Differential Revision: https://reviews.llvm.org/D155124
2023-07-14 10:36:57 -07:00
Shubham Sandeep Rastogi
a76b3bec6c Revert "Revert "[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest""
This reverts commit 668a3efd42.

Reverting because of build errors:

In file included from /Users/buildslave/jenkins/workspace/as-lldb-cmake/llvm-project/lldb/source/API/SBPlatform.cpp:19:
/Users/buildslave/jenkins/workspace/as-lldb-cmake/llvm-project/lldb/include/lldb/Target/Target.h:1035:18: warning: parameter 'merged' not found in the function declaration [-Wdocumentation]
2023-07-14 11:19:16 -04:00
Shubham Sandeep Rastogi
55147ceb62 Revert "Revert "[lldb][LocateModuleCallback] Call locate module callback""
This reverts commit df054499c3.

Reverting because of build errors

In file included from /Users/buildslave/jenkins/workspace/as-lldb-cmake/llvm-project/lldb/source/API/SBPlatform.cpp:19:
/Users/buildslave/jenkins/workspace/as-lldb-cmake/llvm-project/lldb/include/lldb/Target/Target.h:1035:18: warning: parameter 'merged' not found in the function declaration [-Wdocumentation]
2023-07-14 11:19:16 -04:00
Shubham Sandeep Rastogi
df054499c3 Revert "[lldb][LocateModuleCallback] Call locate module callback"
This reverts commit 7f1028e9df.

This is because test failures

lldb-unit.Target/_/TargetTests/LocateModuleCallbackTest.GetOrCreateModuleWithCachedModule
lldb-unit.Target/_/TargetTests/LocateModuleCallbackTest.GetOrCreateModuleWithCachedModuleAndBreakpadSymbol
2023-07-14 11:05:01 -04:00
Shubham Sandeep Rastogi
668a3efd42 Revert "[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest"
This reverts commit fb087c17c8.

This is because of test failures:

lldb-unit.Target/_/TargetTests/LocateModuleCallbackTest.GetOrCreateModuleWithCachedModule
lldb-unit.Target/_/TargetTests/LocateModuleCallbackTest.GetOrCreateModuleWithCachedModuleAndBreakpadSymbol
2023-07-14 11:05:01 -04:00
Sterling Augustine
28c33805d4 Remove unnecessary std::moves [NFC]
These trigger the following error:

error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
2023-07-13 19:24:01 -07:00
Jonas Devlieghere
b716d4e585
[lldb] Move decorators to test method
Make sure TestCTF only run on Darwin when ctfconvert and llvm-objdump
are available.
2023-07-13 15:43:59 -07:00
Jonas Devlieghere
0e285a13eb
[lldb] Support compressed CTF
Add support for compressed CTF data. The flags in the header can
indicate whether the CTF body is compressed with zlib deflate. This
patch supports inflating the data before parsing.

Differential revision: https://reviews.llvm.org/D155221
2023-07-13 15:10:25 -07:00
Elliot Goodrich
3ff3af3086 [lldb] Add missing StringExtras.h includes
In preparation for removing the #include "llvm/ADT/StringExtras.h"
from the header to source file of llvm/Support/Error.h, first add in
all the missing includes that were previously included transitively
through this header.

This is fixing all files missed in b0abd4893f, 39d8e6e22c,
a11efd4926, 5551657b31, and 90bfe2df25.

Differential Revision: https://reviews.llvm.org/D155178
2023-07-13 21:06:25 +01:00
Jonas Devlieghere
ee44310a48
[lldb] Support Compact C Type Format (CTF)
Add support for the Compact C Type Format (CTF) in LLDB. The format
describes the layout and sizes of C types. It is most commonly consumed
by dtrace.

We generate CTF for the XNU kernel and want to be able to use this in
LLDB to debug kernels for which we don't have dSYMs (anymore). CTF is a
much more limited debug format than DWARF which allows is to be an order
of magnitude smaller: a 1GB dSYM can be converted to a handful of
megabytes of CTF. For XNU, the goal is not to replace DWARF, but rather
to have CTF serve as a "better than nothing" debug info format when
DWARF is not available.

It's worth noting that the LLVM toolchain does not support emitting CTF.
XNU uses ctfconvert to generate CTF from DWARF which is used for
testing.

Differential revision: https://reviews.llvm.org/D154862
2023-07-13 11:30:52 -07:00
Jonas Devlieghere
e5aa4cff43
[lldb] Support Compact C Type Format (CTF) section
Teach LLDB about the ctf (Compact C Type Format) section.

Differential revision: https://reviews.llvm.org/D154668
2023-07-13 11:30:35 -07:00
Alex Langford
c25e48c5d7 [lldb] Move CommandOverrideCallbackWithResult to lldb_private namespace
This has an `lldb_private` type in its parameter, it should be in
`lldb-private-types.h`

Differential Revision: https://reviews.llvm.org/D155129
2023-07-13 11:21:35 -07:00
Alex Langford
1d7a3dcff7 [lldb] Forward declare SBPlatform and SBTypeMember in SBDefines
Differential Revision: https://reviews.llvm.org/D155137
2023-07-13 10:51:48 -07:00
Felipe de Azevedo Piovezan
85c2e420c8 [lldb][NFC] Factor out code linking OSO addr of uninitialized GVs
This code was introduced in 2fc93eabf7.
In order to improve readability of ParseVariableDIE, we move this code into a
helper function. The issue this code attempted to address was fixed between
Clangs 9 and 11; as such, if we ever want to delete this code, it is a lot
easier to do so after the refactor.

Differential Revision: https://reviews.llvm.org/D155100
2023-07-13 08:27:29 -04:00
Elliot Goodrich
90bfe2df25 [lldb] Add missing StringExtras.h includes
In preparation for removing the #include "llvm/ADT/StringExtras.h"
from the header to source file of llvm/Support/Error.h, first add in
all the missing includes that were previously included transitively
through this header.

This is fixing all files missed in b0abd4893f, 39d8e6e22c,
a11efd4926, and 5551657b31.

Differential Revision: https://reviews.llvm.org/D155018
2023-07-13 08:39:59 +01:00
Kazuki Sakamoto
fb087c17c8 [lldb][LocateModuleCallback] Fix LocateModuleCallbackTest
D153734 forgot to call `Platform::SetHostPlatform` before
`Debugger::CreateInstance`. Copy similar code.
5007c78ce0/lldb/unittests/Expression/DWARFExpressionTest.cpp (L371-L374)

Differential Revision: https://reviews.llvm.org/D155135
2023-07-12 16:49:45 -07:00
Jason Molenda
71548de4d8 Improve error msg in DNBProcessAttach if we can't stop inferior
When we attach to a process, we task_for_pid(), ptrace(), and then
we try to halt execution of the process and time out after thirty
seconds if we cannot interrupt it.  At this point, we must assume
we have no control of the inferior process and the attach has failed.
The error message we return currently is "operation timed out"; this
change improves on that error message to make it more clear what is
going on.  Thanks to Jim for pointing this out.

rdar://101152233
2023-07-12 16:03:57 -07:00
Jason Molenda
bb136f5b39 Improve error messaging when debugserver fails to complete attaching
When debugserver is attaching to a process, it first task_for_pid()'s
and then ptrace(PT_ATTACHEXC)'s.  When that ptrace() fails to complete,
we are in a semi-attached state that we need to give up from, and
our error reporting isn't ideal -- we can even claim that the process
is already being debugged (by ourselves).

Differential Revision: https://reviews.llvm.org/D155037
rdar://101152233
2023-07-12 15:01:39 -07:00
Kazuki Sakamoto
f03dbdb70a [lldb][LocateModuleCallback] Implement API, Python interface
RFC https://discourse.llvm.org/t/rfc-python-callback-for-target-get-module/71580

Use SWIG for the locate module callback the same as other Python callbacks.
TestLocateModuleCallback.py verifies the functionalities.

Differential Revision: https://reviews.llvm.org/D153735
2023-07-12 11:33:51 -07:00
Kazuki Sakamoto
7f1028e9df [lldb][LocateModuleCallback] Call locate module callback
RFC https://discourse.llvm.org/t/rfc-python-callback-for-target-get-module/71580

Updated Target::GetOrCreateModule to call locate module callback if set.

- include/lldb/Target/Platform.h, source/Target/Platform.cpp
  - Implemented SetLocateModuleCallback and GetLocateModuleCallback*

- include/lldb/Target/Target.h, source/Target/Target.cpp
  - Implemented CallLocateModuleCallbackIfSet.

- unittests/Target/LocateModuleCallbackTest.cpp
  - Added comprehensive GetOrCreateModule tests.

Differential Revision: https://reviews.llvm.org/D153734
2023-07-12 11:19:51 -07:00
Kazuki Sakamoto
c4fa6fafc4 [lldb][LocateModuleCallback] Update SBFileSpec/SBModuleSpec
RFC https://discourse.llvm.org/t/rfc-python-callback-for-target-get-module/71580

SBFileSpec and SBModuleSpec will be used for locate module callback as Python
function arguments. This diff allows these things.
- Can be instantiated from SBPlatform.
- Can be passed to/from Python.
- Can be accessed for object offset and size.

Differential Revision: https://reviews.llvm.org/D153733
2023-07-12 11:11:18 -07:00
Ted Woodward
ded1bad64a Fix mixed disassembly showing source lines for "line 0"
"line 0" in a DWARF linetable means something that doesn't have associated
source. The code for mixed disassembly has a comment indicating that
"line 0" should be skipped, but the wrong value was returned. Fix the return
value and add a test to check that we don't incorrectly show source lines
from the beginning of the file.

Reviewed By: jasonmolenda

Differential Revision: https://reviews.llvm.org/D112931
2023-07-12 11:39:11 -05:00
Shubham Sandeep Rastogi
78af051ff0 Revert "[lldb-vscode] Creating a new flag for adjusting the behavior of evaluation repl expressions to allow users to more easily invoke lldb commands."
This reverts commit 16317f1ced.

Reverting because of test failures:

******************** TEST 'lldb-api :: tools/lldb-vscode/console/TestVSCode_console.py' FAILED ********************
Script:
--
/usr/local/Frameworks/Python.framework/Versions/3.10/bin/python3.10 /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --codesign-identity lldb_codesign --env LLVM_LIBS_DIR=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./lib --env LLVM_INCLUDE_DIR=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/include --env LLVM_TOOLS_DIR=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin --libcxx-include-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/include/c++/v1 --libcxx-library-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lib --arch x86_64 --build-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex --lldb-module-cache-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/lldb --compiler /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/clang --dsymutil /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin/dsymutil --llvm-tools-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./bin --lldb-libs-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/./lib --build-dir /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/lldb-test-build.noindex -t --env TERM=vt100 /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/API/tools/lldb-vscode/console -p TestVSCode_console.py

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/57586/
2023-07-11 15:16:03 -07:00