Add plugin version to debug trace information (bug 3649, r=joropito)
Former-commit-id: 9bfdce37387378597a5fe73a78dbb495d70add19
This commit is contained in:
parent
a1306b8d96
commit
525c45e9f5
|
@ -562,8 +562,9 @@ void Debugger::DisplayTrace(const char *message)
|
|||
FormatError(buffer, sizeof(buffer)-1);
|
||||
|
||||
const char *filename = _GetFilename();
|
||||
const char *version = _GetVersion();
|
||||
|
||||
AMXXLOG_Error("[AMXX] Displaying debug trace (plugin \"%s\")", filename);
|
||||
AMXXLOG_Error("[AMXX] Displaying debug trace (plugin \"%s\", version \"%s\")", filename, version);
|
||||
AMXXLOG_Error("[AMXX] %s", buffer);
|
||||
|
||||
int count = 0;
|
||||
|
@ -605,6 +606,23 @@ const char *Debugger::_GetFilename()
|
|||
return m_FileName.c_str();
|
||||
}
|
||||
|
||||
const char *Debugger::_GetVersion()
|
||||
{
|
||||
if (m_Version.size() < 1)
|
||||
{
|
||||
const char *version = "";
|
||||
CPluginMngr::CPlugin *pl = g_plugins.findPluginFast(m_pAmx);
|
||||
if (pl)
|
||||
{
|
||||
version = pl->getVersion();
|
||||
}
|
||||
|
||||
m_Version.assign(version);
|
||||
}
|
||||
|
||||
return m_Version.c_str();
|
||||
}
|
||||
|
||||
void Debugger::FmtGenericMsg(AMX *amx, int error, char buffer[], size_t maxLength)
|
||||
{
|
||||
const char *filename = "";
|
||||
|
|
|
@ -138,6 +138,7 @@ private:
|
|||
cell _CipAsVa(cell cip);
|
||||
|
||||
const char *_GetFilename();
|
||||
const char *_GetVersion();
|
||||
public:
|
||||
AMX *m_pAmx;
|
||||
AMX_DBG *m_pAmxDbg;
|
||||
|
@ -145,6 +146,7 @@ public:
|
|||
int m_Top;
|
||||
cell *m_pOpcodeList;
|
||||
String m_FileName;
|
||||
String m_Version;
|
||||
|
||||
CVector<Tracer *> m_pCalls;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user