Implement DW_LNE_set_discriminator from DWARF 4.
This commit is contained in:
@@ -404,11 +404,12 @@ enum {
|
|||||||
|
|
||||||
// line number extended opcode
|
// line number extended opcode
|
||||||
enum {
|
enum {
|
||||||
DW_LNE_end_sequence = 0x01,
|
DW_LNE_end_sequence = 0x01,
|
||||||
DW_LNE_set_address = 0x02,
|
DW_LNE_set_address = 0x02,
|
||||||
DW_LNE_define_file = 0x03,
|
DW_LNE_define_file = 0x03,
|
||||||
DW_LNE_lo_user = 0x80,
|
DW_LNE_set_discriminator = 0x04,
|
||||||
DW_LNE_hi_user = 0xff
|
DW_LNE_lo_user = 0x80,
|
||||||
|
DW_LNE_hi_user = 0xff
|
||||||
};
|
};
|
||||||
|
|
||||||
// macro information type
|
// macro information type
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ LineNumberProgram::GetNextRow(State& state) const
|
|||||||
state.isBasicBlock = false;
|
state.isBasicBlock = false;
|
||||||
state.isPrologueEnd = false;
|
state.isPrologueEnd = false;
|
||||||
state.isEpilogueBegin = false;
|
state.isEpilogueBegin = false;
|
||||||
|
state.discriminator = 0;
|
||||||
appendRow = true;
|
appendRow = true;
|
||||||
} else if (opcode > 0) {
|
} else if (opcode > 0) {
|
||||||
// standard opcode
|
// standard opcode
|
||||||
@@ -108,6 +109,7 @@ LineNumberProgram::GetNextRow(State& state) const
|
|||||||
state.isPrologueEnd = false;
|
state.isPrologueEnd = false;
|
||||||
state.isEpilogueBegin = false;
|
state.isEpilogueBegin = false;
|
||||||
appendRow = true;
|
appendRow = true;
|
||||||
|
state.discriminator = 0;
|
||||||
break;
|
break;
|
||||||
case DW_LNS_advance_pc:
|
case DW_LNS_advance_pc:
|
||||||
state.address += dataReader.ReadUnsignedLEB128(0)
|
state.address += dataReader.ReadUnsignedLEB128(0)
|
||||||
@@ -175,6 +177,11 @@ LineNumberProgram::GetNextRow(State& state) const
|
|||||||
state.file = -1;
|
state.file = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DW_LNE_set_discriminator:
|
||||||
|
{
|
||||||
|
state.discriminator = dataReader.ReadUnsignedLEB128(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
WARNING("unsupported extended opcode: %u\n",
|
WARNING("unsupported extended opcode: %u\n",
|
||||||
extendedOpcode);
|
extendedOpcode);
|
||||||
@@ -209,4 +216,5 @@ LineNumberProgram::_SetToInitial(State& state) const
|
|||||||
state.isPrologueEnd = false;
|
state.isPrologueEnd = false;
|
||||||
state.isEpilogueBegin = false;
|
state.isEpilogueBegin = false;
|
||||||
state.instructionSet = 0;
|
state.instructionSet = 0;
|
||||||
|
state.discriminator = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ struct LineNumberProgram::State {
|
|||||||
bool isPrologueEnd;
|
bool isPrologueEnd;
|
||||||
bool isEpilogueBegin;
|
bool isEpilogueBegin;
|
||||||
uint32 instructionSet;
|
uint32 instructionSet;
|
||||||
|
uint32 discriminator;
|
||||||
|
|
||||||
// when file is set to -1
|
// when file is set to -1
|
||||||
const char* explicitFile;
|
const char* explicitFile;
|
||||||
|
|||||||
Reference in New Issue
Block a user