diff options
author | Greg Clayton <gclayton@apple.com> | 2013-09-18 20:03:31 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-09-18 20:03:31 +0000 |
commit | edfaae39562a9daa53cdb1e43efa764e00bd87df (patch) | |
tree | e404b43faa11b098bc38199066a8630eb125edff /lldb | |
parent | 756e1ff67641dcd49ecebb365ddcc40997a7239e (diff) | |
download | bcm5719-llvm-edfaae39562a9daa53cdb1e43efa764e00bd87df.tar.gz bcm5719-llvm-edfaae39562a9daa53cdb1e43efa764e00bd87df.zip |
Fixed a logic error in Module::ResolveSymbolContextForAddress(). Asking an address if its offet is greater than zero doesn't actually correctly tell us wether the address is section offset or not. A symbol could be the first symbol in a section and its offset can be zero. Also, a non-section offset lldb_private::Address can have a NULL section and calling GetOffset() will return the absolute address. To really test if an address is section offset clients should use Address::IsSectionOffset(). Also simplified the code that backs the address up by one to use the Address::Slide() function.
llvm-svn: 190955
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Core/Module.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index f010f39f8d4..a0f423cbb14 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -499,10 +499,10 @@ Module::ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve // symbol lookup for disassembly and unwind. if (resolve_scope & eSymbolContextSymbol && !(resolved_flags & eSymbolContextSymbol) && resolve_scope & eSymbolContextFunction && !(resolved_flags & eSymbolContextFunction) && - so_addr.GetOffset() > 0) + so_addr.IsSectionOffset()) { Address previous_addr = so_addr; - previous_addr.SetOffset(so_addr.GetOffset() - 1); + previous_addr.Slide(-1); const uint32_t flags = sym_vendor->ResolveSymbolContext (previous_addr, resolve_scope, sc); if (flags & eSymbolContextSymbol) |