Skip to content

Commit 0bf47c1

Browse files
committed
[lldb] Return an error when if process save-core plugin is invalid
Fixes #142581
1 parent 5d2e1c0 commit 0bf47c1

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

lldb/source/Commands/CommandObjectProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ class CommandObjectProcessSaveCore : public CommandObjectParsed {
13031303
llvm_unreachable("Unimplemented option");
13041304
}
13051305

1306-
return {};
1306+
return error;
13071307
}
13081308

13091309
void OptionParsingStarting(ExecutionContext *execution_context) override {

lldb/source/Symbol/SaveCoreOptions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Status SaveCoreOptions::SetPluginName(const char *name) {
2424
if (!PluginManager::IsRegisteredObjectFilePluginName(name)) {
2525
return Status::FromErrorStringWithFormat(
2626
"plugin name '%s' is not a valid ObjectFile plugin name", name);
27-
return error;
2827
}
2928

3029
m_plugin_name = name;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# RUN: %clang_host -g %S/Inputs/main.c -o %t
2+
# RUN: %lldb %t -s %s -o exit 2>&1 | FileCheck %s
3+
4+
b main
5+
# CHECK-LABEL: b main
6+
# CHECK: Breakpoint 1: where = {{.*}}`main
7+
8+
run
9+
# CHECK-LABEL: run
10+
# CHECK: Process {{.*}} stopped
11+
# CHECK: stop reason = breakpoint 1
12+
# CHECK: frame #0: {{.*}}`main at main.c
13+
14+
process save-core --plugin-name=notaplugin dump
15+
# CHECK-LABEL: process save-core --plugin-name=notaplugin dump
16+
# CHECK: error: plugin name 'notaplugin' is not a valid ObjectFile plugin name

0 commit comments

Comments
 (0)