serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
720 stars 155 forks source link

Make STR_FUNC_TABLE public #79

Closed galjs closed 2 years ago

galjs commented 2 years ago

This define is used to define the str_##name functions inside elfio_dump.hpp that are used to translate field values in headers and structs in the elf file to their corresponding string meanings. The problem is it is a private function in the class, so the only way to translate field values to strings is to use the dump API (dump::section_header(), dump::header() etc), which dictates what and in what format the fields will be printed.

REQUEST: Make this function public inside the dump class so it can be used wherever needed in the code

serge1 commented 2 years ago

I don't see a big value of this as name##_table arrays are public anyhow. But, you have requested. I have no objections. Done. See c050ae9

galjs commented 2 years ago

The arrays are indeed public, but since you already wrote the logic that makes accessing them easy I see no point in writing it again. Thank you for adding that