From f951022b7deef1000f7b79081634ca6eca5c44b8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Mari Date: Mon, 18 Mar 2019 23:38:11 -0400 Subject: [PATCH] Fix crash with potential missing DWARF structure tag's type name --- docs/vj_HistoryNotes.txt | 3 ++- src/debugger/DWARFManager.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index 29d28f7..d3e65c2 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -81,6 +81,7 @@ Git commit: TBD -- Added a window to display my own directory and his files list 44) Debugger sources code clean-up 45) Fix a crash when emulator, in non-debugger mode, opens the breakpoint UIs at launch +46) Fix crash with potential missing DWARF structure tag's type name Release 3 (13th November 2017) ------------------------------ @@ -225,7 +226,7 @@ Project information 3) libelf 0.8.13 library 64bits for VS 2015/2017 4) libdwarf 1.41 library 64bits for VS 2015, cygwin64 and Msys2/MinGW64 5) QT 5.5.1 library 64bits for VS 2015 -6) QT 5.9.1 library 64bits for VS 2017 +6) QT 5.12.0 library 64bits for VS 2017 7) Zlib 1.2.8 library 64bits for VS 2015 8) Zlib 1.2.11 library 64bits for VS 2017 9) SDL 1.2.15 library 64bits for VS 2015/2017 diff --git a/src/debugger/DWARFManager.cpp b/src/debugger/DWARFManager.cpp index 4ff8abb..acfe387 100644 --- a/src/debugger/DWARFManager.cpp +++ b/src/debugger/DWARFManager.cpp @@ -28,7 +28,7 @@ // Definitions for debugging -//#define DEBUG_NumCU 0x9 // CU number to debug or undefine it +//#define DEBUG_NumCU 0xf // CU number to debug or undefine it //#define DEBUG_VariableName "sound_death" // Variable name to look for or undefine it //#define DEBUG_TypeName "Cbuf_Execute" // Type name to look for or undefine it //#define DEBUG_TypeDef DW_TAG_typedef // Type def to look for or undefine it (not supported) @@ -1188,7 +1188,10 @@ void DWARFManager_InitInfosVariable(VariablesStruct *PtrVariables) PtrVariables->TypeTag |= TypeTag_structure; if (!(PtrVariables->TypeTag & TypeTag_typedef)) { - strcat(PtrVariables->PtrTypeName, PtrCU[NbCU].PtrTypes[j].PtrName); + if (PtrCU[NbCU].PtrTypes[j].PtrName) + { + strcat(PtrVariables->PtrTypeName, PtrCU[NbCU].PtrTypes[j].PtrName); + } } if ((TypeOffset = PtrCU[NbCU].PtrTypes[j].TypeOffset)) { -- 2.20.1