MCPcopy Create free account
hub / github.com/Vector35/debugger / DebugAdapter

Method DebugAdapter

core/debugadapter.cpp:30–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30DebugAdapter::DebugAdapter(BinaryView* data)
31{
32 INIT_DEBUGGER_API_OBJECT();
33
34 // These are just a workaround to avoid holding a reference to the data. Note, when DebugAdapter is constructed,
35 // the binary view passed in is the one *before* rebasing. After the debugger launches the target and rebases the
36 // binary view, the un-rebased binary view is released by the core and the debugger becomes the only place where
37 // we hold a reference to it.
38 // Though, a better approach would be to add a function SetData() to the DebugAdapter class and update the binary
39 // view after the launch, similar to what we do for the DebuggerController. However, we will need to add new APIs
40 // to get the original image base of the binary view, because LLDB requires the breakpoint address be relative to
41 // the original image base, and it does not work with a rebased one.
42 m_entryPoint = data->GetEntryPoint();
43 // For shared libraries which do not have a valid entry point, the GetEntryPoint will return 0x0 anyways.
44 // Here we check if there is actually a function at the entry point, to determine if the entry point is real.
45 m_hasEntryFunction = (data->GetAnalysisEntryPoint() != nullptr);
46 m_start = data->GetStart();
47 if (data->GetDefaultArchitecture())
48 m_defaultArchitecture = data->GetDefaultArchitecture()->GetName();
49
50 m_originalFileName = data->GetFile()->GetOriginalFilename();
51}
52
53
54void DebugAdapter::PostDebuggerEvent(const DebuggerEvent& event)

Callers

nothing calls this directly

Calls 1

GetNameMethod · 0.80

Tested by

no test coverage detected