Skip to content

Commit 076f335

Browse files
committed
Address review comments.
1 parent 75f8e3a commit 076f335

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

lldb/include/lldb/Interpreter/Interfaces/ScriptedBreakpointInterface.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- ScriptedBreakpointInterface.h -----------------------------*- C++ -*-===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -11,14 +11,13 @@
1111

1212
#include "lldb/lldb-private.h"
1313
#include "lldb/Symbol/SymbolContext.h"
14-
1514
#include "ScriptedInterface.h"
1615

1716
namespace lldb_private {
1817
class ScriptedBreakpointInterface : public ScriptedInterface {
1918
public:
2019
virtual llvm::Expected<StructuredData::GenericSP>
21-
CreatePluginObject(llvm::StringRef class_name, lldb::BreakpointSP target_sp,
20+
CreatePluginObject(llvm::StringRef class_name, lldb::BreakpointSP break_sp,
2221
const StructuredDataImpl &args_sp) = 0;
2322

2423
/// "ResolverCallback" will get called when a new module is loaded. The

lldb/source/Breakpoint/BreakpointResolverScripted.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ void BreakpointResolverScripted::CreateImplementationIfNeeded(
6262
m_class_name, breakpoint_sp, m_args);
6363
if (!obj_or_err) {
6464
m_error = Status::FromError(obj_or_err.takeError());
65-
printf("CreateImplementationIfNeeded got error: %s\n", m_error.AsCString());
6665
return;
6766
}
6867

lldb/source/Interpreter/ScriptInterpreter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ lldb::StreamSP ScriptInterpreter::GetOpaqueTypeFromSBStream(
118118

119119
SymbolContext ScriptInterpreter::GetOpaqueTypeFromSBSymbolContext(
120120
const lldb::SBSymbolContext &sb_sym_ctx) const {
121-
if (sb_sym_ctx.m_opaque_up) {
121+
if (sb_sym_ctx.m_opaque_up)
122122
return *sb_sym_ctx.m_opaque_up.get();
123-
}
124123
return {};
125124
}
126125

lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedBreakpointPythonInterface.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- ScriptedBreakpointPythonInterface.cpp -------------------------------===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -15,10 +15,8 @@
1515

1616
#if LLDB_ENABLE_PYTHON
1717

18-
// clang-format off
1918
// LLDB Python header must be included first
2019
#include "../lldb-python.h"
21-
//clang-format on
2220

2321
#include "../SWIGPythonBridge.h"
2422
#include "../ScriptInterpreterPythonImpl.h"
@@ -36,9 +34,8 @@ llvm::Expected<StructuredData::GenericSP>
3634
ScriptedBreakpointPythonInterface::CreatePluginObject(llvm::StringRef class_name,
3735
lldb::BreakpointSP break_sp,
3836
const StructuredDataImpl &args_sp) {
39-
lldb::TargetSP target_sp;
4037
return ScriptedPythonInterface::CreatePluginObject(class_name, nullptr,
41-
break_sp /*target_sp*/, args_sp);
38+
break_sp, args_sp);
4239
}
4340

4441
bool
@@ -49,7 +46,8 @@ ScriptedBreakpointPythonInterface::ResolverCallback(SymbolContext sym_ctx) {
4946

5047
if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj,
5148
error)) {
52-
// FIXME: Should log the error here.
49+
Log *log = GetLog(LLDBLog::Script);
50+
LLDB_LOG(log, "Error calling __callback__ method: {1}", error);
5351
return true;
5452
}
5553
return obj->GetBooleanValue();
@@ -86,7 +84,8 @@ std::optional<std::string> ScriptedBreakpointPythonInterface::GetShortHelp() {
8684
void ScriptedBreakpointPythonInterface::Initialize() {
8785
const std::vector<llvm::StringRef> ci_usages = {
8886
"breakpoint set -P classname [-k key -v value ...]"};
89-
const std::vector<llvm::StringRef> api_usages = {};
87+
const std::vector<llvm::StringRef> api_usages = {
88+
"SBTarget.BreakpointCreateFromScript"};
9089
PluginManager::RegisterPlugin(
9190
GetPluginNameStatic(),
9291
llvm::StringRef("Create a breakpoint that chooses locations based on user-created callbacks"),

0 commit comments

Comments
 (0)