From e6f8cb14c5234804ec043d7e86ff314e4a2573de Mon Sep 17 00:00:00 2001 From: Xusheng Date: Wed, 29 Mar 2023 22:41:53 +0800 Subject: [PATCH] Do not return an entry point in the debugger view. Fix unit tests that uses it. --- core/processview.cpp | 6 +----- core/processview.h | 1 - test/debugger_test.py | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/core/processview.cpp b/core/processview.cpp index adaf9faa..36902dbe 100644 --- a/core/processview.cpp +++ b/core/processview.cpp @@ -36,7 +36,6 @@ DebugProcessView::DebugProcessView(DebugNullView* nullView, BinaryView* parent): else m_length = (1ULL << bits) - 1; - m_entryPoints.push_back(parent->GetEntryPoint()); m_endian = parent->GetDefaultEndianness(); // TODO: Read segments from debugger @@ -74,10 +73,7 @@ bool DebugProcessView::Init() uint64_t DebugProcessView::PerformGetEntryPoint() const { - if (m_entryPoints.size() == 0) - return 0; - - return m_entryPoints[0]; + return 0; } diff --git a/core/processview.h b/core/processview.h index efc8dfda..b4dbd2e5 100644 --- a/core/processview.h +++ b/core/processview.h @@ -29,7 +29,6 @@ namespace BinaryNinjaDebugger class DebugProcessView : public BinaryView { - std::vector m_entryPoints; size_t m_addressSize; BNEndianness m_endian; Ref m_arch; diff --git a/test/debugger_test.py b/test/debugger_test.py index d27a62d3..32b90f89 100644 --- a/test/debugger_test.py +++ b/test/debugger_test.py @@ -175,7 +175,7 @@ def test_breakpoint(self): self.assertIsNone(dbg.delete_breakpoint(0)) # breakpoint set/clear should succeed at entrypoint - entry = dbg.live_view.entry_point + entry = dbg.data.entry_point self.assertIsNone(dbg.delete_breakpoint(entry)) self.assertIsNone(dbg.add_breakpoint(entry)) @@ -265,7 +265,7 @@ def test_assembly_code(self): bv = BinaryViewType.get_view_of_file(fpath) dbg = DebuggerController(bv) self.assertTrue(dbg.launch_and_wait()) - entry = dbg.live_view.entry_point + entry = dbg.data.entry_point self.assertEqual(dbg.ip, entry) # TODO: we can use BN to disassemble the binary and find out how long is the instruction