pahole: Don't add anonymous structs to the list of known structs

Replicating the comment added to the source code:

No sense in adding an anonymous struct to the list of structs already
printed, as we look for the name...  The right fix probably will be to
call class__fprintf on a in-memory FILE, do a hash, and look it by full
contents, not by name. And this is needed for CTF as well, but its late
now and I'm sleepy, will leave for later...

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-05-08 01:05:31 -03:00
parent 73548f6be3
commit 2f7ffdb088
1 changed files with 10 additions and 0 deletions

View File

@ -295,6 +295,16 @@ static void print_classes(struct cu *cu)
print_packable_info(pos, cu, id);
else if (formatter != NULL)
formatter(pos, cu, id);
/*
* FIXME: No sense in adding an anonymous struct to the list of
* structs already printed, as we look for the name... The
* right fix probably will be to call class__fprintf on a
* in-memory FILE, do a hash, and look it by full contents, not
* by name. And this is needed for CTF as well, but its late now
* and I'm sleepy, will leave for later...
*/
if (pos->type.namespace.name == 0)
continue;
if (structures__add(pos, cu) == NULL) {
fprintf(stderr, "pahole: insufficient memory for "