blob: f183245f7d36de79c140c40a714fcd7064493eb3 [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- Address.cpp ---------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "lldb/Core/Address.h"
Zachary Turner29cb8682017-03-03 20:57:05 +000011#include "lldb/Core/DumpDataExtractor.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000012#include "lldb/Core/Module.h"
Zachary Turner2f3df612017-04-06 21:28:29 +000013#include "lldb/Core/ModuleList.h" // for ModuleList
Chris Lattner30fdc8d2010-06-08 16:52:24 +000014#include "lldb/Core/Section.h"
Greg Clayton1f746072012-08-29 21:13:06 +000015#include "lldb/Symbol/Block.h"
Zachary Turner2f3df612017-04-06 21:28:29 +000016#include "lldb/Symbol/Declaration.h" // for Declaration
17#include "lldb/Symbol/LineEntry.h" // for LineEntry
Chris Lattner30fdc8d2010-06-08 16:52:24 +000018#include "lldb/Symbol/ObjectFile.h"
Zachary Turner2f3df612017-04-06 21:28:29 +000019#include "lldb/Symbol/Symbol.h" // for Symbol
20#include "lldb/Symbol/SymbolContext.h" // for SymbolContext
Kate Stoneb9c1b512016-09-06 20:57:50 +000021#include "lldb/Symbol/SymbolVendor.h"
Zachary Turner2f3df612017-04-06 21:28:29 +000022#include "lldb/Symbol/Symtab.h" // for Symtab
23#include "lldb/Symbol/Type.h" // for Type
Greg Claytonc749eb82011-07-11 05:12:02 +000024#include "lldb/Symbol/Variable.h"
25#include "lldb/Symbol/VariableList.h"
Greg Claytonf5e56de2010-09-14 23:36:40 +000026#include "lldb/Target/ExecutionContext.h"
Zachary Turner2f3df612017-04-06 21:28:29 +000027#include "lldb/Target/ExecutionContextScope.h" // for ExecutionContextScope
Chris Lattner30fdc8d2010-06-08 16:52:24 +000028#include "lldb/Target/Process.h"
Greg Claytond5944cd2013-12-06 01:12:00 +000029#include "lldb/Target/SectionLoadList.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000030#include "lldb/Target/Target.h"
Zachary Turner2f3df612017-04-06 21:28:29 +000031#include "lldb/Utility/ConstString.h" // for ConstString
32#include "lldb/Utility/DataExtractor.h" // for DataExtractor
33#include "lldb/Utility/Endian.h" // for InlHostByteOrder
Zachary Turner2f3df612017-04-06 21:28:29 +000034#include "lldb/Utility/FileSpec.h" // for FileSpec
Zachary Turner97206d52017-05-12 04:51:55 +000035#include "lldb/Utility/Status.h" // for Status
Zachary Turner2f3df612017-04-06 21:28:29 +000036#include "lldb/Utility/Stream.h" // for Stream
37#include "lldb/Utility/StreamString.h" // for StreamString
38
39#include "llvm/ADT/StringRef.h" // for StringRef
40#include "llvm/ADT/Triple.h"
41#include "llvm/Support/Compiler.h" // for LLVM_FALLTHROUGH
42
43#include <cstdint> // for uint8_t, uint32_t
44#include <memory> // for shared_ptr, operator!=
45#include <vector> // for vector
46
47#include <assert.h> // for assert
48#include <inttypes.h> // for PRIu64, PRIx64
49#include <string.h> // for size_t, strlen
50
51namespace lldb_private {
52class CompileUnit;
53}
54namespace lldb_private {
55class Function;
56}
Chris Lattner30fdc8d2010-06-08 16:52:24 +000057
58using namespace lldb;
59using namespace lldb_private;
60
Kate Stoneb9c1b512016-09-06 20:57:50 +000061static size_t ReadBytes(ExecutionContextScope *exe_scope,
62 const Address &address, void *dst, size_t dst_len) {
63 if (exe_scope == nullptr)
Chris Lattner30fdc8d2010-06-08 16:52:24 +000064 return 0;
Kate Stoneb9c1b512016-09-06 20:57:50 +000065
66 TargetSP target_sp(exe_scope->CalculateTarget());
67 if (target_sp) {
Zachary Turner97206d52017-05-12 04:51:55 +000068 Status error;
Kate Stoneb9c1b512016-09-06 20:57:50 +000069 bool prefer_file_cache = false;
70 return target_sp->ReadMemory(address, prefer_file_cache, dst, dst_len,
71 error);
72 }
73 return 0;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000074}
75
Kate Stoneb9c1b512016-09-06 20:57:50 +000076static bool GetByteOrderAndAddressSize(ExecutionContextScope *exe_scope,
77 const Address &address,
78 ByteOrder &byte_order,
79 uint32_t &addr_size) {
80 byte_order = eByteOrderInvalid;
81 addr_size = 0;
82 if (exe_scope == nullptr)
83 return false;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000084
Kate Stoneb9c1b512016-09-06 20:57:50 +000085 TargetSP target_sp(exe_scope->CalculateTarget());
86 if (target_sp) {
87 byte_order = target_sp->GetArchitecture().GetByteOrder();
88 addr_size = target_sp->GetArchitecture().GetAddressByteSize();
89 }
Chris Lattner30fdc8d2010-06-08 16:52:24 +000090
Kate Stoneb9c1b512016-09-06 20:57:50 +000091 if (byte_order == eByteOrderInvalid || addr_size == 0) {
92 ModuleSP module_sp(address.GetModule());
93 if (module_sp) {
94 byte_order = module_sp->GetArchitecture().GetByteOrder();
95 addr_size = module_sp->GetArchitecture().GetAddressByteSize();
Chris Lattner30fdc8d2010-06-08 16:52:24 +000096 }
Kate Stoneb9c1b512016-09-06 20:57:50 +000097 }
98 return byte_order != eByteOrderInvalid && addr_size != 0;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000099}
100
Kate Stoneb9c1b512016-09-06 20:57:50 +0000101static uint64_t ReadUIntMax64(ExecutionContextScope *exe_scope,
102 const Address &address, uint32_t byte_size,
103 bool &success) {
104 uint64_t uval64 = 0;
105 if (exe_scope == nullptr || byte_size > sizeof(uint64_t)) {
106 success = false;
107 return 0;
108 }
109 uint64_t buf = 0;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000110
Kate Stoneb9c1b512016-09-06 20:57:50 +0000111 success = ReadBytes(exe_scope, address, &buf, byte_size) == byte_size;
112 if (success) {
113 ByteOrder byte_order = eByteOrderInvalid;
114 uint32_t addr_size = 0;
115 if (GetByteOrderAndAddressSize(exe_scope, address, byte_order, addr_size)) {
116 DataExtractor data(&buf, sizeof(buf), byte_order, addr_size);
117 lldb::offset_t offset = 0;
118 uval64 = data.GetU64(&offset);
119 } else
120 success = false;
121 }
122 return uval64;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000123}
124
Kate Stoneb9c1b512016-09-06 20:57:50 +0000125static bool ReadAddress(ExecutionContextScope *exe_scope,
126 const Address &address, uint32_t pointer_size,
127 Address &deref_so_addr) {
128 if (exe_scope == nullptr)
129 return false;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000130
Kate Stoneb9c1b512016-09-06 20:57:50 +0000131 bool success = false;
132 addr_t deref_addr = ReadUIntMax64(exe_scope, address, pointer_size, success);
133 if (success) {
134 ExecutionContext exe_ctx;
135 exe_scope->CalculateExecutionContext(exe_ctx);
136 // If we have any sections that are loaded, try and resolve using the
137 // section load list
138 Target *target = exe_ctx.GetTargetPtr();
139 if (target && !target->GetSectionLoadList().IsEmpty()) {
140 if (target->GetSectionLoadList().ResolveLoadAddress(deref_addr,
141 deref_so_addr))
142 return true;
143 } else {
Adrian Prantl05097242018-04-30 16:49:04 +0000144 // If we were not running, yet able to read an integer, we must have a
145 // module
Kate Stoneb9c1b512016-09-06 20:57:50 +0000146 ModuleSP module_sp(address.GetModule());
Greg Claytone72dfb32012-02-24 01:59:29 +0000147
Kate Stoneb9c1b512016-09-06 20:57:50 +0000148 assert(module_sp);
149 if (module_sp->ResolveFileAddress(deref_addr, deref_so_addr))
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000150 return true;
151 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000152
153 // We couldn't make "deref_addr" into a section offset value, but we were
Adrian Prantl05097242018-04-30 16:49:04 +0000154 // able to read the address, so we return a section offset address with no
155 // section and "deref_addr" as the offset (address).
Kate Stoneb9c1b512016-09-06 20:57:50 +0000156 deref_so_addr.SetRawAddress(deref_addr);
157 return true;
158 }
159 return false;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000160}
161
Kate Stoneb9c1b512016-09-06 20:57:50 +0000162static bool DumpUInt(ExecutionContextScope *exe_scope, const Address &address,
163 uint32_t byte_size, Stream *strm) {
164 if (exe_scope == nullptr || byte_size == 0)
165 return 0;
166 std::vector<uint8_t> buf(byte_size, 0);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000167
Kate Stoneb9c1b512016-09-06 20:57:50 +0000168 if (ReadBytes(exe_scope, address, &buf[0], buf.size()) == buf.size()) {
169 ByteOrder byte_order = eByteOrderInvalid;
170 uint32_t addr_size = 0;
171 if (GetByteOrderAndAddressSize(exe_scope, address, byte_order, addr_size)) {
172 DataExtractor data(&buf.front(), buf.size(), byte_order, addr_size);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000173
Zachary Turner29cb8682017-03-03 20:57:05 +0000174 DumpDataExtractor(data, strm,
175 0, // Start offset in "data"
176 eFormatHex, // Print as characters
177 buf.size(), // Size of item
178 1, // Items count
179 UINT32_MAX, // num per line
180 LLDB_INVALID_ADDRESS, // base address
181 0, // bitfield bit size
182 0); // bitfield bit offset
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000183
Kate Stoneb9c1b512016-09-06 20:57:50 +0000184 return true;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000185 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000186 }
187 return false;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000188}
189
Kate Stoneb9c1b512016-09-06 20:57:50 +0000190static size_t ReadCStringFromMemory(ExecutionContextScope *exe_scope,
191 const Address &address, Stream *strm) {
192 if (exe_scope == nullptr)
193 return 0;
194 const size_t k_buf_len = 256;
195 char buf[k_buf_len + 1];
196 buf[k_buf_len] = '\0'; // NULL terminate
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000197
Kate Stoneb9c1b512016-09-06 20:57:50 +0000198 // Byte order and address size don't matter for C string dumping..
199 DataExtractor data(buf, sizeof(buf), endian::InlHostByteOrder(), 4);
200 size_t total_len = 0;
201 size_t bytes_read;
202 Address curr_address(address);
203 strm->PutChar('"');
204 while ((bytes_read = ReadBytes(exe_scope, curr_address, buf, k_buf_len)) >
205 0) {
206 size_t len = strlen(buf);
207 if (len == 0)
208 break;
209 if (len > bytes_read)
210 len = bytes_read;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000211
Zachary Turner29cb8682017-03-03 20:57:05 +0000212 DumpDataExtractor(data, strm,
213 0, // Start offset in "data"
214 eFormatChar, // Print as characters
215 1, // Size of item (1 byte for a char!)
216 len, // How many bytes to print?
217 UINT32_MAX, // num per line
218 LLDB_INVALID_ADDRESS, // base address
219 0, // bitfield bit size
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000220
Zachary Turner29cb8682017-03-03 20:57:05 +0000221 0); // bitfield bit offset
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000222
Kate Stoneb9c1b512016-09-06 20:57:50 +0000223 total_len += bytes_read;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000224
Kate Stoneb9c1b512016-09-06 20:57:50 +0000225 if (len < k_buf_len)
226 break;
227 curr_address.SetOffset(curr_address.GetOffset() + bytes_read);
228 }
229 strm->PutChar('"');
230 return total_len;
231}
232
233Address::Address(lldb::addr_t abs_addr) : m_section_wp(), m_offset(abs_addr) {}
234
235Address::Address(addr_t address, const SectionList *section_list)
236 : m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) {
237 ResolveAddressUsingFileSections(address, section_list);
238}
239
240const Address &Address::operator=(const Address &rhs) {
241 if (this != &rhs) {
242 m_section_wp = rhs.m_section_wp;
243 m_offset = rhs.m_offset;
244 }
245 return *this;
246}
247
248bool Address::ResolveAddressUsingFileSections(addr_t file_addr,
249 const SectionList *section_list) {
250 if (section_list) {
251 SectionSP section_sp(
252 section_list->FindSectionContainingFileAddress(file_addr));
253 m_section_wp = section_sp;
254 if (section_sp) {
255 assert(section_sp->ContainsFileAddress(file_addr));
256 m_offset = file_addr - section_sp->GetFileAddress();
257 return true; // Successfully transformed addr into a section offset
258 // address
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000259 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000260 }
261 m_offset = file_addr;
262 return false; // Failed to resolve this address to a section offset value
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000263}
264
Kate Stoneb9c1b512016-09-06 20:57:50 +0000265ModuleSP Address::GetModule() const {
266 lldb::ModuleSP module_sp;
267 SectionSP section_sp(GetSection());
268 if (section_sp)
269 module_sp = section_sp->GetModule();
270 return module_sp;
Greg Claytone72dfb32012-02-24 01:59:29 +0000271}
272
Kate Stoneb9c1b512016-09-06 20:57:50 +0000273addr_t Address::GetFileAddress() const {
274 SectionSP section_sp(GetSection());
275 if (section_sp) {
276 addr_t sect_file_addr = section_sp->GetFileAddress();
277 if (sect_file_addr == LLDB_INVALID_ADDRESS) {
278 // Section isn't resolved, we can't return a valid file address
279 return LLDB_INVALID_ADDRESS;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000280 }
Adrian Prantl05097242018-04-30 16:49:04 +0000281 // We have a valid file range, so we can return the file based address by
282 // adding the file base address to our offset
Kate Stoneb9c1b512016-09-06 20:57:50 +0000283 return sect_file_addr + m_offset;
Davide Italianoae3f7932018-09-10 23:09:09 +0000284 } else if (SectionWasDeletedPrivate()) {
Adrian Prantl05097242018-04-30 16:49:04 +0000285 // Used to have a valid section but it got deleted so the offset doesn't
286 // mean anything without the section
Kate Stoneb9c1b512016-09-06 20:57:50 +0000287 return LLDB_INVALID_ADDRESS;
288 }
289 // No section, we just return the offset since it is the value in this case
290 return m_offset;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000291}
292
Kate Stoneb9c1b512016-09-06 20:57:50 +0000293addr_t Address::GetLoadAddress(Target *target) const {
294 SectionSP section_sp(GetSection());
295 if (section_sp) {
296 if (target) {
297 addr_t sect_load_addr = section_sp->GetLoadBaseAddress(target);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000298
Kate Stoneb9c1b512016-09-06 20:57:50 +0000299 if (sect_load_addr != LLDB_INVALID_ADDRESS) {
Adrian Prantl05097242018-04-30 16:49:04 +0000300 // We have a valid file range, so we can return the file based address
301 // by adding the file base address to our offset
Kate Stoneb9c1b512016-09-06 20:57:50 +0000302 return sect_load_addr + m_offset;
303 }
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000304 }
Davide Italianoae3f7932018-09-10 23:09:09 +0000305 } else if (SectionWasDeletedPrivate()) {
Adrian Prantl05097242018-04-30 16:49:04 +0000306 // Used to have a valid section but it got deleted so the offset doesn't
307 // mean anything without the section
Greg Claytonf5e56de2010-09-14 23:36:40 +0000308 return LLDB_INVALID_ADDRESS;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000309 } else {
310 // We don't have a section so the offset is the load address
311 return m_offset;
312 }
Adrian Prantl05097242018-04-30 16:49:04 +0000313 // The section isn't resolved or an invalid target was passed in so we can't
314 // return a valid load address.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000315 return LLDB_INVALID_ADDRESS;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000316}
317
Kate Stoneb9c1b512016-09-06 20:57:50 +0000318addr_t Address::GetCallableLoadAddress(Target *target, bool is_indirect) const {
319 addr_t code_addr = LLDB_INVALID_ADDRESS;
320
321 if (is_indirect && target) {
322 ProcessSP processSP = target->GetProcessSP();
Zachary Turner97206d52017-05-12 04:51:55 +0000323 Status error;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000324 if (processSP) {
325 code_addr = processSP->ResolveIndirectFunction(this, error);
326 if (!error.Success())
327 code_addr = LLDB_INVALID_ADDRESS;
Matt Kopec00049b82013-02-27 20:13:38 +0000328 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000329 } else {
330 code_addr = GetLoadAddress(target);
331 }
332
333 if (code_addr == LLDB_INVALID_ADDRESS)
334 return code_addr;
335
336 if (target)
337 return target->GetCallableLoadAddress(code_addr, GetAddressClass());
338 return code_addr;
339}
340
341bool Address::SetCallableLoadAddress(lldb::addr_t load_addr, Target *target) {
342 if (SetLoadAddress(load_addr, target)) {
Greg Claytonf3ef3d22011-05-22 22:46:53 +0000343 if (target)
Kate Stoneb9c1b512016-09-06 20:57:50 +0000344 m_offset = target->GetCallableLoadAddress(m_offset, GetAddressClass());
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000345 return true;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000346 }
347 return false;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000348}
349
Kate Stoneb9c1b512016-09-06 20:57:50 +0000350addr_t Address::GetOpcodeLoadAddress(Target *target,
351 AddressClass addr_class) const {
352 addr_t code_addr = GetLoadAddress(target);
353 if (code_addr != LLDB_INVALID_ADDRESS) {
Tatyana Krasnukha04803b32018-06-26 13:06:54 +0000354 if (addr_class == AddressClass::eInvalid)
Kate Stoneb9c1b512016-09-06 20:57:50 +0000355 addr_class = GetAddressClass();
356 code_addr = target->GetOpcodeLoadAddress(code_addr, addr_class);
357 }
358 return code_addr;
Greg Claytonb35db632013-11-09 00:03:31 +0000359}
360
Kate Stoneb9c1b512016-09-06 20:57:50 +0000361bool Address::SetOpcodeLoadAddress(lldb::addr_t load_addr, Target *target,
Pavel Labathc3c72122017-06-08 13:26:35 +0000362 AddressClass addr_class,
363 bool allow_section_end) {
364 if (SetLoadAddress(load_addr, target, allow_section_end)) {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000365 if (target) {
Tatyana Krasnukha04803b32018-06-26 13:06:54 +0000366 if (addr_class == AddressClass::eInvalid)
Kate Stoneb9c1b512016-09-06 20:57:50 +0000367 addr_class = GetAddressClass();
368 m_offset = target->GetOpcodeLoadAddress(m_offset, addr_class);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000369 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000370 return true;
371 }
372 return false;
Greg Clayton7e9b1fd2011-08-12 21:40:01 +0000373}
374
Kate Stoneb9c1b512016-09-06 20:57:50 +0000375bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style,
376 DumpStyle fallback_style, uint32_t addr_size) const {
377 // If the section was nullptr, only load address is going to work unless we
Adrian Prantl05097242018-04-30 16:49:04 +0000378 // are trying to deref a pointer
Kate Stoneb9c1b512016-09-06 20:57:50 +0000379 SectionSP section_sp(GetSection());
380 if (!section_sp && style != DumpStyleResolvedPointerDescription)
381 style = DumpStyleLoadAddress;
Greg Clayton7e9b1fd2011-08-12 21:40:01 +0000382
Kate Stoneb9c1b512016-09-06 20:57:50 +0000383 ExecutionContext exe_ctx(exe_scope);
384 Target *target = exe_ctx.GetTargetPtr();
Adrian Prantl05097242018-04-30 16:49:04 +0000385 // If addr_byte_size is UINT32_MAX, then determine the correct address byte
386 // size for the process or default to the size of addr_t
Kate Stoneb9c1b512016-09-06 20:57:50 +0000387 if (addr_size == UINT32_MAX) {
388 if (target)
389 addr_size = target->GetArchitecture().GetAddressByteSize();
390 else
391 addr_size = sizeof(addr_t);
392 }
Greg Clayton7e9b1fd2011-08-12 21:40:01 +0000393
Kate Stoneb9c1b512016-09-06 20:57:50 +0000394 Address so_addr;
395 switch (style) {
396 case DumpStyleInvalid:
Greg Clayton7e9b1fd2011-08-12 21:40:01 +0000397 return false;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000398
399 case DumpStyleSectionNameOffset:
400 if (section_sp) {
401 section_sp->DumpName(s);
402 s->Printf(" + %" PRIu64, m_offset);
403 } else {
404 s->Address(m_offset, addr_size);
405 }
406 break;
407
408 case DumpStyleSectionPointerOffset:
409 s->Printf("(Section *)%p + ", static_cast<void *>(section_sp.get()));
410 s->Address(m_offset, addr_size);
411 break;
412
413 case DumpStyleModuleWithFileAddress:
414 if (section_sp) {
415 ModuleSP module_sp = section_sp->GetModule();
416 if (module_sp)
417 s->Printf("%s[", module_sp->GetFileSpec().GetFilename().AsCString(
418 "<Unknown>"));
419 else
420 s->Printf("%s[", "<Unknown>");
421 }
422 LLVM_FALLTHROUGH;
423 case DumpStyleFileAddress: {
424 addr_t file_addr = GetFileAddress();
425 if (file_addr == LLDB_INVALID_ADDRESS) {
426 if (fallback_style != DumpStyleInvalid)
427 return Dump(s, exe_scope, fallback_style, DumpStyleInvalid, addr_size);
428 return false;
429 }
430 s->Address(file_addr, addr_size);
431 if (style == DumpStyleModuleWithFileAddress && section_sp)
432 s->PutChar(']');
433 } break;
434
435 case DumpStyleLoadAddress: {
436 addr_t load_addr = GetLoadAddress(target);
437
438 /*
439 * MIPS:
440 * Display address in compressed form for MIPS16 or microMIPS
Tatyana Krasnukha04803b32018-06-26 13:06:54 +0000441 * if the address belongs to AddressClass::eCodeAlternateISA.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000442 */
443 if (target) {
444 const llvm::Triple::ArchType llvm_arch =
445 target->GetArchitecture().GetMachine();
446 if (llvm_arch == llvm::Triple::mips ||
447 llvm_arch == llvm::Triple::mipsel ||
448 llvm_arch == llvm::Triple::mips64 ||
449 llvm_arch == llvm::Triple::mips64el)
450 load_addr = GetCallableLoadAddress(target);
451 }
452
453 if (load_addr == LLDB_INVALID_ADDRESS) {
454 if (fallback_style != DumpStyleInvalid)
455 return Dump(s, exe_scope, fallback_style, DumpStyleInvalid, addr_size);
456 return false;
457 }
458 s->Address(load_addr, addr_size);
459 } break;
460
461 case DumpStyleResolvedDescription:
462 case DumpStyleResolvedDescriptionNoModule:
463 case DumpStyleResolvedDescriptionNoFunctionArguments:
464 case DumpStyleNoFunctionName:
465 if (IsSectionOffset()) {
466 uint32_t pointer_size = 4;
467 ModuleSP module_sp(GetModule());
468 if (target)
469 pointer_size = target->GetArchitecture().GetAddressByteSize();
470 else if (module_sp)
471 pointer_size = module_sp->GetArchitecture().GetAddressByteSize();
472
473 bool showed_info = false;
474 if (section_sp) {
475 SectionType sect_type = section_sp->GetType();
476 switch (sect_type) {
477 case eSectionTypeData:
478 if (module_sp) {
479 SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
480 if (sym_vendor) {
481 Symtab *symtab = sym_vendor->GetSymtab();
482 if (symtab) {
483 const addr_t file_Addr = GetFileAddress();
484 Symbol *symbol =
485 symtab->FindSymbolContainingFileAddress(file_Addr);
486 if (symbol) {
487 const char *symbol_name = symbol->GetName().AsCString();
488 if (symbol_name) {
489 s->PutCString(symbol_name);
490 addr_t delta =
491 file_Addr - symbol->GetAddressRef().GetFileAddress();
492 if (delta)
493 s->Printf(" + %" PRIu64, delta);
494 showed_info = true;
495 }
496 }
497 }
498 }
499 }
500 break;
501
502 case eSectionTypeDataCString:
503 // Read the C string from memory and display it
504 showed_info = true;
505 ReadCStringFromMemory(exe_scope, *this, s);
506 break;
507
508 case eSectionTypeDataCStringPointers:
509 if (ReadAddress(exe_scope, *this, pointer_size, so_addr)) {
510#if VERBOSE_OUTPUT
511 s->PutCString("(char *)");
512 so_addr.Dump(s, exe_scope, DumpStyleLoadAddress,
513 DumpStyleFileAddress);
514 s->PutCString(": ");
515#endif
516 showed_info = true;
517 ReadCStringFromMemory(exe_scope, so_addr, s);
518 }
519 break;
520
521 case eSectionTypeDataObjCMessageRefs:
522 if (ReadAddress(exe_scope, *this, pointer_size, so_addr)) {
523 if (target && so_addr.IsSectionOffset()) {
524 SymbolContext func_sc;
525 target->GetImages().ResolveSymbolContextForAddress(
526 so_addr, eSymbolContextEverything, func_sc);
527 if (func_sc.function != nullptr || func_sc.symbol != nullptr) {
528 showed_info = true;
529#if VERBOSE_OUTPUT
530 s->PutCString("(objc_msgref *) -> { (func*)");
531 so_addr.Dump(s, exe_scope, DumpStyleLoadAddress,
532 DumpStyleFileAddress);
533#else
534 s->PutCString("{ ");
535#endif
536 Address cstr_addr(*this);
537 cstr_addr.SetOffset(cstr_addr.GetOffset() + pointer_size);
538 func_sc.DumpStopContext(s, exe_scope, so_addr, true, true,
539 false, true, true);
540 if (ReadAddress(exe_scope, cstr_addr, pointer_size, so_addr)) {
541#if VERBOSE_OUTPUT
542 s->PutCString("), (char *)");
543 so_addr.Dump(s, exe_scope, DumpStyleLoadAddress,
544 DumpStyleFileAddress);
545 s->PutCString(" (");
546#else
547 s->PutCString(", ");
548#endif
549 ReadCStringFromMemory(exe_scope, so_addr, s);
550 }
551#if VERBOSE_OUTPUT
552 s->PutCString(") }");
553#else
554 s->PutCString(" }");
555#endif
556 }
557 }
558 }
559 break;
560
561 case eSectionTypeDataObjCCFStrings: {
562 Address cfstring_data_addr(*this);
563 cfstring_data_addr.SetOffset(cfstring_data_addr.GetOffset() +
564 (2 * pointer_size));
565 if (ReadAddress(exe_scope, cfstring_data_addr, pointer_size,
566 so_addr)) {
567#if VERBOSE_OUTPUT
568 s->PutCString("(CFString *) ");
569 cfstring_data_addr.Dump(s, exe_scope, DumpStyleLoadAddress,
570 DumpStyleFileAddress);
571 s->PutCString(" -> @");
572#else
573 s->PutChar('@');
574#endif
575 if (so_addr.Dump(s, exe_scope, DumpStyleResolvedDescription))
576 showed_info = true;
577 }
578 } break;
579
580 case eSectionTypeData4:
581 // Read the 4 byte data and display it
582 showed_info = true;
583 s->PutCString("(uint32_t) ");
584 DumpUInt(exe_scope, *this, 4, s);
585 break;
586
587 case eSectionTypeData8:
588 // Read the 8 byte data and display it
589 showed_info = true;
590 s->PutCString("(uint64_t) ");
591 DumpUInt(exe_scope, *this, 8, s);
592 break;
593
594 case eSectionTypeData16:
595 // Read the 16 byte data and display it
596 showed_info = true;
597 s->PutCString("(uint128_t) ");
598 DumpUInt(exe_scope, *this, 16, s);
599 break;
600
601 case eSectionTypeDataPointers:
602 // Read the pointer data and display it
603 if (ReadAddress(exe_scope, *this, pointer_size, so_addr)) {
604 s->PutCString("(void *)");
605 so_addr.Dump(s, exe_scope, DumpStyleLoadAddress,
606 DumpStyleFileAddress);
607
608 showed_info = true;
609 if (so_addr.IsSectionOffset()) {
610 SymbolContext pointer_sc;
611 if (target) {
612 target->GetImages().ResolveSymbolContextForAddress(
613 so_addr, eSymbolContextEverything, pointer_sc);
614 if (pointer_sc.function != nullptr ||
615 pointer_sc.symbol != nullptr) {
616 s->PutCString(": ");
617 pointer_sc.DumpStopContext(s, exe_scope, so_addr, true, false,
618 false, true, true);
619 }
620 }
621 }
622 }
623 break;
624
625 default:
626 break;
627 }
628 }
629
630 if (!showed_info) {
631 if (module_sp) {
632 SymbolContext sc;
633 module_sp->ResolveSymbolContextForAddress(
634 *this, eSymbolContextEverything, sc);
635 if (sc.function || sc.symbol) {
636 bool show_stop_context = true;
637 const bool show_module = (style == DumpStyleResolvedDescription);
638 const bool show_fullpaths = false;
639 const bool show_inlined_frames = true;
640 const bool show_function_arguments =
641 (style != DumpStyleResolvedDescriptionNoFunctionArguments);
642 const bool show_function_name = (style != DumpStyleNoFunctionName);
643 if (sc.function == nullptr && sc.symbol != nullptr) {
644 // If we have just a symbol make sure it is in the right section
645 if (sc.symbol->ValueIsAddress()) {
646 if (sc.symbol->GetAddressRef().GetSection() != GetSection()) {
647 // don't show the module if the symbol is a trampoline symbol
648 show_stop_context = false;
649 }
650 }
651 }
652 if (show_stop_context) {
Adrian Prantl05097242018-04-30 16:49:04 +0000653 // We have a function or a symbol from the same sections as this
654 // address.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000655 sc.DumpStopContext(s, exe_scope, *this, show_fullpaths,
656 show_module, show_inlined_frames,
657 show_function_arguments, show_function_name);
658 } else {
Adrian Prantl05097242018-04-30 16:49:04 +0000659 // We found a symbol but it was in a different section so it
660 // isn't the symbol we should be showing, just show the section
661 // name + offset
Kate Stoneb9c1b512016-09-06 20:57:50 +0000662 Dump(s, exe_scope, DumpStyleSectionNameOffset);
663 }
664 }
665 }
666 }
667 } else {
668 if (fallback_style != DumpStyleInvalid)
669 return Dump(s, exe_scope, fallback_style, DumpStyleInvalid, addr_size);
670 return false;
671 }
672 break;
673
674 case DumpStyleDetailedSymbolContext:
675 if (IsSectionOffset()) {
676 ModuleSP module_sp(GetModule());
677 if (module_sp) {
678 SymbolContext sc;
679 module_sp->ResolveSymbolContextForAddress(
680 *this, eSymbolContextEverything | eSymbolContextVariable, sc);
681 if (sc.symbol) {
Adrian Prantl05097242018-04-30 16:49:04 +0000682 // If we have just a symbol make sure it is in the same section as
683 // our address. If it isn't, then we might have just found the last
684 // symbol that came before the address that we are looking up that
685 // has nothing to do with our address lookup.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000686 if (sc.symbol->ValueIsAddress() &&
687 sc.symbol->GetAddressRef().GetSection() != GetSection())
688 sc.symbol = nullptr;
689 }
690 sc.GetDescription(s, eDescriptionLevelBrief, target);
691
692 if (sc.block) {
693 bool can_create = true;
694 bool get_parent_variables = true;
695 bool stop_if_block_is_inlined_function = false;
696 VariableList variable_list;
697 sc.block->AppendVariables(can_create, get_parent_variables,
698 stop_if_block_is_inlined_function,
699 [](Variable *) { return true; },
700 &variable_list);
701
702 const size_t num_variables = variable_list.GetSize();
703 for (size_t var_idx = 0; var_idx < num_variables; ++var_idx) {
704 Variable *var = variable_list.GetVariableAtIndex(var_idx).get();
705 if (var && var->LocationIsValidForAddress(*this)) {
706 s->Indent();
707 s->Printf(" Variable: id = {0x%8.8" PRIx64 "}, name = \"%s\"",
708 var->GetID(), var->GetName().GetCString());
709 Type *type = var->GetType();
710 if (type)
711 s->Printf(", type = \"%s\"", type->GetName().GetCString());
712 else
713 s->PutCString(", type = <unknown>");
714 s->PutCString(", location = ");
715 var->DumpLocationForAddress(s, *this);
716 s->PutCString(", decl = ");
717 var->GetDeclaration().DumpStopContext(s, false);
718 s->EOL();
719 }
720 }
721 }
722 }
723 } else {
724 if (fallback_style != DumpStyleInvalid)
725 return Dump(s, exe_scope, fallback_style, DumpStyleInvalid, addr_size);
726 return false;
727 }
728 break;
729
730 case DumpStyleResolvedPointerDescription: {
731 Process *process = exe_ctx.GetProcessPtr();
732 if (process) {
733 addr_t load_addr = GetLoadAddress(target);
734 if (load_addr != LLDB_INVALID_ADDRESS) {
Zachary Turner97206d52017-05-12 04:51:55 +0000735 Status memory_error;
Kate Stoneb9c1b512016-09-06 20:57:50 +0000736 addr_t dereferenced_load_addr =
737 process->ReadPointerFromMemory(load_addr, memory_error);
738 if (dereferenced_load_addr != LLDB_INVALID_ADDRESS) {
739 Address dereferenced_addr;
740 if (dereferenced_addr.SetLoadAddress(dereferenced_load_addr,
741 target)) {
742 StreamString strm;
743 if (dereferenced_addr.Dump(&strm, exe_scope,
744 DumpStyleResolvedDescription,
745 DumpStyleInvalid, addr_size)) {
746 s->Address(dereferenced_load_addr, addr_size, " -> ", " ");
Zachary Turnerc1564272016-11-16 21:15:24 +0000747 s->Write(strm.GetString().data(), strm.GetSize());
Kate Stoneb9c1b512016-09-06 20:57:50 +0000748 return true;
749 }
750 }
751 }
752 }
753 }
754 if (fallback_style != DumpStyleInvalid)
755 return Dump(s, exe_scope, fallback_style, DumpStyleInvalid, addr_size);
756 return false;
757 } break;
758 }
759
760 return true;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000761}
762
Kate Stoneb9c1b512016-09-06 20:57:50 +0000763bool Address::SectionWasDeleted() const {
Davide Italianoae3f7932018-09-10 23:09:09 +0000764 if (GetSection())
765 return false;
766 return SectionWasDeletedPrivate();
767}
768
769bool Address::SectionWasDeletedPrivate() const {
Kate Stoneb9c1b512016-09-06 20:57:50 +0000770 lldb::SectionWP empty_section_wp;
771
772 // If either call to "std::weak_ptr::owner_before(...) value returns true,
Adrian Prantl05097242018-04-30 16:49:04 +0000773 // this indicates that m_section_wp once contained (possibly still does) a
774 // reference to a valid shared pointer. This helps us know if we had a valid
775 // reference to a section which is now invalid because the module it was in
776 // was unloaded/deleted, or if the address doesn't have a valid reference to
777 // a section.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000778 return empty_section_wp.owner_before(m_section_wp) ||
779 m_section_wp.owner_before(empty_section_wp);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000780}
781
Kate Stoneb9c1b512016-09-06 20:57:50 +0000782uint32_t Address::CalculateSymbolContext(SymbolContext *sc,
783 uint32_t resolve_scope) const {
784 sc->Clear(false);
785 // Absolute addresses don't have enough information to reconstruct even their
786 // target.
787
788 SectionSP section_sp(GetSection());
789 if (section_sp) {
790 ModuleSP module_sp(section_sp->GetModule());
791 if (module_sp) {
792 sc->module_sp = module_sp;
793 if (sc->module_sp)
794 return sc->module_sp->ResolveSymbolContextForAddress(
795 *this, resolve_scope, *sc);
796 }
797 }
798 return 0;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000799}
800
Kate Stoneb9c1b512016-09-06 20:57:50 +0000801ModuleSP Address::CalculateSymbolContextModule() const {
802 SectionSP section_sp(GetSection());
803 if (section_sp)
804 return section_sp->GetModule();
805 return ModuleSP();
806}
807
808CompileUnit *Address::CalculateSymbolContextCompileUnit() const {
809 SectionSP section_sp(GetSection());
810 if (section_sp) {
811 SymbolContext sc;
812 sc.module_sp = section_sp->GetModule();
813 if (sc.module_sp) {
814 sc.module_sp->ResolveSymbolContextForAddress(*this,
815 eSymbolContextCompUnit, sc);
816 return sc.comp_unit;
817 }
818 }
819 return nullptr;
820}
821
822Function *Address::CalculateSymbolContextFunction() const {
823 SectionSP section_sp(GetSection());
824 if (section_sp) {
825 SymbolContext sc;
826 sc.module_sp = section_sp->GetModule();
827 if (sc.module_sp) {
828 sc.module_sp->ResolveSymbolContextForAddress(*this,
829 eSymbolContextFunction, sc);
830 return sc.function;
831 }
832 }
833 return nullptr;
834}
835
836Block *Address::CalculateSymbolContextBlock() const {
837 SectionSP section_sp(GetSection());
838 if (section_sp) {
839 SymbolContext sc;
840 sc.module_sp = section_sp->GetModule();
841 if (sc.module_sp) {
842 sc.module_sp->ResolveSymbolContextForAddress(*this, eSymbolContextBlock,
843 sc);
844 return sc.block;
845 }
846 }
847 return nullptr;
848}
849
850Symbol *Address::CalculateSymbolContextSymbol() const {
851 SectionSP section_sp(GetSection());
852 if (section_sp) {
853 SymbolContext sc;
854 sc.module_sp = section_sp->GetModule();
855 if (sc.module_sp) {
856 sc.module_sp->ResolveSymbolContextForAddress(*this, eSymbolContextSymbol,
857 sc);
858 return sc.symbol;
859 }
860 }
861 return nullptr;
862}
863
864bool Address::CalculateSymbolContextLineEntry(LineEntry &line_entry) const {
865 SectionSP section_sp(GetSection());
866 if (section_sp) {
867 SymbolContext sc;
868 sc.module_sp = section_sp->GetModule();
869 if (sc.module_sp) {
870 sc.module_sp->ResolveSymbolContextForAddress(*this,
871 eSymbolContextLineEntry, sc);
872 if (sc.line_entry.IsValid()) {
873 line_entry = sc.line_entry;
874 return true;
875 }
876 }
877 }
878 line_entry.Clear();
879 return false;
880}
881
882int Address::CompareFileAddress(const Address &a, const Address &b) {
883 addr_t a_file_addr = a.GetFileAddress();
884 addr_t b_file_addr = b.GetFileAddress();
885 if (a_file_addr < b_file_addr)
886 return -1;
887 if (a_file_addr > b_file_addr)
888 return +1;
889 return 0;
890}
891
892int Address::CompareLoadAddress(const Address &a, const Address &b,
893 Target *target) {
894 assert(target != nullptr);
895 addr_t a_load_addr = a.GetLoadAddress(target);
896 addr_t b_load_addr = b.GetLoadAddress(target);
897 if (a_load_addr < b_load_addr)
898 return -1;
899 if (a_load_addr > b_load_addr)
900 return +1;
901 return 0;
902}
903
904int Address::CompareModulePointerAndOffset(const Address &a, const Address &b) {
905 ModuleSP a_module_sp(a.GetModule());
906 ModuleSP b_module_sp(b.GetModule());
907 Module *a_module = a_module_sp.get();
908 Module *b_module = b_module_sp.get();
909 if (a_module < b_module)
910 return -1;
911 if (a_module > b_module)
912 return +1;
Adrian Prantl05097242018-04-30 16:49:04 +0000913 // Modules are the same, just compare the file address since they should be
914 // unique
Kate Stoneb9c1b512016-09-06 20:57:50 +0000915 addr_t a_file_addr = a.GetFileAddress();
916 addr_t b_file_addr = b.GetFileAddress();
917 if (a_file_addr < b_file_addr)
918 return -1;
919 if (a_file_addr > b_file_addr)
920 return +1;
921 return 0;
922}
923
924size_t Address::MemorySize() const {
Adrian Prantl05097242018-04-30 16:49:04 +0000925 // Noting special for the memory size of a single Address object, it is just
926 // the size of itself.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000927 return sizeof(Address);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000928}
929
Greg Claytonb0848c52011-01-08 00:05:12 +0000930//----------------------------------------------------------------------
Kate Stoneb9c1b512016-09-06 20:57:50 +0000931// NOTE: Be careful using this operator. It can correctly compare two
Adrian Prantl05097242018-04-30 16:49:04 +0000932// addresses from the same Module correctly. It can't compare two addresses
933// from different modules in any meaningful way, but it will compare the module
934// pointers.
Kate Stoneb9c1b512016-09-06 20:57:50 +0000935//
Greg Claytonb0848c52011-01-08 00:05:12 +0000936// To sum things up:
Adrian Prantl05097242018-04-30 16:49:04 +0000937// - works great for addresses within the same module - it works for addresses
938// across multiple modules, but don't expect the
Greg Claytonb0848c52011-01-08 00:05:12 +0000939// address results to make much sense
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000940//
Adrian Prantl05097242018-04-30 16:49:04 +0000941// This basically lets Address objects be used in ordered collection classes.
Greg Claytonb0848c52011-01-08 00:05:12 +0000942//----------------------------------------------------------------------
943
Kate Stoneb9c1b512016-09-06 20:57:50 +0000944bool lldb_private::operator<(const Address &lhs, const Address &rhs) {
945 ModuleSP lhs_module_sp(lhs.GetModule());
946 ModuleSP rhs_module_sp(rhs.GetModule());
947 Module *lhs_module = lhs_module_sp.get();
948 Module *rhs_module = rhs_module_sp.get();
949 if (lhs_module == rhs_module) {
950 // Addresses are in the same module, just compare the file addresses
951 return lhs.GetFileAddress() < rhs.GetFileAddress();
952 } else {
Adrian Prantl05097242018-04-30 16:49:04 +0000953 // The addresses are from different modules, just use the module pointer
954 // value to get consistent ordering
Kate Stoneb9c1b512016-09-06 20:57:50 +0000955 return lhs_module < rhs_module;
956 }
Greg Claytonb0848c52011-01-08 00:05:12 +0000957}
958
Kate Stoneb9c1b512016-09-06 20:57:50 +0000959bool lldb_private::operator>(const Address &lhs, const Address &rhs) {
960 ModuleSP lhs_module_sp(lhs.GetModule());
961 ModuleSP rhs_module_sp(rhs.GetModule());
962 Module *lhs_module = lhs_module_sp.get();
963 Module *rhs_module = rhs_module_sp.get();
964 if (lhs_module == rhs_module) {
965 // Addresses are in the same module, just compare the file addresses
966 return lhs.GetFileAddress() > rhs.GetFileAddress();
967 } else {
Adrian Prantl05097242018-04-30 16:49:04 +0000968 // The addresses are from different modules, just use the module pointer
969 // value to get consistent ordering
Kate Stoneb9c1b512016-09-06 20:57:50 +0000970 return lhs_module > rhs_module;
971 }
Greg Claytonb0848c52011-01-08 00:05:12 +0000972}
973
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000974// The operator == checks for exact equality only (same section, same offset)
Kate Stoneb9c1b512016-09-06 20:57:50 +0000975bool lldb_private::operator==(const Address &a, const Address &rhs) {
976 return a.GetOffset() == rhs.GetOffset() && a.GetSection() == rhs.GetSection();
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000977}
Eugene Zelenko896ddd02016-03-02 01:09:03 +0000978
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000979// The operator != checks for exact inequality only (differing section, or
980// different offset)
Kate Stoneb9c1b512016-09-06 20:57:50 +0000981bool lldb_private::operator!=(const Address &a, const Address &rhs) {
982 return a.GetOffset() != rhs.GetOffset() || a.GetSection() != rhs.GetSection();
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000983}
984
Kate Stoneb9c1b512016-09-06 20:57:50 +0000985AddressClass Address::GetAddressClass() const {
986 ModuleSP module_sp(GetModule());
987 if (module_sp) {
988 ObjectFile *obj_file = module_sp->GetObjectFile();
989 if (obj_file) {
990 // Give the symbol vendor a chance to add to the unified section list.
991 module_sp->GetSymbolVendor();
992 return obj_file->GetAddressClass(GetFileAddress());
Greg Claytonded470d2011-03-19 01:12:21 +0000993 }
Kate Stoneb9c1b512016-09-06 20:57:50 +0000994 }
Tatyana Krasnukha04803b32018-06-26 13:06:54 +0000995 return AddressClass::eUnknown;
Greg Claytonded470d2011-03-19 01:12:21 +0000996}
Greg Claytoncd482e32011-05-18 01:58:14 +0000997
Pavel Labathc3c72122017-06-08 13:26:35 +0000998bool Address::SetLoadAddress(lldb::addr_t load_addr, Target *target,
999 bool allow_section_end) {
1000 if (target && target->GetSectionLoadList().ResolveLoadAddress(
1001 load_addr, *this, allow_section_end))
Kate Stoneb9c1b512016-09-06 20:57:50 +00001002 return true;
1003 m_section_wp.reset();
1004 m_offset = load_addr;
1005 return false;
Greg Claytoncd482e32011-05-18 01:58:14 +00001006}