Debug info: Bugfix for r201190: DW_OP_piece takes bytes, not bits.

rdar://problem/16015314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201253 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2014-02-12 19:34:44 +00:00
parent 386fedd32e
commit 4c1ea6b115
4 changed files with 7 additions and 5 deletions

View File

@@ -931,8 +931,9 @@ void AsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc,
} else {
OutStreamer.AddComment("DW_OP_piece");
EmitInt8(dwarf::DW_OP_piece);
OutStreamer.AddComment(Twine(Size));
EmitULEB128(Size);
unsigned ByteSize = Size / 8; // Assuming 8 bits per byte.
OutStreamer.AddComment(Twine(ByteSize));
EmitULEB128(ByteSize);
}
}
}

View File

@@ -470,8 +470,9 @@ void DwarfUnit::addRegisterOp(DIEBlock *TheDie, unsigned Reg) {
addUInt(TheDie, dwarf::DW_FORM_data1, Size);
addUInt(TheDie, dwarf::DW_FORM_data1, Offset);
} else {
unsigned ByteSize = Size / 8; // Assuming 8 bits per byte.
addUInt(TheDie, dwarf::DW_FORM_data1, dwarf::DW_OP_piece);
addUInt(TheDie, dwarf::DW_FORM_data1, Size);
addUInt(TheDie, dwarf::DW_FORM_data1, ByteSize);
}
}
}