Skip to content

Commit

Permalink
Do not return an entry point in the debugger view. Fix unit tests tha…
Browse files Browse the repository at this point in the history
…t uses it.
  • Loading branch information
xusheng6 committed Apr 11, 2023
1 parent df2a315 commit e6f8cb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions core/processview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}


Expand Down
1 change: 0 additions & 1 deletion core/processview.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace BinaryNinjaDebugger

class DebugProcessView : public BinaryView
{
std::vector<uint64_t> m_entryPoints;
size_t m_addressSize;
BNEndianness m_endian;
Ref<Architecture> m_arch;
Expand Down
4 changes: 2 additions & 2 deletions test/debugger_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e6f8cb1

Please sign in to comment.