Page MenuHomeFreeBSD

D19705.id55442.diff
No OneTemporary

D19705.id55442.diff

Index: contrib/elftoolchain/libdwarf/libdwarf_lineno.c
===================================================================
--- contrib/elftoolchain/libdwarf/libdwarf_lineno.c
+++ contrib/elftoolchain/libdwarf/libdwarf_lineno.c
@@ -33,9 +33,10 @@
Dwarf_Error *error, Dwarf_Debug dbg)
{
Dwarf_LineFile lf;
- const char *dirname;
+ FILE *filepath;
+ const char *incdir;
uint8_t *src;
- int slen;
+ size_t slen;
src = *p;
@@ -54,20 +55,33 @@
return (DW_DLE_DIR_INDEX_BAD);
}
- /* Make full pathname if need. */
+ /* Make a full pathname if needed. */
if (*lf->lf_fname != '/') {
- dirname = compdir;
+ filepath = open_memstream(&lf->lf_fullpath, &slen);
+ if (filepath == NULL) {
+ free(lf);
+ DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
+ return (DW_DLE_MEMORY);
+ }
+
if (lf->lf_dirndx > 0)
- dirname = li->li_incdirs[lf->lf_dirndx - 1];
- if (dirname != NULL) {
- slen = strlen(dirname) + strlen(lf->lf_fname) + 2;
- if ((lf->lf_fullpath = malloc(slen)) == NULL) {
- free(lf);
- DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
- return (DW_DLE_MEMORY);
- }
- snprintf(lf->lf_fullpath, slen, "%s/%s", dirname,
- lf->lf_fname);
+ incdir = li->li_incdirs[lf->lf_dirndx - 1];
+ else
+ incdir = NULL;
+
+ /*
+ * Prepend the compilation directory if the directory table
+ * entry is relative.
+ */
+ if (incdir == NULL || *incdir != '/')
+ fprintf(filepath, "%s/", compdir);
+ if (incdir != NULL)
+ fprintf(filepath, "%s/", incdir);
+ fprintf(filepath, "%s", lf->lf_fname);
+ if (fclose(filepath) != 0) {
+ free(lf);
+ DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
+ return (DW_DLE_MEMORY);
}
}
Index: sys/conf/kern.post.mk
===================================================================
--- sys/conf/kern.post.mk
+++ sys/conf/kern.post.mk
@@ -358,11 +358,6 @@
.endif
.endfor
-.if defined(_MAP_DEBUG_PREFIX)
-# Ensure that DWARF info contains a full path for auto-generated headers.
-CFLAGS+= -fdebug-prefix-map=.=${.OBJDIR}
-.endif
-
${_ILINKS}:
@case ${.TARGET} in \
machine) \
Index: sys/conf/kmod.mk
===================================================================
--- sys/conf/kmod.mk
+++ sys/conf/kmod.mk
@@ -302,11 +302,6 @@
.endif
.endfor
-.if defined(_MAP_DEBUG_PREFIX)
-# Ensure that DWARF info contains a full path for auto-generated headers.
-CFLAGS+= -fdebug-prefix-map=.=${.OBJDIR}
-.endif
-
.NOPATH: ${_ILINKS}
${_ILINKS}:

File Metadata

Mime Type
text/plain
Expires
Tue, Jun 16, 12:04 PM (12 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33986971
Default Alt Text
D19705.id55442.diff (2 KB)

Event Timeline