hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/perf/util/dwarf-aux.c
....@@ -308,21 +308,8 @@
308308 {
309309 Dwarf_Attribute attr;
310310
311
- if (dwarf_attr(tp_die, attr_name, &attr) == NULL ||
311
+ if (dwarf_attr_integrate(tp_die, attr_name, &attr) == NULL ||
312312 dwarf_formudata(&attr, result) != 0)
313
- return -ENOENT;
314
-
315
- return 0;
316
-}
317
-
318
-/* Get attribute and translate it as a sdata */
319
-static int die_get_attr_sdata(Dwarf_Die *tp_die, unsigned int attr_name,
320
- Dwarf_Sword *result)
321
-{
322
- Dwarf_Attribute attr;
323
-
324
- if (dwarf_attr(tp_die, attr_name, &attr) == NULL ||
325
- dwarf_formsdata(&attr, result) != 0)
326313 return -ENOENT;
327314
328315 return 0;
....@@ -467,9 +454,9 @@
467454 /* Get the call file index number in CU DIE */
468455 static int die_get_call_fileno(Dwarf_Die *in_die)
469456 {
470
- Dwarf_Sword idx;
457
+ Dwarf_Word idx;
471458
472
- if (die_get_attr_sdata(in_die, DW_AT_call_file, &idx) == 0)
459
+ if (die_get_attr_udata(in_die, DW_AT_call_file, &idx) == 0)
473460 return (int)idx;
474461 else
475462 return -ENOENT;
....@@ -478,9 +465,9 @@
478465 /* Get the declared file index number in CU DIE */
479466 static int die_get_decl_fileno(Dwarf_Die *pdie)
480467 {
481
- Dwarf_Sword idx;
468
+ Dwarf_Word idx;
482469
483
- if (die_get_attr_sdata(pdie, DW_AT_decl_file, &idx) == 0)
470
+ if (die_get_attr_udata(pdie, DW_AT_decl_file, &idx) == 0)
484471 return (int)idx;
485472 else
486473 return -ENOENT;
....@@ -1094,7 +1081,7 @@
10941081 ret = die_get_typename(vr_die, buf);
10951082 if (ret < 0) {
10961083 pr_debug("Failed to get type, make it unknown.\n");
1097
- ret = strbuf_add(buf, " (unknown_type)", 14);
1084
+ ret = strbuf_add(buf, "(unknown_type)", 14);
10981085 }
10991086
11001087 return ret < 0 ? ret : strbuf_addf(buf, "\t%s", dwarf_diename(vr_die));