aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-08-05New ThreadPlanSingleThreadTimeout to resolve potential deadlock in single ↵jeffreytan811-1/+1
thread stepping (#90930) This PR introduces a new `ThreadPlanSingleThreadTimeout` that will be used to address potential deadlock during single-thread stepping. While debugging a target with a non-trivial number of threads (around 5000 threads in one example target), we noticed that a simple step over can take as long as 10 seconds. Enabling single-thread stepping mode significantly reduces the stepping time to around 3 seconds. However, this can introduce deadlock if we try to step over a method that depends on other threads to release a lock. To address this issue, we introduce a new `ThreadPlanSingleThreadTimeout` that can be controlled by the `target.process.thread.single-thread-plan-timeout` setting during single-thread stepping mode. The concept involves counting the elapsed time since the last internal stop to detect overall stepping progress. Once a timeout occurs, we assume the target is not making progress due to a potential deadlock, as mentioned above. We then send a new async interrupt, resume all threads, and `ThreadPlanSingleThreadTimeout` completes its task. To support this design, the major changes made in this PR are: 1. `ThreadPlanSingleThreadTimeout` is popped during every internal stop and reset (re-pushed) to the top of the stack (as a leaf node) during resume. This is achieved by always returning `true` from `ThreadPlanSingleThreadTimeout::DoPlanExplainsStop()` and `ThreadPlanSingleThreadTimeout::MischiefManaged()`. 2. A new thread-specific async interrupt stop is introduced, which can be detected/consumed by `ThreadPlanSingleThreadTimeout`. 3. The clearing of branch breakpoints in the range thread plan has been moved from `DoPlanExplainsStop()` to `ShouldStop()`, as it is not guaranteed that it will be called. The detailed design is discussed in the RFC below: [https://discourse.llvm.org/t/improve-single-thread-stepping/74599](https://discourse.llvm.org/t/improve-single-thread-stepping/74599) --------- Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
2024-07-01[lldb/Commands] Alias `script` command to `scripting run` (#97263)Med Ismail Bennani1-2/+11
This patch introduces a new top-level `scripting` command with an `run` sub-command, that basically replaces the `script` raw command. To avoid breaking the `script` command usages, this patch also adds an `script` alias to the `scripting run` sub-command. The reason behind this change is to have a top-level command that will cover scripting related subcommands. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-20Factor out expression result error strings.Adrian Prantl1-45/+3
2024-06-07Add AllowRepeats to SBCommandInterpreterRunOptions. (#94786)jimingham1-3/+11
This is useful if you have a transcript of a user session and want to rerun those commands with RunCommandInterpreter. The same functionality is also useful in testing. I'm adding it primarily for the second reason. In a subsequent patch, I'm adding the ability to Python based commands to provide their "auto-repeat" command. Among other things, that will allow potentially state destroying user commands to prevent auto-repeat. Testing this with Shell or pexpect tests is not nearly as accurate or convenient as using RunCommandInterpreter, but to use that I need to allow auto-repeat. I think for consistency's sake, having interactive sessions always do auto-repeats is the right choice, though that's a lightly held opinion...
2024-06-03Re-merge `A few updates around "transcript"` (#92843) (#94067)royitaqi1-1/+16
Problematic PR: https://github.com/llvm/llvm-project/pull/92843 Reverted by: https://github.com/llvm/llvm-project/pull/94088 The first PR added a test which fails in Linux builds (see the last few comments there). This PR contains all the changes in the first PR, plus the fix to the said test. --------- Co-authored-by: Roy Shi <royshi@meta.com>
2024-05-31Revert "A few updates around "transcript"" (#94088)gulfemsavrun1-16/+1
Reverts llvm/llvm-project#92843 because it broke some lldb tests: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8746385730949743489/overview
2024-05-31A few updates around "transcript" (#92843)royitaqi1-1/+16
# Changes 1. Changes to the structured transcript. 1. Add fields `commandName` and `commandArguments`. They will hold the name and the arguments string of the expanded/executed command (e.g. `breakpoint set` and `-f main.cpp -l 4`). This is not to be confused with the `command` field, which holds the user input (e.g. `br s -f main.cpp -l 4`). 2. Add field `timestampInEpochSeconds`. It will hold the timestamp when the command is executed. 3. Rename field `seconds` to `durationInSeconds`, to improve readability, especially since `timestampInEpochSeconds` is added. 2. When transcript is available and the newly added option `--transcript` is present, add the transcript to the output of `statistics dump`, as a JSON array under a new field `transcript`. 3. A few test name and comment changes.
2024-05-31[lldb] Fix 'session save' command on WindowsVladislav Dzhidzhoev1-0/+2
1. Use dashes (-) instead of colons (:) as time separator in a session log file name since Windows doesn't support saving files with names containing colons. 2. Temporary file creation code is changed in the test: On Windows, the temporary file should be closed before 'session save' writes session log to it. NamedTemporaryFile() can preserve the file after closing it with delete_on_close=False option. However, this option is only available since Python 3.12. Thus mkstemp() is used for temporary file creation as the more compatible option.
2024-05-21[lldb] Add the word "backtrace" to bt help string (#92618)Dave Lee1-5/+5
We noticed that `apropos backtrace` did not return the `bt` alias. This change adds the word "backtrace" to the help for `bt`. It also updates `thread backtrace` to keep the language used roughly in sync.
2024-05-20Add new Python API `SBCommandInterpreter::GetTranscript()` (#90703)royitaqi1-4/+39
# Motivation Currently, the user can already get the "transcript" (for "what is the transcript", see `CommandInterpreter::SaveTranscript`). However, the only way to obtain the transcript data as a user is to first destroy the debugger, then read the save directory. Note that destroy-callbacks cannot be used, because 1\ transcript data is private to the command interpreter (see `CommandInterpreter.h`), and 2\ the writing of the transcript is *after* the invocation of destory-callbacks (see `Debugger::Destroy`). So basically, there is no way to obtain the transcript: * during the lifetime of a debugger (including the destroy-callbacks, which often performs logging tasks, where the transcript can be useful) * without relying on external storage In theory, there are other ways for user to obtain transcript data during a debugger's life cycle: * Use Python API and intercept commands and results. * Use CLI and record console input/output. However, such ways rely on the client's setup and are not supported natively by LLDB. # Proposal Add a new Python API `SBCommandInterpreter::GetTranscript()`. Goals: * It can be called at any time during the debugger's life cycle, including in destroy-callbacks. * It returns data in-memory. Structured data: * To make data processing easier, the return type is `SBStructuredData`. See comments in code for how the data is organized. * In the future, `SaveTranscript` can be updated to write different formats using such data (e.g. JSON). This is probably accompanied by a new setting (e.g. `interpreter.save-session-format`). # Alternatives The return type can also be `std::vector<std::pair<std::string, SBCommandReturnObject>>`. This will make implementation easier, without having to translate it to `SBStructuredData`. On the other hand, `SBStructuredData` can convert to JSON easily, so it's more convenient for user to process. # Privacy Both user commands and output/error in the transcript can contain privacy data. However, as mentioned, the transcript is already available to the user. The addition of the new API doesn't increase the level of risk. In fact, it _lowers_ the risk of privacy data being leaked later on, by avoiding writing such data to external storage. Once the user (or their code) gets the transcript, it will be their responsibility to make sure that any required privacy policies are guaranteed. # Tests ``` bin/llvm-lit -sv ../external/llvm-project/lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py ``` ``` bin/llvm-lit -sv ../external/llvm-project/lldb/test/API/commands/session/save/TestSessionSave.py ``` --------- Co-authored-by: Roy Shi <royshi@meta.com> Co-authored-by: Med Ismail Bennani <ismail@bennani.ma>
2024-04-24[lldb][nfc] Move broadcaster class strings away from ConstString (#89690)Alex Langford1-3/+3
These are hardcoded strings that are already present in the data section of the binary, no need to immediately place them in the ConstString StringPools. Lots of code still calls `GetBroadcasterClass` and places the return value into a ConstString. Changing that would be a good follow-up. Additionally, calls to these functions are still wrapped in ConstStrings at the SBAPI layer. This is because we must guarantee the lifetime of all strings handed out publicly.
2024-02-05Add commands frequency to statistics dump (#80375)jeffreytan811-2/+9
Adding command interpreter statistics into "statistics dump" command so that we can track the command usage frequency for telemetry purpose. This is useful to answer questions like what is the most frequently used lldb commands across all our users. --------- Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
2023-12-21[lldb] Add actionable feedback when overwriting a command fails (#76030)Felipe de Azevedo Piovezan1-1/+5
If adding a user commands fails because a command with the same name already exists, we only say that "force replace is not set" without telling the user _how_ to set it. There are two ways to do so; this commit changes the error message to mention both.
2023-10-17[lldb] Scalar::GetValue() should take a Stream by reference (#69231)Alex Langford1-1/+1
This function always expects the pointer to be valid, a reference seems more appropriate.
2023-09-20Revert "Fix a bug with cancelling "attach -w" after you have run a process ↵David Spickett1-25/+8
previously (#65822)" This reverts commit 7265f792dc8e1157a3874aee5f8aed6d4d8236e7. The new test case is flaky on Linux AArch64 (https://lab.llvm.org/buildbot/#/builders/96) and more flaky on Windows on Arm (https://lab.llvm.org/buildbot/#/builders/219/builds/5735).
2023-09-19Fix a bug with cancelling "attach -w" after you have run a process ↵jimingham1-8/+25
previously (#65822) The problem is that the when the "attach" command is initiated, the ExecutionContext for the command has a process - it's the exited one from the previour run. But the `attach wait` creates a new process for the attach, and then errors out instead of interrupting when it finds that its process and the one in the command's ExecutionContext don't match. This change checks that if we're returning a target from GetExecutionContext, we fill the context with it's current process, not some historical one.
2023-09-13[lldb] Treat user aliases the same as built-ins when tab completing (#65974)David Spickett1-30/+10
Previously we would check all built-ins first for suggestions, then check built-ins and aliases. This meant that if you had an alias brkpt -> breakpoint, "br" would complete to "breakpoint". Instead of giving you the choice of "brkpt" or "breakpoint".
2023-08-31[lldb][NFCI] Remove unneeded ConstString conversionsAlex Langford1-2/+2
ConstString can be implicitly converted into a llvm::StringRef. This is very useful in many places, but it also hides places where we are creating a ConstString only to use it as a StringRef for the entire lifespan of the ConstString object. I locally removed the implicit conversion and found some of the places we were doing this. Differential Revision: https://reviews.llvm.org/D159237
2023-08-09[lldb] Sink StreamFile into lldbHostAlex Langford1-1/+1
StreamFile subclasses Stream (from lldbUtility) and is backed by a File (from lldbHost). It does not depend on anything from lldbCore or any of its sibling libraries, so I think it makes sense for this to live in lldbHost instead. Differential Revision: https://reviews.llvm.org/D157460
2023-07-06Refine the reporting mechanism for interruption.Jim Ingham1-2/+3
Also, make it possible for new Targets which haven't been added to the TargetList yet to check for interruption, and add a few more places in building modules where we can check for interruption. Differential Revision: https://reviews.llvm.org/D154542
2023-06-06[lldb/Commands] Add support to auto-completion for user commandsMed Ismail Bennani1-7/+3
This patch should allow the user to set specific auto-completion type for their custom commands. To do so, we had to hoist the `CompletionType` enum so the user can access it and add a new completion type flag to the CommandScriptAdd Command Object. So now, the user can specify which completion type will be used with their custom command, when they register it. This also makes the `crashlog` custom commands use disk-file completion type, to browse through the user file system and load the report. Differential Revision: https://reviews.llvm.org/D152011 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-05-04[lldb] Eliminate {Get,Set}PropertyAtIndexAsFileSpec (NFC)Jonas Devlieghere1-1/+1
This patch is a continuation of 6f8b33f6dfd0 and eliminates the {Get,Set}PropertyAtIndexAsFileSpec functions.
2023-05-04[lldb] Use templates to simplify {Get,Set}PropertyAtIndex (NFC)Jonas Devlieghere1-26/+26
Use templates to simplify {Get,Set}PropertyAtIndex. It has always bothered me how cumbersome those calls are when adding new properties. After this patch, SetPropertyAtIndex infers the type from its arguments and GetPropertyAtIndex required a single template argument for the return value. As an added benefit, this enables us to remove a bunch of wrappers from UserSettingsController and OptionValueProperties. Differential revision: https://reviews.llvm.org/D149774
2023-05-02[lldb] Make exe_ctx an optional argument in OptionValueProperties (NFC)Jonas Devlieghere1-39/+38
The majority of call sites are nullptr as the execution context. Refactor OptionValueProperties to make the argument optional and simplify all the callers.
2023-05-01[lldb] Refactor OptionValueProperties to return a std::optional (NFC)Jonas Devlieghere1-20/+20
Similar to fdbe7c7faa54, refactor OptionValueProperties to return a std::optional instead of taking a fail value. This allows the caller to handle situations where there's no value, instead of being unable to distinguish between the absence of a value and the value happening the match the fail value. When a fail value is required, std::optional::value_or() provides the same functionality.
2023-05-01[lldb] Add debugger.external-editor settingJonas Devlieghere1-1/+2
Add a new setting (debugger.external-editor) to specify an external editor. The setting takes precedence over the existing LLDB_EXTERNAL_EDITOR environment variable. Differential revision: https://reviews.llvm.org/D149565
2023-04-28[lldb] Refactor host::OpenFileInExternalEditorJonas Devlieghere1-2/+4
This patch refactors the macOS implementation of OpenFileInExternalEditor. It fixes an AppleEvent memory leak, the caching of LLDB_EXTERNAL_EDITOR and speculatively fixes a crash when CFURL is NULL (rdar://108633464). The new code also improves error handling, readability and documents calls to the CoreFoundation Launch Services APIs. A bunch of the Launch Services APIs have been deprecated (LSFindApplicationForInfo, LSOpenURLsWithRole). The preferred API is LSOpenCFURLRef but it doesn't specifying the "location" Apple Event which is used to highlight the current line and switching over would regress the existing behavior. rdar://108633464 Differential revision: https://reviews.llvm.org/D149482
2023-04-26[lldb] Create a way to force remove commandswalter erquinigo1-3/+4
Some LLDB set ups need to hide certain commands for security reasons, so I'm adding a flag that allows removing non-user commands. Differential Revision: https://reviews.llvm.org/D149312
2023-03-24Fix backtick handling in parsed commands.Jim Ingham1-98/+110
https://reviews.llvm.org/D146779
2023-03-15Add a Debugger interruption mechanism in conjunction with theJim Ingham1-5/+15
Command Interpreter mechanism. Differential Revision: https://reviews.llvm.org/D145136
2023-03-08[lldb] Make repeat commands work for regex commandsDave Lee1-5/+14
Fix logic for repeat commands, so that regex commands (specificially `bt`) are given the opportunity to provide a repeat command. rdar://104562616 Differential Revision: https://reviews.llvm.org/D143695
2023-03-07Recommit "[lldb] Redefine p alias to dwim-print command"Dave Lee1-2/+6
Redefine the `p` alias to the `dwim-print` command instead of `expression`. See https://reviews.llvm.org/D138315 for the introduction of `dwim-print`. To summarize, `dwim-print` is, as the name suggests, a command for printing. How a value gets printed, is decided by `dwim-print`. In some cases, `dwim-print` will print values using the same means as `frame variable` (because it's generally more reliable and faster that `expression` evaluation), and in other cases `dwim-print` uses the same code path as `expression`. This change has been tested in two different ways: 1. Re-aliasing `p` to `dwim-print`, as in this patch 2. Redefinining the `expression` command to `CommandObjectDWIMPrint` Previously, many of the lldb's tests used `p`, and which meant a test run with `p` aliases to `dwim-print` was a good way to test `dwim-print`. However most of those tests were updated to use `expression` explicitly (in anticipation of this change). Now, the best way to test `dwim-print` is the second approach: ``` diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 373c894f34f5..9c943cd30c7c 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -539,7 +539,7 @@ void CommandInterpreter::LoadCommandDictionary() { REGISTER_COMMAND_OBJECT("diagnostics", CommandObjectDiagnostics); REGISTER_COMMAND_OBJECT("disassemble", CommandObjectDisassemble); REGISTER_COMMAND_OBJECT("dwim-print", CommandObjectDWIMPrint); - REGISTER_COMMAND_OBJECT("expression", CommandObjectExpression); + REGISTER_COMMAND_OBJECT("expression", CommandObjectDWIMPrint); REGISTER_COMMAND_OBJECT("frame", CommandObjectMultiwordFrame); REGISTER_COMMAND_OBJECT("gui", CommandObjectGUI); REGISTER_COMMAND_OBJECT("help", CommandObjectHelp); ``` When the test suite is run with this change, there are two main categories of test failures for specific to features that `dwim-print` intentionally doesn't support: 1. Top level expressions (`--top-level`/`-p`) 2. Multiline expressions In cases where the behavior of `expression` is needed, users can use `expression` at those times. Differential Revision: https://reviews.llvm.org/D145189
2023-03-06Revert "[lldb] Redefine p alias to dwim-print command"Dave Lee1-6/+2
This reverts commit a00801d94b02eaebd1385b03fb9e549c07cc8585. Broke TestVSCode_completions.py
2023-03-06[lldb] Redefine p alias to dwim-print commandDave Lee1-2/+6
Redefine the `p` alias to the `dwim-print` command instead of `expression`. See https://reviews.llvm.org/D138315 for the introduction of `dwim-print`. To summarize, `dwim-print` is, as the name suggests, a command for printing. How a value gets printed, is decided by `dwim-print`. In some cases, `dwim-print` will print values using the same means as `frame variable` (because it's generally more reliable and faster that `expression` evaluation), and in other cases `dwim-print` uses the same code path as `expression`. This change has been tested in two different ways: 1. Re-aliasing `p` to `dwim-print`, as in this patch 2. Redefinining the `expression` command to `CommandObjectDWIMPrint` Previously, many of the lldb's tests used `p`, and which meant a test run with `p` aliases to `dwim-print` was a good way to test `dwim-print`. However most of those tests were updated to use `expression` explicitly (in anticipation of this change). Now, the best way to test `dwim-print` is the second approach: ``` diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 373c894f34f5..9c943cd30c7c 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -539,7 +539,7 @@ void CommandInterpreter::LoadCommandDictionary() { REGISTER_COMMAND_OBJECT("diagnostics", CommandObjectDiagnostics); REGISTER_COMMAND_OBJECT("disassemble", CommandObjectDisassemble); REGISTER_COMMAND_OBJECT("dwim-print", CommandObjectDWIMPrint); - REGISTER_COMMAND_OBJECT("expression", CommandObjectExpression); + REGISTER_COMMAND_OBJECT("expression", CommandObjectDWIMPrint); REGISTER_COMMAND_OBJECT("frame", CommandObjectMultiwordFrame); REGISTER_COMMAND_OBJECT("gui", CommandObjectGUI); REGISTER_COMMAND_OBJECT("help", CommandObjectHelp); ``` When the test suite is run with this change, there are two main categories of test failures for specific to features that `dwim-print` intentionally doesn't support: 1. Top level expressions (`--top-level`/`-p`) 2. Multiline expressions In cases where the behavior of `expression` is needed, users can use `expression` at those times. Differential Revision: https://reviews.llvm.org/D145189
2023-02-09[lldb] Remove unused CommandObjectRegexCommand::m_max_matches (NFC)Dave Lee1-13/+11
2023-01-07[lldb] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata1-2/+2
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to clean up the "using" declarations, #include "llvm/ADT/Optional.h", etc. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-07[lldb] Add #include <optional> (NFC)Kazu Hirata1-0/+1
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>. I'll post a separate patch to actually replace llvm::Optional with std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-19Revert "[lldb] Remove redundant .c_str() and .get() calls"Muhammad Omair Javaid1-4/+7
This reverts commit fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd. This has broken all LLDB buildbots: https://lab.llvm.org/buildbot/#/builders/68/builds/44990 https://lab.llvm.org/buildbot/#/builders/96/builds/33160
2022-12-18[lldb] Remove redundant .c_str() and .get() callsFangrui Song1-7/+4
Removing .c_str() has a semantics difference, but the use scenarios likely do not matter as we don't have NUL in the strings.
2022-12-16[trace] Migrate uses of operator<<(raw_ostream &OS, const Optional<T> &O) to ↵Fangrui Song1-1/+1
std::optional
2022-12-04[lldb] Use std::nullopt instead of None (NFC)Kazu Hirata1-4/+4
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-29[lldb] Introduce dwim-print commandDave Lee1-0/+2
Implements `dwim-print`, a printing command that chooses the most direct, efficient, and resilient means of printing a given expression. DWIM is an acronym for Do What I Mean. From Wikipedia, DWIM is described as: > attempt to anticipate what users intend to do, correcting trivial errors > automatically rather than blindly executing users' explicit but > potentially incorrect input The `dwim-print` command serves as a single print command for users who don't yet know, or prefer not to know, the various lldb commands that can be used to print, and when to use them. This initial implementation is the base foundation for `dwim-print`. It accepts no flags, only an expression. If the expression is the name of a variable in the frame, then effectively `frame variable` is used to get, and print, its value. Otherwise, printing falls back to using `expression` evaluation. In this initial version, frame variable paths will be handled with `expression`. Following this, there are a number of improvements that can be made. Some improvements include supporting `frame variable` expressions or registers. To provide transparency, especially as the `dwim-print` command evolves, a new setting is also introduced: `dwim-print-verbosity`. This setting instructs `dwim-print` to optionally print a message showing the effective command being run. For example `dwim-print var.meth()` can print a message such as: "note: ran `expression var.meth()`". See https://discourse.llvm.org/t/dwim-print-command/66078 for the proposal and discussion. Differential Revision: https://reviews.llvm.org/D138315
2022-11-03[lldb/Interpreter] Open saved transcript in GUI EditorMed Ismail Bennani1-0/+18
This patch will automatically open LLDB's saved transcript file on the graphical editor if lldb is running under an interactive graphical session. This can be controlled by a new setting: `interpreter.open-transcript-in-editor` rdar://92692106 Differential Revision: https://reviews.llvm.org/D137137 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-10-31[lldb] Add a "diagnostics dump" commandJonas Devlieghere1-0/+2
Add a "diagnostics dump" command to, as the name implies, dump the diagnostics to disk. The goal of this command is to let the user generate the diagnostics in case of an issue that doesn't cause the debugger to crash. This command is also critical for testing, where we don't want to cause a crash to emit the diagnostics. Differential revision: https://reviews.llvm.org/D135622
2022-09-26[lldb] Fix CommandInterpreter::DidProcessStopAbnormally() with multiple threadsMartin Storsjö1-2/+6
If a process has multiple threads, the thread with the stop info might not be the first one in the thread list. On Windows, under certain circumstances, processes seem to have one or more extra threads that haven't been launched by the executable itself, waiting in NtWaitForWorkViaWorkerFactory. If the main (stopped) thread isn't the first one in the list (the order seems nondeterministic), DidProcessStopAbnormally() would return false prematurely, instead of inspecting later threads. The main observable effect of DidProcessStopAbnormally() erroneously returning false, is when running lldb with multiple "-o" parameters to specify multiple commands to execute on the command line. After an abnormal stop, lldb would stop executing "-o" parameters and execute "-k" parameters instead - but due to this issue, it would instead keep executing "-o" parameters as if there was no abnormal stop. (If multiple parameters are specified via a script file via the "-s" option, all of the commands in that file are executed regardless of whether there's an abnormal stop inbetween.) Differential Revision: https://reviews.llvm.org/D134037
2022-09-19[lldb] Remove LLDB reproducersJonas Devlieghere1-16/+7
This patch removes the remaining reproducer code. The SBReproducer class remains for ABI stability but is just an empty shell. This completes the removal process outlined on the mailing list [1]. [1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
2022-09-14Revert "Revert "Be more careful to maintain quoting information when parsing ↵Jim Ingham1-14/+48
commands."" This reverts commit ac05bc0524c66c74278b26742896a4c634c034cf. I had incorrectly removed one set of checks in the option handling in Options::ParseAlias because I couldn't see what it is for. It was a bit obscure, but it handled the case where you pass "-something=other --" as the input_line, which caused the built-in "run" alias not to return the right value for IsDashDashCommand, causing TestHelp.py to fail.
2022-09-13Revert "Be more careful to maintain quoting information when parsing commands."Jim Ingham1-48/+14
This reverts commit 6c089b2af5d8d98f66b27b67f70958f520820a76. This was causing the test test_help_run_hides_options from TestHelp.py to fail on Linux and Windows (but the test succeeds on macOS). The decision to print option information is determined by CommandObjectAlias::IsDashDashCommand which was changed, but only by replacing an inline string constant with a const char * CommandInterpreter::g_argument which has the same string value. I can't see why this would fail, I'll have to spin up a vm to see if I can repo there.
2022-09-13Revert "constexpr isn't right here."Jim Ingham1-3/+3
This didn't help either. This reverts commit 8433b210839ed655852428ba8b34bb67b191957a.
2022-09-13constexpr isn't right here.Jim Ingham1-3/+3