Skip to content

[lldb][sbapi] Fix API break in SBDebugger broadcast bits (#90261) #8645

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lldb/bindings/python/static-binding/LLDBWrapPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98821,10 +98821,6 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "eAddressMaskRangeAll",SWIG_From_int(static_cast< int >(lldb::eAddressMaskRangeAll)));
SWIG_Python_SetConstant(d, "ChildCacheState_eRefetch",SWIG_From_int(static_cast< int >(lldb::ChildCacheState::eRefetch)));
SWIG_Python_SetConstant(d, "ChildCacheState_eReuse",SWIG_From_int(static_cast< int >(lldb::ChildCacheState::eReuse)));
SWIG_Python_SetConstant(d, "eBroadcastBitProgress",SWIG_From_int(static_cast< int >(lldb::eBroadcastBitProgress)));
SWIG_Python_SetConstant(d, "eBroadcastBitWarning",SWIG_From_int(static_cast< int >(lldb::eBroadcastBitWarning)));
SWIG_Python_SetConstant(d, "eBroadcastBitError",SWIG_From_int(static_cast< int >(lldb::eBroadcastBitError)));
SWIG_Python_SetConstant(d, "eBroadcastBitProgressCategory",SWIG_From_int(static_cast< int >(lldb::eBroadcastBitProgressCategory)));
SWIG_Python_SetConstant(d, "SBCommandInterpreter_eBroadcastBitThreadShouldExit",SWIG_From_int(static_cast< int >(lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit)));
SWIG_Python_SetConstant(d, "SBCommandInterpreter_eBroadcastBitResetPrompt",SWIG_From_int(static_cast< int >(lldb::SBCommandInterpreter::eBroadcastBitResetPrompt)));
SWIG_Python_SetConstant(d, "SBCommandInterpreter_eBroadcastBitQuitCommandReceived",SWIG_From_int(static_cast< int >(lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived)));
Expand All @@ -98836,6 +98832,10 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "SBCommunication_eBroadcastBitReadThreadShouldExit",SWIG_From_int(static_cast< int >(lldb::SBCommunication::eBroadcastBitReadThreadShouldExit)));
SWIG_Python_SetConstant(d, "SBCommunication_eBroadcastBitPacketAvailable",SWIG_From_int(static_cast< int >(lldb::SBCommunication::eBroadcastBitPacketAvailable)));
SWIG_Python_SetConstant(d, "SBCommunication_eAllEventBits",SWIG_From_int(static_cast< int >(lldb::SBCommunication::eAllEventBits)));
SWIG_Python_SetConstant(d, "SBDebugger_eBroadcastBitProgress",SWIG_From_int(static_cast< int >(lldb::SBDebugger::eBroadcastBitProgress)));
SWIG_Python_SetConstant(d, "SBDebugger_eBroadcastBitWarning",SWIG_From_int(static_cast< int >(lldb::SBDebugger::eBroadcastBitWarning)));
SWIG_Python_SetConstant(d, "SBDebugger_eBroadcastBitError",SWIG_From_int(static_cast< int >(lldb::SBDebugger::eBroadcastBitError)));
SWIG_Python_SetConstant(d, "SBDebugger_eBroadcastBitProgressCategory",SWIG_From_int(static_cast< int >(lldb::SBDebugger::eBroadcastBitProgressCategory)));
SWIG_Python_SetConstant(d, "SBProcess_eBroadcastBitStateChanged",SWIG_From_int(static_cast< int >(lldb::SBProcess::eBroadcastBitStateChanged)));
SWIG_Python_SetConstant(d, "SBProcess_eBroadcastBitInterrupt",SWIG_From_int(static_cast< int >(lldb::SBProcess::eBroadcastBitInterrupt)));
SWIG_Python_SetConstant(d, "SBProcess_eBroadcastBitSTDOUT",SWIG_From_int(static_cast< int >(lldb::SBProcess::eBroadcastBitSTDOUT)));
Expand Down
16 changes: 8 additions & 8 deletions lldb/bindings/python/static-binding/lldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,14 +1777,6 @@ def lldb_iter(obj, getsize, getelem):

ChildCacheState_eReuse = _lldb.ChildCacheState_eReuse

eBroadcastBitProgress = _lldb.eBroadcastBitProgress

eBroadcastBitWarning = _lldb.eBroadcastBitWarning

eBroadcastBitError = _lldb.eBroadcastBitError

eBroadcastBitProgressCategory = _lldb.eBroadcastBitProgressCategory

class SBAddress(object):
r"""
A section + offset based address class.
Expand Down Expand Up @@ -4377,6 +4369,14 @@ def disassemble_instructions (insts):
"""

thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
eBroadcastBitProgress = _lldb.SBDebugger_eBroadcastBitProgress

eBroadcastBitWarning = _lldb.SBDebugger_eBroadcastBitWarning

eBroadcastBitError = _lldb.SBDebugger_eBroadcastBitError

eBroadcastBitProgressCategory = _lldb.SBDebugger_eBroadcastBitProgressCategory


def __init__(self, *args):
r"""
Expand Down
7 changes: 7 additions & 0 deletions lldb/include/lldb/API/SBDebugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class LLDB_API SBInputReader {

class LLDB_API SBDebugger {
public:
FLAGS_ANONYMOUS_ENUM(){
eBroadcastBitProgress = lldb::DebuggerBroadcastBit::eBroadcastBitProgress,
eBroadcastBitWarning = lldb::DebuggerBroadcastBit::eBroadcastBitWarning,
eBroadcastBitError = lldb::DebuggerBroadcastBit::eBroadcastBitError,
eBroadcastBitProgressCategory =
lldb::DebuggerBroadcastBit::eBroadcastBitProgressCategory,
};
SBDebugger();

SBDebugger(const lldb::SBDebugger &rhs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUp(self):
self.broadcaster = self.dbg.GetBroadcaster()
self.listener = lldbutil.start_listening_from(
self.broadcaster,
lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
lldb.SBDebugger.eBroadcastBitWarning | lldb.SBDebugger.eBroadcastBitError,
)

def test_dwarf_symbol_loading_diagnostic_report(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setUp(self):
TestBase.setUp(self)
self.broadcaster = self.dbg.GetBroadcaster()
self.listener = lldbutil.start_listening_from(
self.broadcaster, lldb.eBroadcastBitProgress
self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
)

def test_dwarf_symbol_loading_progress_report(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
# other unrelated progress events.
broadcaster = self.dbg.GetBroadcaster()
listener = lldbutil.start_listening_from(
broadcaster, lldb.eBroadcastBitProgress
broadcaster, lldb.SBDebugger.eBroadcastBitProgress
)

# Trigger module builds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setUp(self):
TestBase.setUp(self)
self.broadcaster = self.dbg.GetBroadcaster()
self.listener = lldbutil.start_listening_from(self.broadcaster,
lldb.eBroadcastBitProgress)
lldb.SBDebugger.eBroadcastBitProgress)

@skipIf(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true'))
# Don't run ClangImporter tests if Clangimporter is disabled.
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/macosx/rosetta/TestRosetta.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_rosetta(self):
if rosetta_debugserver_installed():
broadcaster = self.dbg.GetBroadcaster()
listener = lldbutil.start_listening_from(
broadcaster, lldb.eBroadcastBitWarning
broadcaster, lldb.SBDebugger.eBroadcastBitWarning
)

target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
Expand Down
4 changes: 2 additions & 2 deletions lldb/tools/lldb-dap/lldb-dap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ void SendStdOutStdErr(lldb::SBProcess &process) {

void ProgressEventThreadFunction() {
lldb::SBListener listener("lldb-dap.progress.listener");
g_dap.debugger.GetBroadcaster().AddListener(listener,
lldb::eBroadcastBitProgress);
g_dap.debugger.GetBroadcaster().AddListener(
listener, lldb::SBDebugger::eBroadcastBitProgress);
g_dap.broadcaster.AddListener(listener, eBroadcastBitStopProgressThread);
lldb::SBEvent event;
bool done = false;
Expand Down