[Lldb-commits] [lldb] r161721 - in /lldb/trunk/source: Expression/DWARFExpression.cpp Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Greg Clayton
gclayton at apple.com
Fri Aug 10 17:49:14 PDT 2012
Author: gclayton
Date: Fri Aug 10 19:49:14 2012
New Revision: 161721
URL: http://llvm.org/viewvc/llvm-project?rev=161721&view=rev
Log:
<rdar://problem/11791234>
Remember to copy the address byte size and the byte order when copying data into a DWARF location object, or things will go wrong.
Modified:
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=161721&r1=161720&r2=161721&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Fri Aug 10 19:49:14 2012
@@ -264,7 +264,12 @@
DWARFExpression::CopyOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
{
const uint8_t *bytes = data.PeekData(data_offset, data_length);
- m_data.SetData(DataBufferSP(new DataBufferHeap(bytes, data_length)));
+ if (bytes)
+ {
+ m_data.SetData(DataBufferSP(new DataBufferHeap(bytes, data_length)));
+ m_data.SetByteOrder(data.GetByteOrder());
+ m_data.SetAddressByteSize(data.GetAddressByteSize());
+ }
}
void
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=161721&r1=161720&r2=161721&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Aug 10 19:49:14 2012
@@ -6542,7 +6542,7 @@
uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
uint32_t block_length = form_value.Unsigned();
- location.SetOpcodeData(get_debug_info_data(), block_offset, block_length);
+ location.CopyOpcodeData(get_debug_info_data(), block_offset, block_length);
}
else
{
@@ -6552,7 +6552,7 @@
size_t loc_list_length = DWARFLocationList::Size(debug_loc_data, debug_loc_offset);
if (loc_list_length > 0)
{
- location.SetOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length);
+ location.CopyOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length);
assert (func_low_pc != LLDB_INVALID_ADDRESS);
location.SetLocationListSlide (func_low_pc - dwarf_cu->GetBaseAddress());
}
More information about the lldb-commits
mailing list