Need cross-endian support
I've come to realize that libehp may need to support cross-endianness (i.e., reading little-endian unwind info on a big endian machine or the other way around.) The code can easily-enough detect the endianness of the machine that's running the code, and the
constructor that takes a filename can infer the endianness from the file. However, this constructor cannot infer the endianness of the data:
static unique_ptr<const EHFrameParser_t> factory(
uint8_t ptrsize,
const string eh_frame_data, const uint64_t eh_frame_data_start_addr,
const string eh_frame_hdr_data, const uint64_t eh_frame_hdr_data_start_addr,
const string gcc_except_table_data, const uint64_t gcc_except_table_data_start_addr
);
I'm considering a change like so:
enum endianness_t { HOST, BIG, LITTLE}
static unique_ptr<const EHFrameParser_t> factory(
uint8_t ptrsize,
endianness_t endian,
const string eh_frame_data, const uint64_t eh_frame_data_start_addr,
const string eh_frame_hdr_data, const uint64_t eh_frame_hdr_data_start_addr,
const string gcc_except_table_data, const uint64_t gcc_except_table_data_start_addr
);
Which would be an API breaking change. I could make the endianness a default parameter by appending it to the end of the constructor, but that makes somewhat less sense.
@afloresmontoya, would an API-breaking change be a problem for you?