Commit Graph

26073 Commits

Author SHA1 Message Date
Med Ismail Bennani
999e75476e
[lldb/Test] Fix test_launch_scripted_process_stack_frames failure
This should fix the test_launch_scripted_process_stack_frames GreenDragon
test failure : https://green.lab.llvm.org/green/job/lldb-cmake/41901

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 16:22:53 -08:00
Med Ismail Bennani
86e6030ee8 [lldb/Test] Disable test_scripted_process_and_scripted_thread on Windows
This disables TestScriptedProcess.test_scripted_process_and_scripted_thread
on Windows since the inferior binary a linked to a dylib that doesn't
build on Windows.

This should fix https://lab.llvm.org/buildbot/#/builders/83/builds/16100

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 14:56:20 -08:00
Saleem Abdulrasool
b5491dd307 ObjectFile: add a case for EM_RISCV
This adds the jump slot mapping for RISCV.  This enables lldb to attach to a
remote debug server.  Although this doesn't enable debugging RISCV targets, it
is sufficient to attach, which is a slight improvement.

Tested with DebugServer2:
~~~
(lldb) gdb-remote localhost:1234
(lldb) Process 71438 stopped
* thread #1, name = 'reduced', stop reason = signal SIGTRAP
    frame #0: 0x0000003ff7fe1b20

error: Process 71438 is currently being debugged, kill the process before connecting.
(lldb) register read
general:
        x0 = 0x0000003ff7fe1b20
        x1 = 0x0000002ae00d3a50
        x2 = 0x0000003ffffff3e0
        x3 = 0x0000002ae01566e0
        x4 = 0x0000003fe567c7b0
        x5 = 0x0000000000001000
        x6 = 0x0000002ae00604ec
        x7 = 0x00000000000003ff
        x8 = 0x0000003fffc22db0
        x9 = 0x0000000000000000
       x10 = 0x0000000000000000
       x11 = 0x0000002ae603b1c0
       x12 = 0x0000002ae6039350
       x13 = 0x0000000000000000
       x14 = 0x0000002ae6039350
       x15 = 0x0000002ae6039350
       x16 = 0x73642f74756f3d5f
       x17 = 0x00000000000000dd
       x18 = 0x0000002ae6038f08
       x19 = 0x0000002ae603b1c0
       x20 = 0x0000002b0f3d3f40
       x21 = 0x0000003ff0b212d0
       x22 = 0x0000002b0f3a2740
       x23 = 0x0000002b0f3de3a0
       x24 = 0x0000002b0f3d3f40
       x25 = 0x0000002ad6929850
       x26 = 0x0000000000000000
       x27 = 0x0000002ad69297c0
       x28 = 0x0000003fe578b364
       x29 = 0x000000000000002f
       x30 = 0x0000000000000000
       x31 = 0x0000002ae602401a
        pc = 0x0000003ff7fe1b20
       ft0 = 0
       ft1 = 0
       ft2 = 0
       ft3 = 0
       ft4 = 0
       ft5 = 0
       ft6 = 0
       ft7 = 0
       fs0 = 0
       fs1 = 0
       fa0 = 0
       fa1 = 0
       fa2 = 0
       fa3 = 0
       fa4 = 0
       fa5 = 0
       fa6 = 0
       fa7 = 9.10304232197721e-313
       fs2 = 0
       fs3 = 1.35805727667792e-312
       fs4 = 1.35589259164679e-312
       fs5 = 1.35805727659887e-312
       fs6 = 9.10304232355822e-313
       fs7 = 0
       fs8 = 9.10304233027751e-313
       fs9 = 0
      fs10 = 9.10304232948701e-313
      fs11 = 1.35588724164707e-312
       ft8 = 0
       ft9 = 9.1372158616833e-313
      ft10 = 9.13720376537528e-313
      ft11 = 1.356808717416e-312
3 registers were unavailable.

(lldb) disassemble
error: Failed to disassemble memory at 0x3ff7fe1b2
~~~
2022-03-04 21:54:20 +00:00
Stella Laurenzo
38151a08c2 Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"."
This reverts commit 7cdda6b8ce.

Differential Revision: https://reviews.llvm.org/D121020
2022-03-04 13:45:43 -08:00
Med Ismail Bennani
b934ed7dd6 revert "[lldb/Host] Fix crash in FileSystem::IsLocal"
This reverts commit 2dc6e906b0 following
changes introduced in 59eb705277.
2022-03-04 13:36:36 -08:00
Med Ismail Bennani
680ca7f21a [lldb/Plugins] Add ability to load modules to Scripted Processes
This patch introduces a new way to load modules programatically with
Scripted Processes. To do so, the scripted process blueprint holds a
list of dictionary describing the modules to load, which their path or
uuid, load address and eventually a slide offset.

LLDB will fetch that list after launching the ScriptedProcess, and
iterate over each entry to create the module that will be loaded in the
Scripted Process' target.

The patch also refactors the StackCoreScriptedProcess test to stop
inside the `libbaz` module and make sure it's loaded correctly and that
we can fetch some variables from it.

rdar://74520238

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 13:35:28 -08:00
Med Ismail Bennani
6eddd987c9 [lldb/Plugin] Use static ScriptedInterface::ErrorWithMessage function (NFC)
This patch replaces the calls to ErrorWithMessage using the GetInterface
message by a call to the static method directly.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 13:35:19 -08:00
Med Ismail Bennani
2a29c3f72e [lldb/test] Re-enable TestEvents.py on Darwin and fix crashes
This patch re-enables TestEvents.py on Darwin and fixes some crashes
that were happening due to an undefined method.

I ran it 100 times locally with the following command and it passed
every the time:

```
for i in {1..100}; do print $i/100; ./bin/lldb-dotest -p TestEvents.py 2>&1 | rg PASSED; if [ "$?" -eq "1" ]; then break; fi; done
```

Let's see if it still fails non-deterministically on the bots and
eventually also re-enable it on linux.

rdar://37037235

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-04 13:35:07 -08:00
Zequan Wu
b31a1b4746 [LLDB] Flush stream at the end of PrintCommandOutput
On Windows, lldb doesn't print any error message until exit. This fixes it.

Differential Revision: https://reviews.llvm.org/D120961
2022-03-04 13:06:15 -08:00
Shafik Yaghmour
9bd72b5c25 [LLDB] Remove cases of using namespace std
We had using namespace std; sprinkled around several source files and tests.

Differential Revision: https://reviews.llvm.org/D120966
2022-03-04 12:50:25 -08:00
Greg Clayton
63e512100a Fix race condition when launching and attaching.
This is a modified version of a previous patch that was reverted: https://reviews.llvm.org/D119797
This version only waits for the process to stop when using "launchCommands" or "attachCommands"...

...and doesn't play with the async mode when doing normal launch/attach.

We discovered that when using "launchCommands" or "attachCommands" that there was an issue where these commands were not being run synchronously. There were further problems in this case where we would get thread events for the process that was just launched or attached before the IDE was ready, which is after "configurationDone" was sent to lldb-vscode.

This fix introduces the ability to wait for the process to stop after "launchCommands" or "attachCommands" are run to ensure that we have a stopped process point that is ready for the debug session to proceed. We spin up the thread that listens for process events before we start the launch or attach, but we don't want stop events being delivered through the DAP protocol until the "configurationDone" packet is received. We now always ignore the stop event with a stop ID of 1, which is the first stop. All normal launch and attach scenarios use the synchronous mode, and "launchCommands and "attachCommands" run an array of LLDB commands in async mode.

This should make our launch with "launchCommands" and attach with "attachCommands" avoid a race condition when the process is being launched or attached.

Differential Revision: https://reviews.llvm.org/D120755
2022-03-03 16:20:27 -08:00
Jonas Devlieghere
bf414cfbf7
[lldb] Fix the build after 8b3b66ea63
Remove remaining calls to FileSystem::Collect.
2022-03-03 13:57:33 -08:00
Jonas Devlieghere
4212a57a54
[lldb] Remove reproducer_handler from the driver 2022-03-03 13:22:39 -08:00
Jonas Devlieghere
8b3b66ea63
[lldb] Remove FileSystem::Initialize from FileCollector
This patch removes the ability to instantiate the LLDB FileSystem class
with a FileCollector. It keeps the ability to collect files, but uses
the FileCollectorFileSystem to do that transparently.

Because the two are intertwined, this patch also removes the
finalization logic which copied the files over out of process.
2022-03-03 13:22:38 -08:00
Jim Ingham
c697a1f06b Fix the order of modules-loaded event and the resultant breakpoint-changed event.
The order used to be breakpoint-changed first, which didn't make much sense.

Differential Revision: https://reviews.llvm.org/D120919
2022-03-03 12:10:54 -08:00
Jim Ingham
3f438185a6 Fix up the "lldb log break" channel output.
1) Make the BreakpointEventData::Dump actually do something useful.
2) Make the Breakpoint events print when the break log channel is on
without having to turn on the events channel.

Differential Revision: https://reviews.llvm.org/D120917
2022-03-03 12:10:39 -08:00
Jonas Devlieghere
34eb15b5c3
[lldb] Remove reproducer verifier and corresponding command
This removes the reproducer verifier and the corresponding `reproducer
verify` subcommand.
2022-03-03 11:21:00 -08:00
Jonas Devlieghere
59eb705277
[lldb] Remove FileSystem::Initialize from VFS mapping
This patch removes the ability to instantiate the LLDB FileSystem class
based on a VFS overlay. This also removes the "hack" where we cast the
VFS to a RedirectingFileSystem to obtain the external path. You can
still instantiate a FileSystem with a VFS, but with the caveat that
operations that rely on the external path won't work.

Differential revision: https://reviews.llvm.org/D120923
2022-03-03 11:02:11 -08:00
Shafik Yaghmour
ae869d4484 [LLDB] Remove cases of using namespace llvm:: from header file
We have using namespace llvm::dwarf in dwarf.h header globally. Replacing that
with a using namespace within lldb_private::dwarf and moving to a
using namespace lldb_private::dwarf in .cpp files and fully qualified names
in the few header files.

Differential Revision: https://reviews.llvm.org/D120836
2022-03-03 10:39:06 -08:00
David Spickett
742fb13475 Revert "[lldb] Correct case in description of breakpoint --on-catch/throw"
This reverts commit 6b3b3ef344.

Jim Ingham informed me that the upper case is a hint to the option
name, like you might see in a menu to show you what the shortcut is.
2022-03-03 17:20:31 +00:00
Emre Kultursay
71e278805a
[lldb] Fix DataExtractor symbol conflict
There are two DataExtractors in scope: one from the llvm namespace and
one from the lldb_private namespace. Some Microsoft Visual C++ compilers
(I tested with MSVC 14.23 specifically) cannot handle this situation,
and generate ambiguous symbol errors. This change fixes this compile
error.

Differential revision: https://reviews.llvm.org/D120718
2022-03-03 08:48:16 -08:00
David Spickett
6b3b3ef344 [lldb] Correct case in description of breakpoint --on-catch/throw
Somehow we ended up with catcH/throW.
2022-03-03 10:06:11 +00:00
Jonas Devlieghere
ef0de5dce7
[lldb] Update the CI docs
Remove the reproducer bot and the fedora bot.
2022-03-02 22:40:05 -08:00
Jonas Devlieghere
03dae31aca
[lldb] Update TestBasicEntryValues.py for image lookup output
Update TestBasicEntryValues.py for 15983c28aa which changes the output
for `image lookup -v`. This should fix the debian and macos build bots.
2022-03-02 22:35:34 -08:00
Dominic Chen
cd89f94aa9 [lldb] Fix python errors in gdbremote.py
Fix exceptions encountered while debugging gdb protocol

Differential Revision: https://reviews.llvm.org/D120792
2022-03-02 19:47:51 -08:00
Jonas Devlieghere
42db8bfa20
[lldb] Skip check for the lldb prompt in TestIOHandlerProcessSTDIO
The check for the prompt isn't essential for this test. The check fail
on the lldb-arm-ubuntu because of what appears to be a missing space
after the prompt. Rather than disabling the test, let's see if we can
get it to pass without it.
2022-03-02 16:44:14 -08:00
Jonas Devlieghere
77bfdeb092
[lldb] Update error messages in TestMemoryHistory.py
Update TestMemoryHistory.py for daba823622
which changes the CommandObject & Disassemble error messages .
2022-03-02 15:56:45 -08:00
Jonas Devlieghere
37eb15ad7a
[lldb] Devirtualize IOHandler::{IsActive,SetIsDone,GetIsDone} (NFC)
There are no implementations overriding these methods.

Differential revision: https://reviews.llvm.org/D120766
2022-03-02 15:55:49 -08:00
Jonas Devlieghere
10222764a9
[lldb] Avoid data race in IOHandlerProcessSTDIO
This patch fixes a data race in IOHandlerProcessSTDIO. The race is
happens between the main thread and the event handling thread. The main
thread is running the IOHandler (IOHandlerProcessSTDIO::Run()) when an
event comes in that makes us pop the process IO handler which involves
cancelling the IOHandler (IOHandlerProcessSTDIO::Cancel). The latter
calls SetIsDone(true) which modifies m_is_done. At the same time, we
have the main thread reading the variable through GetIsDone().

This patch avoids the race by using a mutex to synchronize the two
threads. On the event thread, in IOHandlerProcessSTDIO ::Cancel method,
we obtain the lock before changing the value of m_is_done. On the main
thread, in IOHandlerProcessSTDIO::Run(), we obtain the lock before
reading the value of m_is_done. Additionally, we delay calling SetIsDone
until after the loop exists, to avoid a potential race between the two
writes.

  Write of size 1 at 0x00010b66bb68 by thread T7 (mutexes: write M2862, write M718324145051843688):
    #0 lldb_private::IOHandler::SetIsDone(bool) IOHandler.h:90 (liblldb.15.0.0git.dylib:arm64+0x971d84)
    #1 IOHandlerProcessSTDIO::Cancel() Process.cpp:4382 (liblldb.15.0.0git.dylib:arm64+0x5ddfec)
    #2 lldb_private::Debugger::PopIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1156 (liblldb.15.0.0git.dylib:arm64+0x3cb2a8)
    #3 lldb_private::Debugger::RemoveIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1063 (liblldb.15.0.0git.dylib:arm64+0x3cbd2c)
    #4 lldb_private::Process::PopProcessIOHandler() Process.cpp:4487 (liblldb.15.0.0git.dylib:arm64+0x5c583c)
    #5 lldb_private::Debugger::HandleProcessEvent(std::__1::shared_ptr<lldb_private::Event> const&) Debugger.cpp:1549 (liblldb.15.0.0git.dylib:arm64+0x3ceabc)
    #6 lldb_private::Debugger::DefaultEventHandler() Debugger.cpp:1622 (liblldb.15.0.0git.dylib:arm64+0x3cf2c0)
    #7 std::__1::__function::__func<lldb_private::Debugger::StartEventHandlerThread()::$_2, std::__1::allocator<lldb_private::Debugger::StartEventHandlerThread()::$_2>, void* ()>::operator()() function.h:352 (liblldb.15.0.0git.dylib:arm64+0x3d1bd8)
    #8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) HostNativeThreadBase.cpp:62 (liblldb.15.0.0git.dylib:arm64+0x4c71ac)
    #9 lldb_private::HostThreadMacOSX::ThreadCreateTrampoline(void*) HostThreadMacOSX.mm:18 (liblldb.15.0.0git.dylib:arm64+0x29ef544)

  Previous read of size 1 at 0x00010b66bb68 by main thread:
    #0 lldb_private::IOHandler::GetIsDone() IOHandler.h:92 (liblldb.15.0.0git.dylib:arm64+0x971db8)
    #1 IOHandlerProcessSTDIO::Run() Process.cpp:4339 (liblldb.15.0.0git.dylib:arm64+0x5ddc7c)
    #2 lldb_private::Debugger::RunIOHandlers() Debugger.cpp:982 (liblldb.15.0.0git.dylib:arm64+0x3cb48c)
    #3 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) CommandInterpreter.cpp:3298 (liblldb.15.0.0git.dylib:arm64+0x506478)
    #4 lldb::SBDebugger::RunCommandInterpreter(bool, bool) SBDebugger.cpp:1166 (liblldb.15.0.0git.dylib:arm64+0x53604)
    #5 Driver::MainLoop() Driver.cpp:634 (lldb:arm64+0x100006294)
    #6 main Driver.cpp:853 (lldb:arm64+0x100007344)

Differential revision: https://reviews.llvm.org/D120762
2022-03-02 15:55:49 -08:00
Zequan Wu
302d7179e1 [LLDB] Add error message when using --show-variable-ranges without -v 2022-03-02 14:20:14 -08:00
Zequan Wu
15983c28aa [LLDB] Dump valid ranges of variables
This allows `image lookup -a ... -v` to print variables only if the given
address is covered by the valid ranges of the variables. Since variables created
in dwarf plugin always has empty scope range, print the variable if it has
empty scope.

Differential Revision: https://reviews.llvm.org/D119963
2022-03-02 13:44:19 -08:00
Pavel Labath
4977da2c55 [lldb] Explicitly declare the default constructor in PlatformAndroidRemoteGDBServer
MSVC does not seem to like the inheriting constructor.
2022-03-02 22:35:54 +01:00
Jason Molenda
daba823622 Refine error msgs from CommandObject & Disassemble
Make it clearer for end users why a command cannot be used
when a process is not stopped, etc.

Differential Revision: https://reviews.llvm.org/D120594
2022-03-02 11:17:48 -08:00
Stella Laurenzo
7cdda6b8ce Revert "[cmake] Prefix gtest and gtest_main with "llvm_"."
lldb buildbot failure. will investigate and roll forward.

This reverts commit 9f37775472.
2022-03-02 11:13:46 -08:00
Stella Laurenzo
9f37775472 [cmake] Prefix gtest and gtest_main with "llvm_".
The upstream project ships CMake rules for building vanilla gtest/gmock which conflict with the names chosen by LLVM. Since LLVM's build rules here are quite specific to LLVM, prefixing them to avoid collision is the right thing (i.e. there does not appear to be a path to letting someone *replace* LLVM's googletest with one they bring, so co-existence should be the goal).

This allows LLVM to be included with testing enabled within projects that themselves have a dependency on an official gtest release.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D120789
2022-03-02 10:53:32 -08:00
Pavel Labath
d2edca6276 [lldb/Platform] Prepare decouple instance and plugin names
This patch changes the return value of Platform::GetName() to a
StringRef, and uses the opportunity (compile errors) to change some
callsites to use GetPluginName() instead. The two methods still remain
hardwired to return the same thing, but this will change once the ideas
in
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>
are implemented.

Differential Revision: https://reviews.llvm.org/D119146
2022-03-02 14:57:01 +01:00
Stephane Moore
0ff2905709 [lldb] Hyphenate Objective-C exception breakpoint labels ✍️
Objective-C is officially hyphenated:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html#//apple_ref/doc/uid/TP30001163

Reviewed By: mwyman, clayborg

Differential Revision: https://reviews.llvm.org/D113616
2022-03-01 15:02:44 -08:00
Zequan Wu
b901c404a8 [PDB] add missing char8_t for 5c9e20d 2022-03-01 14:24:21 -08:00
Zequan Wu
5c9e20d7d0 [PDB] Add char8_t type
Differential Revision: https://reviews.llvm.org/D120690
2022-03-01 13:39:51 -08:00
Jonas Devlieghere
4429cf146e
[Support] Allow the ability to change WithColor's auto detection function
WithColor has an "auto detection mode" which looks whether the
corresponding whether the corresponding cl::opt is enabled or not. While
this is great when opting into cl::opt, it's not so great for downstream
users of this utility, which might have their own competing options to
enable or disable colors. The WithColor constructor takes a color mode,
but the big benefit of the class are its static error and warning
helpers and default error handlers.

In order to allow users of this utility to enable or disable colors
globally, this patch adds the ability to specify a global auto detection
function. By default, the auto detection function behaves the way that
it does today. The benefit of this patch lies in that it can be
overwritten. In addition to a ability to change the auto detection
function, I've also made it possible to get your hands on the default
auto detection function, so you swap it back if if you so desire.

This patch allow downstream users (like LLDB) to globally disable colors
with its own command line flag.

Differential revision: https://reviews.llvm.org/D120593
2022-02-28 20:30:06 -08:00
Jonas Devlieghere
3a167c4a90
Revert "[Support] Allow the ability to change WithColor's auto detection function"
This reverts commit a83cf7a846 because it
breaks a bunch of build bots.
2022-02-28 15:32:15 -08:00
Jonas Devlieghere
a83cf7a846
[Support] Allow the ability to change WithColor's auto detection function
WithColor has an "auto detection mode" which looks whether the
corresponding whether the corresponding cl::opt is enabled or not. While
this is great when opting into cl::opt, it's not so great for downstream
users of this utility, which might have their own competing options to
enable or disable colors. The WithColor constructor takes a color mode,
but the big benefit of the class are its static error and warning
helpers and default error handlers.

In order to allow users of this utility to enable or disable colors
globally, this patch adds the ability to specify a global auto detection
function. By default, the auto detection function behaves the way that
it does today. The benefit of this patch lies in that it can be
overwritten. In addition to a ability to change the auto detection
function, I've also made it possible to get your hands on the default
auto detection function, so you swap it back if if you so desire.

This patch allow downstream users (like LLDB) to globally disable colors
with its own command line flag.

Differential revision: https://reviews.llvm.org/D120593
2022-02-28 15:03:04 -08:00
Ilya Nozhkin
fd37d489cf Set error message if ValueObjectRegister fails to write back to register
SetValueFromCString and SetData methods return false if register can't
be written but they don't set a error message. It sometimes confuses
callers of these methods because they try to get the error message in case of
failure but Status::AsCString returns nullptr.

For example, lldb-vscode crashes due to this bug if some register can't
be written. It invokes SBError::GetCString in case of error and doesn't
check whether the result is nullptr (see request_setVariable implementation in
lldb-vscode.cpp for more info).

Reviewed By: labath, clayborg

Differential Revision: https://reviews.llvm.org/D120319
2022-02-28 14:29:29 +08:00
Simon Pilgrim
850bc76a35 [lldb] BreakpointOptions::CommandData::CreateFromStructuredData - remove dead code + variable. NFCI.
The found_something bool is only ever read after it has always been set to true.

Looks to be a leftover debugging variable.

Fixes static analyzer warning: https://llvm.org/reports/scan-build/report-BreakpointOptions.cpp-CreateFromStructuredData-8-4055b9.html#EndPath
2022-02-27 11:33:14 +00:00
Nikita Popov
8dcb5e6bf5 Revert "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"
See post-commit discussion on https://reviews.llvm.org/D120305.
This change breaks the clang-ppc64le-rhel buildbot, though
there is suspicion that it's an issue with the bot. The change
also had a larger than expected impact on compile-time and
code-size.

This reverts commit 3c4ed02698
and some followup changes.
2022-02-26 15:32:49 +01:00
Med Ismail Bennani
2dc6e906b0
[lldb/Host] Fix crash in FileSystem::IsLocal
This checks `m_fs` before dereferencing it to access its`isLocal` method.

rdar://67410058

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-25 18:33:31 -08:00
Med Ismail Bennani
425880ed35
Reland "[lldb/test] Fix TestProgressReporting.py race issue with the event listener"
This patch relands commit 3e3e79a9e4, and
fixes the memory sanitizer issue described in D120284, by removing the
output arguments from the LLDB_INSTRUMENT_VA invocation.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-25 17:20:39 -08:00
Med Ismail Bennani
badb6e2730 [lldb/crashlog] Fix scripted_crashlog_json.test failure
This patch should fix the test failure on scripted_crashlog_json.test.

The failure is happening because crash reporter will obfuscate the
executable path in the crashlog, if it is located inside the user's
home directory and replace it with `/USER/*/` as a placeholder.

To fix that, we can patch the placeholder with the executable path
before loading the crashlog in lldb.

This also fixes a bug where we would create another target when loading
the crashlog in a scripted process, even if lldb already had a target
for it. Now, crashlog will only create a target if there is none in lldb.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-02-25 17:20:35 -08:00
Jonas Devlieghere
2ce6bc61e8
[lldb] Fix check for TARGET_OS_IPHONE
Instead of checking whether TARGET_OS_IPHONE is set to 1, the current
code just check the existence of TARGET_OS_IPHONE, which either always
succeeds or always fails, depending on whether you have
TargetConditionals.h included.
2022-02-25 13:24:39 -08:00
Michael Forster
4729a72ace Revert "[lldb/test] Fix TestProgressReporting.py race issue with the event listener"
This reverts commit 3e3e79a9e4.

MemorySanitizer: use-of-uninitialized-value
2022-02-25 13:07:49 +00:00