-
Notifications
You must be signed in to change notification settings - Fork 15k
Switch the ScriptedBreakpointResolver over to the ScriptedInterface form #150720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||
| //===-- ScriptedBreakpointInterface.h -----------------------------*- C++ -*-===// | ||||||||||||||||
| // | ||||||||||||||||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||||||||||||||
| // See https://llvm.org/LICENSE.txt for license information. | ||||||||||||||||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||||||||||||||
| // | ||||||||||||||||
| //===----------------------------------------------------------------------===// | ||||||||||||||||
|
|
||||||||||||||||
| #ifndef LLDB_INTERPRETER_INTERFACES_SCRIPTEDBREAKPOINTINTERFACE_H | ||||||||||||||||
| #define LLDB_INTERPRETER_INTERFACES_SCRIPTEDBREAKPOINTINTERFACE_H | ||||||||||||||||
|
|
||||||||||||||||
| #include "lldb/lldb-private.h" | ||||||||||||||||
| #include "lldb/Symbol/SymbolContext.h" | ||||||||||||||||
|
|
||||||||||||||||
| #include "ScriptedInterface.h" | ||||||||||||||||
|
||||||||||||||||
| #include "lldb/lldb-private.h" | |
| #include "lldb/Symbol/SymbolContext.h" | |
| #include "ScriptedInterface.h" | |
| #include "lldb/lldb-private.h" | |
| #include "lldb/Symbol/SymbolContext.h" | |
| #include "ScriptedInterface.h" |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -35,7 +35,7 @@ BreakpointResolverScripted::BreakpointResolverScripted( | |||
|
|
||||
| void BreakpointResolverScripted::CreateImplementationIfNeeded( | ||||
| BreakpointSP breakpoint_sp) { | ||||
| if (m_implementation_sp) | ||||
| if (m_interface_sp) | ||||
| return; | ||||
|
|
||||
| if (m_class_name.empty()) | ||||
|
|
@@ -50,8 +50,28 @@ void BreakpointResolverScripted::CreateImplementationIfNeeded( | |||
| if (!script_interp) | ||||
| return; | ||||
|
|
||||
| m_implementation_sp = script_interp->CreateScriptedBreakpointResolver( | ||||
| m_class_name.c_str(), m_args, breakpoint_sp); | ||||
| m_interface_sp = script_interp->CreateScriptedBreakpointInterface(); | ||||
| if (!m_interface_sp) { | ||||
| m_error = Status::FromErrorStringWithFormat( | ||||
| "BreakpointResolverScripted::%s () - ERROR: %s", __FUNCTION__, | ||||
| "Script interpreter couldn't create Scripted Breakpoint Interface"); | ||||
| return; | ||||
| } | ||||
|
|
||||
| auto obj_or_err = m_interface_sp->CreatePluginObject( | ||||
| m_class_name, breakpoint_sp, m_args); | ||||
| if (!obj_or_err) { | ||||
| m_error = Status::FromError(obj_or_err.takeError()); | ||||
| printf("CreateImplementationIfNeeded got error: %s\n", m_error.AsCString()); | ||||
|
||||
| printf("CreateImplementationIfNeeded got error: %s\n", m_error.AsCString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that one should actually go, that was for debugging. I have to figure out a way to make this error available. That's a general problem with errors when creating the Python object to back these affordances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's file an issue or radar to update every scripted affordance to take an Status reference so the caller can percolate up to the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just said "we should come up with a good scheme" I didn't opine on the scheme.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -116,6 +116,14 @@ lldb::StreamSP ScriptInterpreter::GetOpaqueTypeFromSBStream( | |||||||||||
| return nullptr; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| SymbolContext ScriptInterpreter::GetOpaqueTypeFromSBSymbolContext( | ||||||||||||
| const lldb::SBSymbolContext &sb_sym_ctx) const { | ||||||||||||
| if (sb_sym_ctx.m_opaque_up) { | ||||||||||||
| return *sb_sym_ctx.m_opaque_up.get(); | ||||||||||||
| } | ||||||||||||
|
||||||||||||
| if (sb_sym_ctx.m_opaque_up) { | |
| return *sb_sym_ctx.m_opaque_up.get(); | |
| } | |
| if (sb_sym_ctx.m_opaque_up) | |
| return *sb_sym_ctx.m_opaque_up.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: new files shouldn't contain the name and filetype anymore.