diff options
author | Joseph Myers <joseph@codesourcery.com> | 2007-08-24 21:49:55 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2007-08-24 21:49:55 +0000 |
commit | 3d6b762c68c6e19bdf387c0f1db7773fd22aab9a (patch) | |
tree | aaed967f4fb27d39d98495f58b5aa56c5d102381 /gas/dwarf2dbg.c | |
parent | 534a31f6908dfec77b02051240630059e3ad7520 (diff) | |
download | gdb-3d6b762c68c6e19bdf387c0f1db7773fd22aab9a.zip gdb-3d6b762c68c6e19bdf387c0f1db7773fd22aab9a.tar.gz gdb-3d6b762c68c6e19bdf387c0f1db7773fd22aab9a.tar.bz2 |
2007-08-24 Joseph Myers <joseph@codesourcery.com>
Paul Brook <paul@codesourcery.com>
* remap.c: New.
* as.h (remap_debug_filename, add_debug_prefix_map): Declare.
* as.c (show_usage): Document --debug-prefix-map option.
(parse_args): Handle --debug-prefix-map.
* dwarf2dbg.c (out_file_list, out_debug_info): Remap debug paths.
* stabs.c (stabs_generate_asm_file): Remap debug paths.
* Makefile.am (GAS_CFILES): Add remap.c
(GENERIC_OBJS): Add remap.o.
Regenerate dependencies.
* Makefile.in: Regenerate.
* doc/as.texinfo (--debug-prefix-map): Document.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r-- | gas/dwarf2dbg.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 105a834..93b5f48 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1224,15 +1224,17 @@ static void out_file_list (void) { size_t size; + const char *dir; char *cp; unsigned int i; /* Emit directory list. */ for (i = 1; i < dirs_in_use; ++i) { - size = strlen (dirs[i]) + 1; + dir = remap_debug_filename (dirs[i]); + size = strlen (dir) + 1; cp = frag_more (size); - memcpy (cp, dirs[i], size); + memcpy (cp, dir, size); } /* Terminate it. */ out_byte ('\0'); @@ -1514,7 +1516,8 @@ static void out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg) { char producer[128]; - char *comp_dir; + const char *comp_dir; + const char *dirname; expressionS expr; symbolS *info_start; symbolS *info_end; @@ -1604,9 +1607,10 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg) abort (); if (files[1].dir) { - len = strlen (dirs[files[1].dir]); + dirname = remap_debug_filename (dirs[files[1].dir]); + len = strlen (dirname); p = frag_more (len + 1); - memcpy (p, dirs[files[1].dir], len); + memcpy (p, dirname, len); INSERT_DIR_SEPARATOR (p, len); } len = strlen (files[1].filename) + 1; @@ -1614,7 +1618,7 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg) memcpy (p, files[1].filename, len); /* DW_AT_comp_dir */ - comp_dir = getpwd (); + comp_dir = remap_debug_filename (getpwd ()); len = strlen (comp_dir) + 1; p = frag_more (len); memcpy (p, comp_dir, len); |