Line 0
Link Here
|
|
|
1 |
--- thirdparty/libbacktrace/dwarf.c.orig 2017-10-13 17:18:18 UTC |
2 |
+++ thirdparty/libbacktrace/dwarf.c |
3 |
@@ -768,21 +768,27 @@ read_attribute (enum dwarf_form form, st |
4 |
version, addrsize, dwarf_str, dwarf_str_size, |
5 |
val); |
6 |
} |
7 |
+#if defined(DW_FORM_sec_offset) // not defined on 10 |
8 |
case DW_FORM_sec_offset: |
9 |
val->encoding = ATTR_VAL_REF_SECTION; |
10 |
val->u.uint = read_offset (buf, is_dwarf64); |
11 |
return 1; |
12 |
+#endif |
13 |
+#if defined(DW_FORM_exprloc) // not defined on 10 |
14 |
case DW_FORM_exprloc: |
15 |
val->encoding = ATTR_VAL_EXPR; |
16 |
return advance (buf, read_uleb128 (buf)); |
17 |
+#endif |
18 |
case DW_FORM_flag_present: |
19 |
val->encoding = ATTR_VAL_UINT; |
20 |
val->u.uint = 1; |
21 |
return 1; |
22 |
+#if defined(DW_FORM_ref_sig8) // not defined on 10 |
23 |
case DW_FORM_ref_sig8: |
24 |
val->encoding = ATTR_VAL_REF_TYPE; |
25 |
val->u.uint = read_uint64 (buf); |
26 |
return 1; |
27 |
+#endif |
28 |
case DW_FORM_GNU_addr_index: |
29 |
val->encoding = ATTR_VAL_REF_SECTION; |
30 |
val->u.uint = read_uleb128 (buf); |
31 |
@@ -1314,7 +1320,7 @@ find_address_ranges (struct backtrace_st |
32 |
highpc_is_relative = 1; |
33 |
} |
34 |
break; |
35 |
- |
36 |
+#if defined(DW_AT_ranges) // not defined on 10 |
37 |
case DW_AT_ranges: |
38 |
if (val.encoding == ATTR_VAL_UINT |
39 |
|| val.encoding == ATTR_VAL_REF_SECTION) |
40 |
@@ -1323,7 +1329,7 @@ find_address_ranges (struct backtrace_st |
41 |
have_ranges = 1; |
42 |
} |
43 |
break; |
44 |
- |
45 |
+#endif |
46 |
case DW_AT_stmt_list: |
47 |
if (abbrev->tag == DW_TAG_compile_unit |
48 |
&& (val.encoding == ATTR_VAL_UINT |
49 |
@@ -1851,10 +1857,6 @@ read_line_program (struct backtrace_stat |
50 |
} |
51 |
} |
52 |
break; |
53 |
- case DW_LNE_set_discriminator: |
54 |
- /* We don't care about discriminators. */ |
55 |
- read_uleb128 (line_buf); |
56 |
- break; |
57 |
default: |
58 |
if (!advance (line_buf, len - 1)) |
59 |
return 0; |
60 |
@@ -2108,16 +2110,24 @@ read_referenced_name (struct dwarf_data |
61 |
if (val.encoding == ATTR_VAL_STRING) |
62 |
ret = val.u.string; |
63 |
break; |
64 |
- |
65 |
+#if defined(DW_AT_linkage_name) |
66 |
case DW_AT_linkage_name: |
67 |
+#endif |
68 |
+#if defined(DW_AT_MIPS_linkage_name) |
69 |
case DW_AT_MIPS_linkage_name: |
70 |
+#endif |
71 |
+#if defined(DW_AT_linkage_name) || defined(DW_AT_MIPS_linkage_name) |
72 |
if (val.encoding == ATTR_VAL_STRING) |
73 |
return val.u.string; |
74 |
break; |
75 |
- |
76 |
+#endif |
77 |
case DW_AT_specification: |
78 |
if (abbrev->attrs[i].form == DW_FORM_ref_addr |
79 |
+#if defined(DW_FORM_ref_sig8) // not defined on 10 |
80 |
|| abbrev->attrs[i].form == DW_FORM_ref_sig8) |
81 |
+#else |
82 |
+ || 0) // not defined |
83 |
+#endif |
84 |
{ |
85 |
/* This refers to a specification defined in some other |
86 |
compilation unit. We can handle this case if we |
87 |
@@ -2325,6 +2335,7 @@ read_function_entry (struct backtrace_st |
88 |
{ |
89 |
switch (abbrev->attrs[i].name) |
90 |
{ |
91 |
+#if defined(DW_AT_call_file) |
92 |
case DW_AT_call_file: |
93 |
if (val.encoding == ATTR_VAL_UINT) |
94 |
{ |
95 |
@@ -2344,16 +2355,21 @@ read_function_entry (struct backtrace_st |
96 |
} |
97 |
} |
98 |
break; |
99 |
- |
100 |
+#endif |
101 |
+#if defined(DW_AT_call_line) |
102 |
case DW_AT_call_line: |
103 |
if (val.encoding == ATTR_VAL_UINT) |
104 |
function->caller_lineno = val.u.uint; |
105 |
break; |
106 |
- |
107 |
+#endif |
108 |
case DW_AT_abstract_origin: |
109 |
case DW_AT_specification: |
110 |
if (abbrev->attrs[i].form == DW_FORM_ref_addr |
111 |
+#if defined(DW_FORM_ref_sig8) // not defined on 10 |
112 |
|| abbrev->attrs[i].form == DW_FORM_ref_sig8) |
113 |
+#else |
114 |
+ || 0) // not defined |
115 |
+#endif |
116 |
{ |
117 |
/* This refers to an abstract origin defined in |
118 |
some other compilation unit. We can handle |
119 |
@@ -2383,13 +2399,17 @@ read_function_entry (struct backtrace_st |
120 |
function->name = val.u.string; |
121 |
} |
122 |
break; |
123 |
- |
124 |
+#if defined(DW_AT_linkage_name) |
125 |
case DW_AT_linkage_name: |
126 |
+#endif |
127 |
+#if defined(DW_AT_MIPS_linkage_name) |
128 |
case DW_AT_MIPS_linkage_name: |
129 |
+#endif |
130 |
+#if defined(DW_AT_linkage_name) || defined(DW_AT_MIPS_linkage_name) |
131 |
if (val.encoding == ATTR_VAL_STRING) |
132 |
function->name = val.u.string; |
133 |
break; |
134 |
- |
135 |
+#endif |
136 |
case DW_AT_low_pc: |
137 |
if (val.encoding == ATTR_VAL_ADDRESS) |
138 |
{ |
139 |
@@ -2411,7 +2431,7 @@ read_function_entry (struct backtrace_st |
140 |
highpc_is_relative = 1; |
141 |
} |
142 |
break; |
143 |
- |
144 |
+#if defined(DW_AT_ranges) // not defined on 10 |
145 |
case DW_AT_ranges: |
146 |
if (val.encoding == ATTR_VAL_UINT |
147 |
|| val.encoding == ATTR_VAL_REF_SECTION) |
148 |
@@ -2420,7 +2440,7 @@ read_function_entry (struct backtrace_st |
149 |
have_ranges = 1; |
150 |
} |
151 |
break; |
152 |
- |
153 |
+#endif |
154 |
default: |
155 |
break; |
156 |
} |