mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-26 06:45:37 +03:00
Add plugin version to debug trace information (bug 3649, r=joropito)
Former-commit-id: 9bfdce3738
This commit is contained in:
parent
a1306b8d96
commit
525c45e9f5
@ -562,8 +562,9 @@ void Debugger::DisplayTrace(const char *message)
|
|||||||
FormatError(buffer, sizeof(buffer)-1);
|
FormatError(buffer, sizeof(buffer)-1);
|
||||||
|
|
||||||
const char *filename = _GetFilename();
|
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);
|
AMXXLOG_Error("[AMXX] %s", buffer);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@ -605,6 +606,23 @@ const char *Debugger::_GetFilename()
|
|||||||
return m_FileName.c_str();
|
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)
|
void Debugger::FmtGenericMsg(AMX *amx, int error, char buffer[], size_t maxLength)
|
||||||
{
|
{
|
||||||
const char *filename = "";
|
const char *filename = "";
|
||||||
|
@ -138,6 +138,7 @@ private:
|
|||||||
cell _CipAsVa(cell cip);
|
cell _CipAsVa(cell cip);
|
||||||
|
|
||||||
const char *_GetFilename();
|
const char *_GetFilename();
|
||||||
|
const char *_GetVersion();
|
||||||
public:
|
public:
|
||||||
AMX *m_pAmx;
|
AMX *m_pAmx;
|
||||||
AMX_DBG *m_pAmxDbg;
|
AMX_DBG *m_pAmxDbg;
|
||||||
@ -145,6 +146,7 @@ public:
|
|||||||
int m_Top;
|
int m_Top;
|
||||||
cell *m_pOpcodeList;
|
cell *m_pOpcodeList;
|
||||||
String m_FileName;
|
String m_FileName;
|
||||||
|
String m_Version;
|
||||||
|
|
||||||
CVector<Tracer *> m_pCalls;
|
CVector<Tracer *> m_pCalls;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user