www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4486] New: CodeView debug info should contain absolute path names

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4486

           Summary: CodeView debug info should contain absolute path names
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: r.sagitario gmx.de



PDT ---
As of DMD 2.047, the CodeView debug information contains file names as
specified on the command line, i.e. most of the time relative paths.
According to the omf-specification, the full path should be specified in the
THEADR record. This makes it much easier for debuggers to find the correct
source modules and can avoid ambiguities.

Here's a patch (filespec.c only contains an unusable version of making a path
absolute):

Index: cgobj.c
===================================================================
--- cgobj.c    (revision 576)
+++ cgobj.c    (working copy)
   -17,6 +17,7   
 #include        <stdlib.h>
 #include        <malloc.h>
 #include        <ctype.h>
+#include        <direct.h>

 #include        "filespec.h"

   -1249,7 +1250,20   
 void obj_theadr(const char *modname)
 {   char *theadr;
     int i;
+    char absname[260];

+    if(modname[0] != '\\' && modname[0] != '/' && !(modname[0] && modname[1]
== ':'))
+    {
+        if(getcwd(absname, sizeof(absname)))
+        {
+            int len = strlen(absname);
+            if(absname[len - 1] != '\\' && absname[len - 1] != '/')
+                absname[len++] = '\\';
+            strcpy(absname + len, modname);
+            modname = absname;
+        }
+    }
+
     //printf("obj_theadr(%s)\n", modname);
     theadr = (char *)alloca(ONS_OHD + strlen(modname));
     i = obj_namestring(theadr,modname);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 19 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4486


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



18:34:59 PST ---
https://github.com/D-Programming-Language/dmd/commit/a73564e2a477928694cbe88d724e8b8780040455

https://github.com/D-Programming-Language/dmd/commit/7ea404b43d928966e151d9bdce57f908a433dcb5

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 07 2011