Skip to content

Commit

Permalink
Do not use PDB file name in WinDbg TTD. Fix Vector35#505
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed Aug 3, 2023
1 parent ff152dc commit 037f403
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions core/adapters/dbgengadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ DebugBreakpoint DbgEngAdapter::AddBreakpoint(const ModuleNameAndOffset& address,
auto moduleToUse = address.module;
if (DebugModule::IsSameBaseModule(moduleToUse, m_originalFileName))
{
if (!m_pdbFileName.empty())
if (m_usePDBFileName && (!m_pdbFileName.empty()))
moduleToUse = m_pdbFileName;
}

Expand Down Expand Up @@ -1057,8 +1057,11 @@ std::vector<DebugModule> DbgEngAdapter::GetModuleList()
!= S_OK)
continue;

if ((!m_pdbFileName.empty()) && DebugModule::IsSameBaseModule(short_name, m_pdbFileName))
strcpy_s(name, 1024, m_originalFileName.c_str());
if (m_usePDBFileName &&(!m_pdbFileName.empty()) &&
DebugModule::IsSameBaseModule(short_name, m_pdbFileName))
{
strcpy_s(name, 1024, m_originalFileName.c_str());
}

modules.emplace_back(
name, short_name, parameters.Base, parameters.Size, !(parameters.Flags & DEBUG_MODULE_UNLOADED));
Expand Down
1 change: 1 addition & 0 deletions core/adapters/dbgengadapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ namespace BinaryNinjaDebugger {
bool m_aboutToBeKilled = false;

std::string m_pdbFileName {};
bool m_usePDBFileName = false;

public:
inline static ProcessCallbackInformation ProcessCallbackInfo {};
Expand Down
2 changes: 1 addition & 1 deletion core/adapters/dbgengttdadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace std;

DbgEngTTDAdapter::DbgEngTTDAdapter(BinaryView* data) : DbgEngAdapter(data)
{

m_usePDBFileName = false;
}


Expand Down

0 comments on commit 037f403

Please sign in to comment.