Mark Wielaard | 26 Mar 2011 22:23
Picon
Favicon

[patch] Don't die when encountering unknown tags, just warn

Hi,

I was playing with pahole against a binary compiled with an unreleased
gcc. This version outputs some DW_TAGs that pahole doesn't know about.
These tags have been added to elftuils git, but aren't yet in any
release.

The problem was that all errors from die__process_tag () are treated the
same (it returns NULL and then all callers interpret that as out of
memory). So this patch adds an explicit UNKNOWN_TAG return value so
callers can decide to ignore it and just carry on instead of terminating
the program where appropriate.

With this patch in place pahole will just print a warning when
encountering an unknown tag and ignore that die.

Cheers,

Mark

Gmane