Implement DW_LNE_set_discriminator from DWARF 4.

This commit is contained in:
Rene Gollent
2012-04-11 19:28:59 -04:00
parent 56981da008
commit 3c5763274a
3 changed files with 15 additions and 5 deletions
+6 -5
View File
@@ -404,11 +404,12 @@ enum {
// line number extended opcode
enum {
DW_LNE_end_sequence = 0x01,
DW_LNE_set_address = 0x02,
DW_LNE_define_file = 0x03,
DW_LNE_lo_user = 0x80,
DW_LNE_hi_user = 0xff
DW_LNE_end_sequence = 0x01,
DW_LNE_set_address = 0x02,
DW_LNE_define_file = 0x03,
DW_LNE_set_discriminator = 0x04,
DW_LNE_lo_user = 0x80,
DW_LNE_hi_user = 0xff
};
// macro information type
@@ -99,6 +99,7 @@ LineNumberProgram::GetNextRow(State& state) const
state.isBasicBlock = false;
state.isPrologueEnd = false;
state.isEpilogueBegin = false;
state.discriminator = 0;
appendRow = true;
} else if (opcode > 0) {
// standard opcode
@@ -108,6 +109,7 @@ LineNumberProgram::GetNextRow(State& state) const
state.isPrologueEnd = false;
state.isEpilogueBegin = false;
appendRow = true;
state.discriminator = 0;
break;
case DW_LNS_advance_pc:
state.address += dataReader.ReadUnsignedLEB128(0)
@@ -175,6 +177,11 @@ LineNumberProgram::GetNextRow(State& state) const
state.file = -1;
break;
}
case DW_LNE_set_discriminator:
{
state.discriminator = dataReader.ReadUnsignedLEB128(0);
break;
}
default:
WARNING("unsupported extended opcode: %u\n",
extendedOpcode);
@@ -209,4 +216,5 @@ LineNumberProgram::_SetToInitial(State& state) const
state.isPrologueEnd = false;
state.isEpilogueBegin = false;
state.instructionSet = 0;
state.discriminator = 0;
}
@@ -54,6 +54,7 @@ struct LineNumberProgram::State {
bool isPrologueEnd;
bool isEpilogueBegin;
uint32 instructionSet;
uint32 discriminator;
// when file is set to -1
const char* explicitFile;