Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fprintf: preserve conf_fprintf pointer in tag__ptr_name #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dwarves_fprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ static const char *__tag__name(const struct tag *tag, const struct cu *cu,
const struct conf_fprintf *conf);

static const char *tag__ptr_name(const struct tag *tag, const struct cu *cu,
char *bf, size_t len, const char *ptr_suffix)
char *bf, size_t len, const char *ptr_suffix,
const struct conf_fprintf *conf)
{
if (tag->type == 0) /* No type == void */
snprintf(bf, len, "void %s", ptr_suffix);
Expand All @@ -505,7 +506,7 @@ static const char *tag__ptr_name(const struct tag *tag, const struct cu *cu,

snprintf(bf, len, "%s %s%s",
__tag__name(type, cu,
tmpbf, sizeof(tmpbf), NULL),
tmpbf, sizeof(tmpbf), conf),
const_pointer,
ptr_suffix);
}
Expand Down Expand Up @@ -539,9 +540,9 @@ static const char *__tag__name(const struct tag *tag, const struct cu *cu,
strncpy(bf, function__name(tag__function(tag)), len);
break;
case DW_TAG_pointer_type:
return tag__ptr_name(tag, cu, bf, len, "*");
return tag__ptr_name(tag, cu, bf, len, "*", conf);
case DW_TAG_reference_type:
return tag__ptr_name(tag, cu, bf, len, "&");
return tag__ptr_name(tag, cu, bf, len, "&", conf);
case DW_TAG_ptr_to_member_type: {
char suffix[512];
type_id_t id = tag__ptr_to_member_type(tag)->containing_type;
Expand All @@ -556,7 +557,7 @@ static const char *__tag__name(const struct tag *tag, const struct cu *cu,
snprintf(suffix + l, sizeof(suffix) - l, "::*");
}

return tag__ptr_name(tag, cu, bf, len, suffix);
return tag__ptr_name(tag, cu, bf, len, suffix, conf);
}
case DW_TAG_volatile_type:
case DW_TAG_const_type:
Expand Down