Shorten file path in backtraces

The build dir isn't relevant, only the source path starting with neo/ is

Also removed instances of nullptr
This commit is contained in:
Daniel Gibson 2022-01-08 16:57:32 +01:00
parent 3e039ca898
commit 8cb4843022
3 changed files with 7 additions and 2 deletions

View file

@ -450,6 +450,11 @@ static int bt_pcinfo_callback( void *data, uintptr_t pc, const char *filename, i
if (name != NULL) {
function = name;
}
const char* fileNameNeo = strstr(filename, "/neo/");
if (fileNameNeo != NULL) {
filename = fileNameNeo+1; // I want "neo/bla/blub.cpp:42"
}
printf(" %zu %s:%d %s\n", pc, filename, lineno, function);
free(name);
}

View file

@ -677,7 +677,7 @@ void *Sys_DLL_GetProcAddress( uintptr_t dllHandle, const char *procName ) {
if (!adr)
{
DWORD e = GetLastError();
LPVOID msgBuf = nullptr;
LPVOID msgBuf = NULL;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |

View file

@ -97,7 +97,7 @@ private:
void UpdateTitle ( void );
void UpdateCallstack ( void );
void UpdateRecentFiles ( void );
bool OpenScript ( const char* filename, int lineNumber = -1, idProgram* program = nullptr );
bool OpenScript ( const char* filename, int lineNumber = -1, idProgram* program = NULL );
void EnableWindows ( bool state );
int GetSelectedText ( idStr& text );