Allow unimplemented registers to appear in DWARF

The presence of such a register — eg. rcx, which is actually used in CFA
on a few lines of libgcc_s.so on my system — will yield an assert(0) in
the produced code, but will at least not fail to compile alltogether.
This commit is contained in:
Théophile Bastian 2018-04-25 17:34:31 +02:00
parent 31f811eca4
commit ff0f8c90df

View file

@ -84,6 +84,7 @@ SimpleDwarf::DwRegister DwarfReader::read_register(
{
SimpleDwarf::DwRegister output;
try {
switch(reg.k) {
case core::FrameSection::register_def::REGISTER:
output.type = SimpleDwarf::DwRegister::REG_REGISTER;
@ -106,6 +107,10 @@ SimpleDwarf::DwRegister DwarfReader::read_register(
output.type = SimpleDwarf::DwRegister::REG_NOT_IMPLEMENTED;
break;
}
}
catch(const UnsupportedRegister& e) {
output.type = SimpleDwarf::DwRegister::REG_NOT_IMPLEMENTED;
}
return output;
}