mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-05 15:56:00 +02:00
Added "Keep Native Console Open" option
This commit is contained in:
parent
fd3bd861ae
commit
8052066ab0
18 changed files with 423 additions and 41 deletions
|
@ -409,7 +409,7 @@ void CeDebugger::ContinueDebugEvent()
|
|||
mCeMachine->mDebugEvent.Set();
|
||||
}
|
||||
|
||||
void CeDebugger::ForegroundTarget()
|
||||
void CeDebugger::ForegroundTarget(int altProcessId)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -4361,6 +4361,11 @@ String CeDebugger::GetProcessInfo()
|
|||
return String();
|
||||
}
|
||||
|
||||
int CeDebugger::GetProcessId()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
DebugVisualizerEntry* CeDebugger::FindVisualizerForType(BfType* dbgType, Array<String>* wildcardCaptures)
|
||||
{
|
||||
auto ceModule = mCeMachine->mCeModule;
|
||||
|
|
|
@ -324,7 +324,7 @@ public:
|
|||
virtual String GetDbgAllocInfo() override;
|
||||
virtual void Update() override;
|
||||
virtual void ContinueDebugEvent() override;
|
||||
virtual void ForegroundTarget() override;
|
||||
virtual void ForegroundTarget(int altProcessId) override;
|
||||
virtual Breakpoint* CreateBreakpoint(const StringImpl& fileName, int lineNum, int wantColumn, int instrOffset) override;
|
||||
virtual Breakpoint* CreateMemoryBreakpoint(intptr addr, int byteCount) override;
|
||||
virtual Breakpoint* CreateSymbolBreakpoint(const StringImpl& symbolName) override;
|
||||
|
@ -359,6 +359,7 @@ public:
|
|||
virtual String GetAutoLocals(int callStackIdx, bool showRegs) override;
|
||||
virtual String CompactChildExpression(const StringImpl& expr, const StringImpl& parentExpr, int callStackIdx) override;
|
||||
virtual String GetProcessInfo() override;
|
||||
virtual int GetProcessId() override;
|
||||
virtual String GetThreadInfo() override;
|
||||
virtual void SetActiveThread(int threadId) override;
|
||||
virtual int GetActiveThread() override;
|
||||
|
|
|
@ -1363,9 +1363,9 @@ BF_EXPORT const char* BF_CALLTYPE Debugger_GetCollectionContinuation(const char*
|
|||
return outString.c_str();
|
||||
}
|
||||
|
||||
BF_EXPORT void BF_CALLTYPE Debugger_ForegroundTarget()
|
||||
BF_EXPORT void BF_CALLTYPE Debugger_ForegroundTarget(int altProcessId)
|
||||
{
|
||||
gDebugger->ForegroundTarget();
|
||||
gDebugger->ForegroundTarget(altProcessId);
|
||||
|
||||
//BOOL worked = EnumThreadWindows(gDebugger->mProcessInfo.dwThreadId, WdEnumWindowsProc, 0);
|
||||
//BF_ASSERT(worked);
|
||||
|
@ -1378,6 +1378,11 @@ BF_EXPORT const char* BF_CALLTYPE Debugger_GetProcessInfo()
|
|||
return outString.c_str();
|
||||
}
|
||||
|
||||
BF_EXPORT int BF_CALLTYPE Debugger_GetProcessId()
|
||||
{
|
||||
return gDebugger->GetProcessId();
|
||||
}
|
||||
|
||||
BF_EXPORT const char* BF_CALLTYPE Debugger_GetThreadInfo()
|
||||
{
|
||||
String& outString = *gTLStrReturn.Get();
|
||||
|
|
|
@ -285,7 +285,7 @@ public:
|
|||
virtual String GetDbgAllocInfo() = 0;
|
||||
virtual void Update() = 0;
|
||||
virtual void ContinueDebugEvent() = 0;
|
||||
virtual void ForegroundTarget() = 0;
|
||||
virtual void ForegroundTarget(int altProcessId) = 0;
|
||||
virtual Breakpoint* CreateBreakpoint(const StringImpl& fileName, int lineNum, int wantColumn, int instrOffset) = 0;
|
||||
virtual Breakpoint* CreateMemoryBreakpoint(intptr addr, int byteCount) = 0;
|
||||
virtual Breakpoint* CreateSymbolBreakpoint(const StringImpl& symbolName) = 0;
|
||||
|
@ -320,6 +320,7 @@ public:
|
|||
virtual String GetAutoLocals(int callStackIdx, bool showRegs) = 0;
|
||||
virtual String CompactChildExpression(const StringImpl& expr, const StringImpl& parentExpr, int callStackIdx) = 0;
|
||||
virtual String GetProcessInfo() = 0;
|
||||
virtual int GetProcessId() = 0;
|
||||
virtual String GetThreadInfo() = 0;
|
||||
virtual void SetActiveThread(int threadId) = 0;
|
||||
virtual int GetActiveThread() = 0;
|
||||
|
|
|
@ -3055,6 +3055,8 @@ void WinDebugger::ContinueDebugEvent()
|
|||
|
||||
static BOOL CALLBACK WdEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
int wantProcessId = lParam;
|
||||
|
||||
HWND owner = GetWindow(hwnd, GW_OWNER);
|
||||
if (!IsWindowVisible(hwnd))
|
||||
return TRUE;
|
||||
|
@ -3062,7 +3064,7 @@ static BOOL CALLBACK WdEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
|||
DWORD processId = 0;
|
||||
DWORD threadId = GetWindowThreadProcessId(hwnd, &processId);
|
||||
|
||||
if (processId != ((WinDebugger*)gDebugger)->mProcessInfo.dwProcessId)
|
||||
if (processId != wantProcessId)
|
||||
return TRUE;
|
||||
|
||||
while (true)
|
||||
|
@ -3080,8 +3082,12 @@ static BOOL CALLBACK WdEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void WinDebugger::ForegroundTarget()
|
||||
void WinDebugger::ForegroundTarget(int altProcessId)
|
||||
{
|
||||
int wantProcessId = altProcessId;
|
||||
if (wantProcessId == 0)
|
||||
wantProcessId = ((WinDebugger*)gDebugger)->mProcessInfo.dwProcessId;
|
||||
|
||||
HWND hwnd = ::GetForegroundWindow();
|
||||
if (hwnd != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
|
@ -3090,8 +3096,8 @@ void WinDebugger::ForegroundTarget()
|
|||
if (processId == ((WinDebugger*)gDebugger)->mProcessInfo.dwProcessId)
|
||||
return; // Already good
|
||||
}
|
||||
|
||||
EnumWindows(WdEnumWindowsProc, 0);
|
||||
|
||||
EnumWindows(WdEnumWindowsProc, wantProcessId);
|
||||
}
|
||||
|
||||
static int gFindLineDataAt = 0;
|
||||
|
@ -10977,6 +10983,14 @@ String WinDebugger::GetProcessInfo()
|
|||
return retStr;
|
||||
}
|
||||
|
||||
int WinDebugger::GetProcessId()
|
||||
{
|
||||
AutoCrit autoCrit(mDebugManager->mCritSect);
|
||||
if (!mThreadList.IsEmpty())
|
||||
return mThreadList[0]->mProcessId;
|
||||
return mDbgProcessId;
|
||||
}
|
||||
|
||||
String WinDebugger::GetThreadInfo()
|
||||
{
|
||||
AutoCrit autoCrit(mDebugManager->mCritSect);
|
||||
|
|
|
@ -598,7 +598,7 @@ public:
|
|||
virtual String GetDbgAllocInfo() override;
|
||||
virtual void Update() override;
|
||||
virtual void ContinueDebugEvent() override;
|
||||
virtual void ForegroundTarget() override;
|
||||
virtual void ForegroundTarget(int altProcessId) override;
|
||||
virtual Breakpoint* CreateBreakpoint(const StringImpl& fileName, int lineNum, int wantColumn, int instrOffset) override;
|
||||
virtual Breakpoint* CreateMemoryBreakpoint(intptr addr, int byteCount) override;
|
||||
virtual Breakpoint* CreateSymbolBreakpoint(const StringImpl& symbolName) override;
|
||||
|
@ -630,6 +630,7 @@ public:
|
|||
virtual String GetAutoLocals(int callStackIdx, bool showRegs) override;
|
||||
virtual String CompactChildExpression(const StringImpl& expr, const StringImpl& parentExpr, int callStackIdx) override;
|
||||
virtual String GetProcessInfo() override;
|
||||
virtual int GetProcessId() override;
|
||||
virtual String GetThreadInfo() override;
|
||||
virtual void SetActiveThread(int threadId) override;
|
||||
virtual int GetActiveThread() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue