-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] add stop-at-user-entry option to process launch (#67019)
## Description This pull request adds a new `stop-at-user-entry` option to LLDB `process launch` command, allowing users to launch a process and pause execution at the entry point of the program (for C-based languages, `main` function). ## Motivation This option provides a convenient way to begin debugging a program by launching it and breaking at the desired entry point. ## Changes Made - Added `stop-at-user-entry` option to `Options.td` and the corresponding case in `CommandOptionsProcessLaunch.cpp` (short option is 'm') - Implemented `GetUserEntryPointName` method in the Language plugins available at the moment. - Declared the `CreateBreakpointAtUserEntry` method in the Target API. - Create Shell test for the command `command-process-launch-user-entry.test`. ## Usage `process launch --stop-at-user-entry` or `process launch -m` launches the process and pauses execution at the entry point of the program.
- Loading branch information
Showing
9 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
lldb/test/Shell/Commands/command-process-launch-user-entry.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# RUN: %clang_host -g %S/Inputs/main.c -o %t | ||
# RUN: %lldb %t -s %s -o exit | FileCheck %s | ||
|
||
process launch -m | ||
# CHECK-LABEL: process launch -m | ||
# CHECK: Process {{.*}} stopped | ||
# CHECK: stop reason = one-shot breakpoint 1 | ||
# CHECK: frame #0: {{.*}}`main at main.c |