4486 – CodeView debug info should contain absolute path names

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4486 - CodeView debug info should contain absolute path names
Summary: CodeView debug info should contain absolute path names
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
Reported: 2010年07月19日 11:22 UTC by Rainer Schuetze
Modified: 2015年06月09日 05:12 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Schuetze 2010年07月19日 11:22:00 UTC
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);


AltStyle によって変換されたページ (->オリジナル) /