Skip to content
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
20 changes: 20 additions & 0 deletions api/debuggerapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -693,20 +693,26 @@ namespace BinaryNinjaDebuggerAPI {
// target control
bool Launch();
BNDebugStopReason LaunchAndWait();
BNDebugStopReason LaunchAndWait(uint64_t timeoutMs);
bool Execute();
void Restart();
void Quit();
void QuitAndWait();
void QuitAndWait(uint64_t timeoutMs);
bool Connect();
DebugStopReason ConnectAndWait();
DebugStopReason ConnectAndWait(uint64_t timeoutMs);
bool ConnectToDebugServer();
bool DisconnectDebugServer();
void Detach();
void DetachAndWait();
void DetachAndWait(uint64_t timeoutMs);
// Convenience function, either launch the target process or connect to a remote, depending on the selected
// adapter
void LaunchOrConnect();
bool Attach();
DebugStopReason AttachAndWait();
DebugStopReason AttachAndWait(uint64_t timeoutMs);

bool Go();
bool GoReverse();
Expand All @@ -724,19 +730,33 @@ namespace BinaryNinjaDebuggerAPI {
void Pause();

DebugStopReason GoAndWait();
DebugStopReason GoAndWait(uint64_t timeoutMs);
DebugStopReason GoReverseAndWait();
DebugStopReason GoReverseAndWait(uint64_t timeoutMs);
DebugStopReason StepIntoAndWait(BNFunctionGraphType il = NormalFunctionGraph);
DebugStopReason StepIntoAndWait(BNFunctionGraphType il, uint64_t timeoutMs);
DebugStopReason StepIntoReverseAndWait(BNFunctionGraphType il = NormalFunctionGraph);
DebugStopReason StepIntoReverseAndWait(BNFunctionGraphType il, uint64_t timeoutMs);
DebugStopReason StepOverAndWait(BNFunctionGraphType il = NormalFunctionGraph);
DebugStopReason StepOverAndWait(BNFunctionGraphType il, uint64_t timeoutMs);
DebugStopReason StepOverReverseAndWait(BNFunctionGraphType il);
DebugStopReason StepOverReverseAndWait(BNFunctionGraphType il, uint64_t timeoutMs);
DebugStopReason StepReturnAndWait();
DebugStopReason StepReturnAndWait(uint64_t timeoutMs);
DebugStopReason StepReturnReverseAndWait();
DebugStopReason StepReturnReverseAndWait(uint64_t timeoutMs);
DebugStopReason RunToAndWait(uint64_t remoteAddresses);
DebugStopReason RunToAndWait(uint64_t remoteAddresses, uint64_t timeoutMs);
DebugStopReason RunToAndWait(const std::vector<uint64_t>& remoteAddresses);
DebugStopReason RunToAndWait(const std::vector<uint64_t>& remoteAddresses, uint64_t timeoutMs);
DebugStopReason RunToReverseAndWait(uint64_t remoteAddresses);
DebugStopReason RunToReverseAndWait(uint64_t remoteAddresses, uint64_t timeoutMs);
DebugStopReason RunToReverseAndWait(const std::vector<uint64_t>& remoteAddresses);
DebugStopReason RunToReverseAndWait(const std::vector<uint64_t>& remoteAddresses, uint64_t timeoutMs);
DebugStopReason PauseAndWait();
DebugStopReason PauseAndWait(uint64_t timeoutMs);
DebugStopReason RestartAndWait();
DebugStopReason RestartAndWait(uint64_t timeoutMs);

std::string GetAdapterType();
void SetAdapterType(const std::string& adapter);
Expand Down
122 changes: 122 additions & 0 deletions api/debuggercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,24 @@ DebugStopReason DebuggerController::GoAndWait()
}


DebugStopReason DebuggerController::GoAndWait(uint64_t timeoutMs)
{
return BNDebuggerGoAndWaitWithTimeout(m_object, timeoutMs);
}


DebugStopReason DebuggerController::GoReverseAndWait()
{
return BNDebuggerGoReverseAndWait(m_object);
}


DebugStopReason DebuggerController::GoReverseAndWait(uint64_t timeoutMs)
{
return BNDebuggerGoReverseAndWaitWithTimeout(m_object, timeoutMs);
}


bool DebuggerController::Launch()
{
return BNDebuggerLaunch(m_object);
Expand All @@ -349,6 +361,12 @@ DebugStopReason DebuggerController::LaunchAndWait()
}


DebugStopReason DebuggerController::LaunchAndWait(uint64_t timeoutMs)
{
return BNDebuggerLaunchAndWaitWithTimeout(m_object, timeoutMs);
}


bool DebuggerController::Execute()
{
return BNDebuggerExecute(m_object);
Expand All @@ -373,6 +391,12 @@ void DebuggerController::QuitAndWait()
}


void DebuggerController::QuitAndWait(uint64_t timeoutMs)
{
BNDebuggerQuitAndWaitWithTimeout(m_object, timeoutMs);
}


bool DebuggerController::Connect()
{
return BNDebuggerConnect(m_object);
Expand All @@ -385,6 +409,12 @@ DebugStopReason DebuggerController::ConnectAndWait()
}


DebugStopReason DebuggerController::ConnectAndWait(uint64_t timeoutMs)
{
return BNDebuggerConnectAndWaitWithTimeout(m_object, timeoutMs);
}


bool DebuggerController::ConnectToDebugServer()
{
return BNDebuggerConnectToDebugServer(m_object);
Expand All @@ -403,6 +433,18 @@ void DebuggerController::Detach()
}


void DebuggerController::DetachAndWait()
{
BNDebuggerDetachAndWait(m_object);
}


void DebuggerController::DetachAndWait(uint64_t timeoutMs)
{
BNDebuggerDetachAndWaitWithTimeout(m_object, timeoutMs);
}


void DebuggerController::Pause()
{
BNDebuggerPause(m_object);
Expand All @@ -428,6 +470,12 @@ DebugStopReason DebuggerController::AttachAndWait()
}


DebugStopReason DebuggerController::AttachAndWait(uint64_t timeoutMs)
{
return BNDebuggerAttachAndWaitWithTimeout(m_object, timeoutMs);
}



bool DebuggerController::StepInto(BNFunctionGraphType il)
{
Expand Down Expand Up @@ -495,71 +543,145 @@ DebugStopReason DebuggerController::StepIntoAndWait(BNFunctionGraphType il)
}


DebugStopReason DebuggerController::StepIntoAndWait(BNFunctionGraphType il, uint64_t timeoutMs)
{
return BNDebuggerStepIntoAndWaitWithTimeout(m_object, il, timeoutMs);
}


DebugStopReason DebuggerController::StepIntoReverseAndWait(BNFunctionGraphType il)
{
return BNDebuggerStepIntoReverseAndWait(m_object, il);
}


DebugStopReason DebuggerController::StepIntoReverseAndWait(BNFunctionGraphType il, uint64_t timeoutMs)
{
return BNDebuggerStepIntoReverseAndWaitWithTimeout(m_object, il, timeoutMs);
}


DebugStopReason DebuggerController::StepOverAndWait(BNFunctionGraphType il)
{
return BNDebuggerStepOverAndWait(m_object, il);
}


DebugStopReason DebuggerController::StepOverAndWait(BNFunctionGraphType il, uint64_t timeoutMs)
{
return BNDebuggerStepOverAndWaitWithTimeout(m_object, il, timeoutMs);
}


DebugStopReason DebuggerController::StepOverReverseAndWait(BNFunctionGraphType il)
{
return BNDebuggerStepOverReverseAndWait(m_object, il);
}


DebugStopReason DebuggerController::StepOverReverseAndWait(BNFunctionGraphType il, uint64_t timeoutMs)
{
return BNDebuggerStepOverReverseAndWaitWithTimeout(m_object, il, timeoutMs);
}


DebugStopReason DebuggerController::StepReturnAndWait()
{
return BNDebuggerStepReturnAndWait(m_object);
}


DebugStopReason DebuggerController::StepReturnAndWait(uint64_t timeoutMs)
{
return BNDebuggerStepReturnAndWaitWithTimeout(m_object, timeoutMs);
}

DebugStopReason DebuggerController::StepReturnReverseAndWait()
{
return BNDebuggerStepReturnReverseAndWait(m_object);
}


DebugStopReason DebuggerController::StepReturnReverseAndWait(uint64_t timeoutMs)
{
return BNDebuggerStepReturnReverseAndWaitWithTimeout(m_object, timeoutMs);
}


DebugStopReason DebuggerController::RunToAndWait(uint64_t remoteAddresses)
{
return RunToAndWait(std::vector<uint64_t> {remoteAddresses});
}


DebugStopReason DebuggerController::RunToAndWait(uint64_t remoteAddresses, uint64_t timeoutMs)
{
return RunToAndWait(std::vector<uint64_t> {remoteAddresses}, timeoutMs);
}


DebugStopReason DebuggerController::RunToAndWait(const std::vector<uint64_t>& remoteAddresses)
{
return BNDebuggerRunToAndWait(m_object, remoteAddresses.data(), remoteAddresses.size());
}


DebugStopReason DebuggerController::RunToAndWait(const std::vector<uint64_t>& remoteAddresses, uint64_t timeoutMs)
{
return BNDebuggerRunToAndWaitWithTimeout(m_object, remoteAddresses.data(), remoteAddresses.size(), timeoutMs);
}


DebugStopReason DebuggerController::RunToReverseAndWait(uint64_t remoteAddresses)
{
return RunToReverseAndWait(std::vector<uint64_t> {remoteAddresses});
}


DebugStopReason DebuggerController::RunToReverseAndWait(uint64_t remoteAddresses, uint64_t timeoutMs)
{
return RunToReverseAndWait(std::vector<uint64_t> {remoteAddresses}, timeoutMs);
}


DebugStopReason DebuggerController::RunToReverseAndWait(const std::vector<uint64_t>& remoteAddresses)
{
return BNDebuggerRunToReverseAndWait(m_object, remoteAddresses.data(), remoteAddresses.size());
}


DebugStopReason DebuggerController::RunToReverseAndWait(
const std::vector<uint64_t>& remoteAddresses, uint64_t timeoutMs)
{
return BNDebuggerRunToReverseAndWaitWithTimeout(
m_object, remoteAddresses.data(), remoteAddresses.size(), timeoutMs);
}


DebugStopReason DebuggerController::PauseAndWait()
{
return BNDebuggerPauseAndWait(m_object);
}


DebugStopReason DebuggerController::PauseAndWait(uint64_t timeoutMs)
{
return BNDebuggerPauseAndWaitWithTimeout(m_object, timeoutMs);
}


DebugStopReason DebuggerController::RestartAndWait()
{
return BNDebuggerRestartAndWait(m_object);
}


DebugStopReason DebuggerController::RestartAndWait(uint64_t timeoutMs)
{
return BNDebuggerRestartAndWaitWithTimeout(m_object, timeoutMs);
}


std::string DebuggerController::GetAdapterType()
{
char* adapter = BNDebuggerGetAdapterType(m_object);
Expand Down
Loading