|
Panu Matilainen |
aca433 |
--- rpm-4.9.0/tools/debugedit.c 2010-12-03 13:11:57.000000000 +0100
|
|
Panu Matilainen |
aca433 |
+++ rpm-4.9.0/tools/debugedit.c.jj 2011-05-25 18:49:53.151936963 +0200
|
|
Panu Matilainen |
aca433 |
@@ -1,4 +1,4 @@
|
|
Panu Matilainen |
aca433 |
-/* Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010 Red Hat, Inc.
|
|
Panu Matilainen |
aca433 |
+/* Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010, 2011 Red Hat, Inc.
|
|
Panu Matilainen |
aca433 |
Written by Alexander Larsson <alexl@redhat.com>, 2002
|
|
Panu Matilainen |
aca433 |
Based on code by Jakub Jelinek <jakub@redhat.com>, 2001.
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
@@ -44,6 +44,10 @@
|
|
Panu Matilainen |
aca433 |
#include "tools/hashtab.h"
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
#define DW_TAG_partial_unit 0x3c
|
|
Panu Matilainen |
aca433 |
+#define DW_FORM_sec_offset 0x17
|
|
Panu Matilainen |
aca433 |
+#define DW_FORM_exprloc 0x18
|
|
Panu Matilainen |
aca433 |
+#define DW_FORM_flag_present 0x19
|
|
Panu Matilainen |
aca433 |
+#define DW_FORM_ref_sig8 0x20
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
char *base_dir = NULL;
|
|
Panu Matilainen |
aca433 |
char *dest_dir = NULL;
|
|
Panu Matilainen |
aca433 |
@@ -220,6 +224,7 @@ static struct
|
|
Panu Matilainen |
aca433 |
#define DEBUG_STR 8
|
|
Panu Matilainen |
aca433 |
#define DEBUG_FRAME 9
|
|
Panu Matilainen |
aca433 |
#define DEBUG_RANGES 10
|
|
Panu Matilainen |
aca433 |
+#define DEBUG_TYPES 11
|
|
Panu Matilainen |
aca433 |
{ ".debug_info", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
{ ".debug_abbrev", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
{ ".debug_line", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
@@ -231,6 +236,7 @@ static struct
|
|
Panu Matilainen |
aca433 |
{ ".debug_str", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
{ ".debug_frame", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
{ ".debug_ranges", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
+ { ".debug_types", NULL, NULL, 0, 0, 0 },
|
|
Panu Matilainen |
aca433 |
{ NULL, NULL, NULL, 0, 0, 0 }
|
|
Panu Matilainen |
aca433 |
};
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
@@ -323,7 +329,8 @@ no_memory:
|
|
Panu Matilainen |
aca433 |
goto no_memory;
|
|
Panu Matilainen |
aca433 |
}
|
|
Panu Matilainen |
aca433 |
form = read_uleb128 (ptr);
|
|
Panu Matilainen |
aca433 |
- if (form == 2 || form > DW_FORM_indirect)
|
|
Panu Matilainen |
aca433 |
+ if (form == 2
|
|
Panu Matilainen |
aca433 |
+ || (form > DW_FORM_flag_present && form != DW_FORM_ref_sig8))
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
error (0, 0, "%s: Unknown DWARF DW_FORM_%d", dso->filename, form);
|
|
Panu Matilainen |
aca433 |
htab_delete (h);
|
|
Panu Matilainen |
aca433 |
@@ -352,7 +359,6 @@ static char *
|
|
Panu Matilainen |
aca433 |
canonicalize_path (const char *s, char *d)
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
char *rv = d;
|
|
Panu Matilainen |
aca433 |
- const char *sroot;
|
|
Panu Matilainen |
aca433 |
char *droot;
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
if (IS_DIR_SEPARATOR (*s))
|
|
Panu Matilainen |
aca433 |
@@ -368,7 +374,6 @@ canonicalize_path (const char *s, char *
|
|
Panu Matilainen |
aca433 |
s++;
|
|
Panu Matilainen |
aca433 |
}
|
|
Panu Matilainen |
aca433 |
droot = d;
|
|
Panu Matilainen |
aca433 |
- sroot = s;
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
while (*s)
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
@@ -495,7 +500,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
|
|
Panu Matilainen |
aca433 |
}
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
value = read_16 (ptr);
|
|
Panu Matilainen |
aca433 |
- if (value != 2 && value != 3)
|
|
Panu Matilainen |
aca433 |
+ if (value != 2 && value != 3 && value != 4)
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
error (0, 0, "%s: DWARF version %d unhandled", dso->filename,
|
|
Panu Matilainen |
aca433 |
value);
|
|
Panu Matilainen |
aca433 |
@@ -511,8 +516,8 @@ edit_dwarf2_line (DSO *dso, uint32_t off
|
|
Panu Matilainen |
aca433 |
return 1;
|
|
Panu Matilainen |
aca433 |
}
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
- opcode_base = ptr[4];
|
|
Panu Matilainen |
aca433 |
- ptr = dir = ptr + 4 + opcode_base;
|
|
Panu Matilainen |
aca433 |
+ opcode_base = ptr[4 + (value >= 4)];
|
|
Panu Matilainen |
aca433 |
+ ptr = dir = ptr + 4 + (value >= 4) + opcode_base;
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
/* dir table: */
|
|
Panu Matilainen |
aca433 |
value = 1;
|
|
Panu Matilainen |
aca433 |
@@ -739,7 +744,8 @@ edit_attributes (DSO *dso, unsigned char
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
if (t->attr[i].attr == DW_AT_stmt_list)
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
- if (form == DW_FORM_data4)
|
|
Panu Matilainen |
aca433 |
+ if (form == DW_FORM_data4
|
|
Panu Matilainen |
aca433 |
+ || form == DW_FORM_sec_offset)
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
list_offs = do_read_32_relocated (ptr);
|
|
Panu Matilainen |
aca433 |
found_list_offs = 1;
|
|
Panu Matilainen |
aca433 |
@@ -841,6 +847,8 @@ edit_attributes (DSO *dso, unsigned char
|
|
Panu Matilainen |
aca433 |
else
|
|
Panu Matilainen |
aca433 |
ptr += 4;
|
|
Panu Matilainen |
aca433 |
break;
|
|
Panu Matilainen |
aca433 |
+ case DW_FORM_flag_present:
|
|
Panu Matilainen |
aca433 |
+ break;
|
|
Panu Matilainen |
aca433 |
case DW_FORM_addr:
|
|
Panu Matilainen |
aca433 |
ptr += ptr_size;
|
|
Panu Matilainen |
aca433 |
break;
|
|
Panu Matilainen |
aca433 |
@@ -855,10 +863,12 @@ edit_attributes (DSO *dso, unsigned char
|
|
Panu Matilainen |
aca433 |
break;
|
|
Panu Matilainen |
aca433 |
case DW_FORM_ref4:
|
|
Panu Matilainen |
aca433 |
case DW_FORM_data4:
|
|
Panu Matilainen |
aca433 |
+ case DW_FORM_sec_offset:
|
|
Panu Matilainen |
aca433 |
ptr += 4;
|
|
Panu Matilainen |
aca433 |
break;
|
|
Panu Matilainen |
aca433 |
case DW_FORM_ref8:
|
|
Panu Matilainen |
aca433 |
case DW_FORM_data8:
|
|
Panu Matilainen |
aca433 |
+ case DW_FORM_ref_sig8:
|
|
Panu Matilainen |
aca433 |
ptr += 8;
|
|
Panu Matilainen |
aca433 |
break;
|
|
Panu Matilainen |
aca433 |
case DW_FORM_sdata:
|
|
Panu Matilainen |
aca433 |
@@ -887,6 +897,7 @@ edit_attributes (DSO *dso, unsigned char
|
|
Panu Matilainen |
aca433 |
form = DW_FORM_block1;
|
|
Panu Matilainen |
aca433 |
break;
|
|
Panu Matilainen |
aca433 |
case DW_FORM_block:
|
|
Panu Matilainen |
aca433 |
+ case DW_FORM_exprloc:
|
|
Panu Matilainen |
aca433 |
len = read_uleb128 (ptr);
|
|
Panu Matilainen |
aca433 |
form = DW_FORM_block1;
|
|
Panu Matilainen |
aca433 |
assert (len < UINT_MAX);
|
|
Panu Matilainen |
aca433 |
@@ -1190,7 +1201,7 @@ edit_dwarf2 (DSO *dso)
|
|
Panu Matilainen |
aca433 |
}
|
|
Panu Matilainen |
aca433 |
|
|
Panu Matilainen |
aca433 |
cu_version = read_16 (ptr);
|
|
Panu Matilainen |
aca433 |
- if (cu_version != 2 && cu_version != 3)
|
|
Panu Matilainen |
aca433 |
+ if (cu_version != 2 && cu_version != 3 && cu_version != 4)
|
|
Panu Matilainen |
aca433 |
{
|
|
Panu Matilainen |
aca433 |
error (0, 0, "%s: DWARF version %d unhandled", dso->filename,
|
|
Panu Matilainen |
aca433 |
cu_version);
|