2007-04-12 16:58:31 +02:00
|
|
|
Include compilation directory in source file list if used.
|
|
|
|
|
2017-01-19 16:41:55 +01:00
|
|
|
--- ./tools/debugedit.c.orig 2017-01-19 12:56:26.948739541 +0000
|
|
|
|
+++ ./tools/debugedit.c 2017-01-19 12:56:33.876719778 +0000
|
|
|
|
@@ -512,6 +512,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
|
2009-08-28 15:54:03 +02:00
|
|
|
uint32_t value, dirt_cnt;
|
2017-01-19 16:41:55 +01:00
|
|
|
size_t comp_dir_len = !comp_dir ? 0 : strlen (comp_dir);
|
2007-04-12 16:58:31 +02:00
|
|
|
size_t abs_file_cnt = 0, abs_dir_cnt = 0;
|
|
|
|
+ int comp_dir_used = 0;
|
|
|
|
|
|
|
|
if (phase != 0)
|
|
|
|
return 0;
|
2017-01-19 16:41:55 +01:00
|
|
|
@@ -624,6 +625,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
|
2008-09-12 20:37:28 +02:00
|
|
|
memcpy (p, dirt[value], dir_len);
|
|
|
|
p[dir_len] = '/';
|
|
|
|
memcpy (p + dir_len + 1, file, file_len + 1);
|
2007-04-12 16:58:31 +02:00
|
|
|
+ comp_dir_used = 1;
|
2008-09-12 20:37:28 +02:00
|
|
|
}
|
|
|
|
canonicalize_path (s, s);
|
|
|
|
if (list_file_fd != -1)
|
2017-01-19 16:41:55 +01:00
|
|
|
@@ -657,6 +659,30 @@ edit_dwarf2_line (DSO *dso, uint32_t off
|
2007-04-12 16:58:31 +02:00
|
|
|
}
|
|
|
|
++ptr;
|
2011-05-16 18:07:44 +02:00
|
|
|
|
2007-04-12 16:58:31 +02:00
|
|
|
+ if (comp_dir_used && list_file_fd != -1
|
|
|
|
+ && (base_dir == NULL || has_prefix (comp_dir, base_dir)))
|
|
|
|
+ {
|
|
|
|
+ char *p;
|
|
|
|
+ size_t size;
|
|
|
|
+ ssize_t ret;
|
|
|
|
+
|
|
|
|
+ size = comp_dir_len + 1;
|
|
|
|
+ p = comp_dir;
|
|
|
|
+ if (base_dir)
|
|
|
|
+ {
|
|
|
|
+ p += strlen (base_dir);
|
|
|
|
+ size -= strlen (base_dir);
|
|
|
|
+ }
|
|
|
|
+ while (size > 0)
|
|
|
|
+ {
|
|
|
|
+ ret = write (list_file_fd, p, size);
|
|
|
|
+ if (ret == -1)
|
|
|
|
+ break;
|
|
|
|
+ size -= ret;
|
|
|
|
+ p += ret;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (dest_dir)
|
|
|
|
{
|
|
|
|
unsigned char *srcptr, *buf = NULL;
|