From: Jean-Paul Mari Date: Sun, 23 Sep 2018 21:55:50 +0000 (-0400) Subject: DWARF source code directory path clean-up X-Git-Tag: v2.1.3-R4~28 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/1155c5360a7ecc2861a009ec69bddba1dfc3b3c3 DWARF source code directory path clean-up --- diff --git a/src/debugger/DWARFManager.cpp b/src/debugger/DWARFManager.cpp index b064bee..bba80ea 100644 --- a/src/debugger/DWARFManager.cpp +++ b/src/debugger/DWARFManager.cpp @@ -284,7 +284,7 @@ void DWARFManager_InitDMI(void) FILE *SrcFile; size_t i, j, k; char *return_string; - char *Ptr; + char *Ptr, *Ptr1; // Initialisation for the Compilation Units table NbCU = 0; @@ -419,6 +419,21 @@ void DWARFManager_InitDMI(void) Ptr++; } + // Directory path clean-up +#if defined(_WIN32) + while ((Ptr1 = Ptr = strstr(PtrCU[NbCU].PtrFullFilename, "\\..\\"))) +#else + while ((Ptr1 = Ptr = strstr(PtrCU[NbCU].PtrFullFilename, "/../"))) +#endif + { +#if defined(_WIN32) + while (*--Ptr1 != '\\'); +#else + while (*--Ptr1 != '/'); +#endif + strcpy((Ptr1 + 1), (Ptr + 4)); + } + // Read the file as text #ifndef __CYGWIN__ if (!fopen_s(&SrcFile, PtrCU[NbCU].PtrFullFilename, "rt"))