diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-06-27 15:15:46 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-06-27 15:15:46 +0300 |
commit | c1a5eb371270c2dee3e335ab3589e90fdc0195c7 (patch) | |
tree | 92e2418bbbb6581f510a9635a8eeec4f15fd00eb | |
parent | b55b066e9c30ec4962434fa73d701083fb4d5364 (diff) | |
download | rpm-c1a5eb371270c2dee3e335ab3589e90fdc0195c7.tar.gz rpm-c1a5eb371270c2dee3e335ab3589e90fdc0195c7.tar.bz2 rpm-c1a5eb371270c2dee3e335ab3589e90fdc0195c7.zip |
debugedit: Include empty CU current directories (rhbz#444310)
- patch from Jan Kratochvil
-rw-r--r-- | tools/debugedit.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/debugedit.c b/tools/debugedit.c index 27e669101..5532cb63e 100644 --- a/tools/debugedit.c +++ b/tools/debugedit.c @@ -892,6 +892,34 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase) break; } } + + /* Ensure the CU current directory will exist even if only empty. Source + filenames possibly located in its parent directories refer relatively to + it and the debugger (GDB) cannot safely optimize out the missing + CU current dir subdirectories. */ + if (comp_dir && list_file_fd != -1) + { + char *p; + size_t size; + + if (base_dir && has_prefix (comp_dir, base_dir)) + p = comp_dir + strlen (base_dir); + else if (dest_dir && has_prefix (comp_dir, dest_dir)) + p = comp_dir + strlen (dest_dir); + else + p = comp_dir; + + size = strlen (p) + 1; + while (size > 0) + { + ssize_t ret = write (list_file_fd, p, size); + if (ret == -1) + break; + size -= ret; + p += ret; + } + } + if (found_list_offs && comp_dir) edit_dwarf2_line (dso, list_offs, comp_dir, phase); |