Skip to content

Commit

Permalink
debugger cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Sep 1, 2023
1 parent d61f204 commit 04905ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
18 changes: 1 addition & 17 deletions src/DarkId.Papyrus.DebugServer/BreakpointManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ namespace DarkId::Papyrus::DebugServer
return dap::Error("Could not find PEX data for script %s", scriptName);
}
auto ref = GetSourceReference(source);
// don't bother setting this
//source.sourceReference = dap::integer(ref);

#if _DEBUG_DUMP_PEX
std::string dir = logger::log_directory().value_or("").string();
if (dir.empty()) {
logger::error("Failed to open log directory, PEX will not be dumped");
}
else if (!LoadAndDumpPexData(scriptName.c_str(), dir)) {
logger::error("Could not save PEX dump for {}"sv, scriptName);
}
#endif
bool hasDebugInfo = binary->getDebugInfo().getFunctionInfos().size() > 0;
if (!hasDebugInfo) {

Expand Down Expand Up @@ -96,11 +84,7 @@ namespace DarkId::Papyrus::DebugServer
if (!breakpointLines.empty())
{
uint32_t currentLine;
#ifdef SKYRIM
bool success = func->TranslateIPToLineNumber(tasklet->topFrame->instructionPointer, currentLine);
#else // FAllOUT
bool success = func->TranslateIPToLineNumber(tasklet->topFrame->ip, currentLine);
#endif
bool success = func->TranslateIPToLineNumber(tasklet->topFrame->STACK_FRAME_IP, currentLine);
auto found = breakpointLines.find(currentLine);
return success && found != breakpointLines.end();
}
Expand Down
6 changes: 1 addition & 5 deletions src/DarkId.Papyrus.DebugServer/StackFrameStateNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ namespace DarkId::Papyrus::DebugServer
if (pexCache->GetSourceData(ScriptName.c_str(), source))
{
stackFrame.source = source;
#if SKYRIM
uint32_t ip = m_stackFrame->instructionPointer;
#else // FALLOUT
uint32_t ip = m_stackFrame->ip;
#endif
uint32_t ip = m_stackFrame->STACK_FRAME_IP;
uint32_t lineNumber;
if (m_stackFrame->owningFunction->TranslateIPToLineNumber(ip, lineNumber))
{
Expand Down
2 changes: 2 additions & 0 deletions src/DarkId.Papyrus.DebugServer/pdsPCH.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace DarkId::Papyrus::DebugServer
namespace XSE = SKSE;
namespace logger = SKSE::log;
}
#define STACK_FRAME_IP instructionPointer
namespace XSE = SKSE;

#elif FALLOUT
Expand All @@ -36,6 +37,7 @@ namespace DarkId::Papyrus::DebugServer
namespace XSE = F4SE;
namespace logger = F4SE::log;
}
#define STACK_FRAME_IP ip
namespace XSE = F4SE;
#endif

Expand Down

0 comments on commit 04905ea

Please sign in to comment.