diff --git a/dwarf_loader.c b/dwarf_loader.c index 3881e96..b3d498d 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -969,7 +969,7 @@ static struct label *label__new(Dwarf_Die *die, struct cu *cu) if (label != NULL) { tag__init(&label->ip.tag, cu, die); - label->name = strings__add(strings, attr_string(die, DW_AT_name)); + label->name = strdup_attr_string(die, DW_AT_name); if (!cu->has_addr_info || dwarf_lowpc(die, &label->ip.addr)) label->ip.addr = 0; } diff --git a/dwarves.h b/dwarves.h index 9752c8d8..8a1c5a1 100644 --- a/dwarves.h +++ b/dwarves.h @@ -638,7 +638,7 @@ static inline struct inline_expansion * struct label { struct ip_tag ip; - strings_t name; + const char *name; }; static inline struct label *tag__label(const struct tag *tag) @@ -646,10 +646,9 @@ static inline struct label *tag__label(const struct tag *tag) return (struct label *)tag; } -static inline const char *label__name(const struct label *label, - const struct cu *cu) +static inline const char *label__name(const struct label *label) { - return cu__string(cu, label->name); + return label->name; } enum vscope { diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c index 300cdc3..a10c414 100644 --- a/dwarves_fprintf.c +++ b/dwarves_fprintf.c @@ -1173,7 +1173,7 @@ static size_t function__tag_fprintf(const struct tag *tag, const struct cu *cu, printed = fprintf(fp, "%.*s", indent, tabs); fputc('\n', fp); ++printed; - c = fprintf(fp, "%s:", label__name(label, cu)); + c = fprintf(fp, "%s:", label__name(label)); printed += c; } break;