[Lldb-commits] [lldb] r113895 - in /lldb/trunk: include/lldb/API/ include/lldb/Core/ include/lldb/Symbol/ include/lldb/Target/ lldb.xcodeproj/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Plugins/Disassembler/llvm/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/Process/MacOSX-User/source/ source/Plugins/Process/Utility/ source/Plugins/Process/gdb-remote/ source/Symbol/ source/Target/
Greg Clayton
gclayton at apple.com
Tue Sep 14 16:36:40 PDT 2010
Author: gclayton
Date: Tue Sep 14 18:36:40 2010
New Revision: 113895
URL: http://llvm.org/viewvc/llvm-project?rev=113895&view=rev
Log:
Moved the section load list up into the target so we can use the target
to symbolicate things without the need for a valid process subclass.
Modified:
lldb/trunk/include/lldb/API/SBAddress.h
lldb/trunk/include/lldb/API/SBTarget.h
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/include/lldb/Core/AddressRange.h
lldb/trunk/include/lldb/Core/Section.h
lldb/trunk/include/lldb/Core/ThreadSafeSTLMap.h
lldb/trunk/include/lldb/Symbol/Block.h
lldb/trunk/include/lldb/Symbol/Function.h
lldb/trunk/include/lldb/Symbol/LineEntry.h
lldb/trunk/include/lldb/Symbol/LineTable.h
lldb/trunk/include/lldb/Symbol/Symbol.h
lldb/trunk/include/lldb/Symbol/SymbolContext.h
lldb/trunk/include/lldb/Symbol/Symtab.h
lldb/trunk/include/lldb/Symbol/UnwindPlan.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SBAddress.cpp
lldb/trunk/source/API/SBBreakpoint.cpp
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
lldb/trunk/source/Commands/CommandObjectImage.cpp
lldb/trunk/source/Commands/CommandObjectThread.cpp
lldb/trunk/source/Core/Address.cpp
lldb/trunk/source/Core/AddressRange.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Core/Section.cpp
lldb/trunk/source/Core/Value.cpp
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Core/ValueObjectVariable.cpp
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Expression/ClangFunction.cpp
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp
lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
lldb/trunk/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Symbol/Block.cpp
lldb/trunk/source/Symbol/Function.cpp
lldb/trunk/source/Symbol/LineEntry.cpp
lldb/trunk/source/Symbol/LineTable.cpp
lldb/trunk/source/Symbol/Symbol.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/Symtab.cpp
lldb/trunk/source/Symbol/UnwindPlan.cpp
lldb/trunk/source/Symbol/Variable.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/StackFrame.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
lldb/trunk/source/Target/ThreadPlanStepRange.cpp
Modified: lldb/trunk/include/lldb/API/SBAddress.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBAddress.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBAddress.h (original)
+++ lldb/trunk/include/lldb/API/SBAddress.h Tue Sep 14 18:36:40 2010
@@ -39,7 +39,7 @@
GetFileAddress () const;
addr_t
- GetLoadAddress (const lldb::SBProcess &process) const;
+ GetLoadAddress (const lldb::SBTarget &target) const;
bool
OffsetAddress (addr_t offset);
Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Tue Sep 14 18:36:40 2010
@@ -143,6 +143,7 @@
#endif
protected:
+ friend class SBAddress;
friend class SBDebugger;
friend class SBProcess;
Modified: lldb/trunk/include/lldb/Core/Address.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Tue Sep 14 18:36:40 2010
@@ -197,7 +197,7 @@
CompareFileAddress (const Address& lhs, const Address& rhs);
static int
- CompareLoadAddress (const Address& lhs, const Address& rhs, Process *process);
+ CompareLoadAddress (const Address& lhs, const Address& rhs, Target *target);
static int
CompareModulePointerAndOffset (const Address& lhs, const Address& rhs);
@@ -291,7 +291,7 @@
/// the address is currently not loaded.
//------------------------------------------------------------------
lldb::addr_t
- GetLoadAddress (Process *process) const;
+ GetLoadAddress (Target *target) const;
//------------------------------------------------------------------
/// Get the section relative offset value.
Modified: lldb/trunk/include/lldb/Core/AddressRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressRange.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/AddressRange.h (original)
+++ lldb/trunk/include/lldb/Core/AddressRange.h Tue Sep 14 18:36:40 2010
@@ -163,7 +163,7 @@
/// in the address range, \b false otherwise.
//------------------------------------------------------------------
bool
- ContainsLoadAddress (const Address &so_addr, Process *process) const;
+ ContainsLoadAddress (const Address &so_addr, Target *target) const;
//------------------------------------------------------------------
/// Check if the resolved load address \a load_addr is contained
@@ -178,7 +178,7 @@
/// range, \b false otherwise.
//------------------------------------------------------------------
bool
- ContainsLoadAddress (lldb::addr_t load_addr, Process *process) const;
+ ContainsLoadAddress (lldb::addr_t load_addr, Target *target) const;
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
@@ -203,7 +203,7 @@
/// @see Address::DumpStyle
//------------------------------------------------------------------
bool
- Dump (Stream *s, Process *process, Address::DumpStyle style, Address::DumpStyle fallback_style = Address::DumpStyleInvalid) const;
+ Dump (Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style = Address::DumpStyleInvalid) const;
//------------------------------------------------------------------
/// Dump a debug description of this object to a Stream.
Modified: lldb/trunk/include/lldb/Core/Section.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Section.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Section.h (original)
+++ lldb/trunk/include/lldb/Core/Section.h Tue Sep 14 18:36:40 2010
@@ -46,7 +46,7 @@
ContainsSection(lldb::user_id_t sect_id) const;
void
- Dump (Stream *s, Process *process, bool show_header) const;
+ Dump (Stream *s, Target *target, bool show_header) const;
lldb::SectionSP
FindSectionByName (const ConstString §ion_dstr) const;
@@ -137,13 +137,13 @@
}
void
- Dump (Stream *s, Process *process) const;
+ Dump (Stream *s, Target *target) const;
void
DumpName (Stream *s) const;
lldb::addr_t
- GetLoadBaseAddress (Process *process) const;
+ GetLoadBaseAddress (Target *target) const;
bool
ResolveContainedAddress (lldb::addr_t offset, Address &so_addr) const;
Modified: lldb/trunk/include/lldb/Core/ThreadSafeSTLMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ThreadSafeSTLMap.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ThreadSafeSTLMap.h (original)
+++ lldb/trunk/include/lldb/Core/ThreadSafeSTLMap.h Tue Sep 14 18:36:40 2010
@@ -40,6 +40,13 @@
{
}
+ bool
+ IsEmpty() const
+ {
+ Mutex::Locker locker(m_mutex);
+ return m_collection.empty();
+ }
+
size_t
Erase (const _Key& key)
{
Modified: lldb/trunk/include/lldb/Symbol/Block.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Block.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Block.h (original)
+++ lldb/trunk/include/lldb/Symbol/Block.h Tue Sep 14 18:36:40 2010
@@ -188,7 +188,7 @@
GetDescription (Stream *s,
Function *function,
lldb::DescriptionLevel level,
- Process *process) const;
+ Target *target) const;
//------------------------------------------------------------------
/// Get the parent block.
Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Tue Sep 14 18:36:40 2010
@@ -487,7 +487,7 @@
GetCompileUnit() const;
void
- GetDescription(Stream *s, lldb::DescriptionLevel level, Process *process);
+ GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target);
//------------------------------------------------------------------
/// Get accessor for the frame base location.
Modified: lldb/trunk/include/lldb/Symbol/LineEntry.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/LineEntry.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/LineEntry.h (original)
+++ lldb/trunk/include/lldb/Symbol/LineEntry.h Tue Sep 14 18:36:40 2010
@@ -84,13 +84,13 @@
/// @see Address::DumpStyle
//------------------------------------------------------------------
bool
- Dump (Stream *s, Process *process, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const;
+ Dump (Stream *s, Target *target, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const;
bool
GetDescription (Stream *s,
lldb::DescriptionLevel level,
CompileUnit* cu,
- Process *process,
+ Target *target,
bool show_address_only) const;
//------------------------------------------------------------------
Modified: lldb/trunk/include/lldb/Symbol/LineTable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/LineTable.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/LineTable.h (original)
+++ lldb/trunk/include/lldb/Symbol/LineTable.h Tue Sep 14 18:36:40 2010
@@ -91,10 +91,10 @@
/// @see Address::DumpStyle
//------------------------------------------------------------------
void
- Dump (Stream *s, Process *process, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_line_ranges);
+ Dump (Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_line_ranges);
void
- GetDescription (Stream *s, Process *process, lldb::DescriptionLevel level);
+ GetDescription (Stream *s, Target *target, lldb::DescriptionLevel level);
//------------------------------------------------------------------
/// Find a line entry that contains the section offset address \a
Modified: lldb/trunk/include/lldb/Symbol/Symbol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symbol.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Symbol.h (original)
+++ lldb/trunk/include/lldb/Symbol/Symbol.h Tue Sep 14 18:36:40 2010
@@ -61,7 +61,7 @@
Compare (const ConstString& name, lldb::SymbolType type) const;
void
- Dump (Stream *s, Process *process, uint32_t index) const;
+ Dump (Stream *s, Target *target, uint32_t index) const;
AddressRange *
GetAddressRangePtr ();
@@ -109,7 +109,7 @@
SetFlags (uint32_t flags) { m_flags = flags; }
void
- GetDescription (Stream *s, lldb::DescriptionLevel level, Process *process) const;
+ GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const;
Function *
GetFunction ();
Modified: lldb/trunk/include/lldb/Symbol/SymbolContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolContext.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/SymbolContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolContext.h Tue Sep 14 18:36:40 2010
@@ -140,7 +140,7 @@
/// The stream to which to dump the object descripton.
//------------------------------------------------------------------
void
- Dump (Stream *s, Process *process) const;
+ Dump (Stream *s, Target *target) const;
//------------------------------------------------------------------
/// Dump the stop context in this object to a Stream.
@@ -190,7 +190,7 @@
void
GetDescription(Stream *s,
lldb::DescriptionLevel level,
- Process *process) const;
+ Target *target) const;
uint32_t
GetResolvedMask () const;
@@ -292,7 +292,7 @@
/// The stream to which to dump the object descripton.
//------------------------------------------------------------------
void
- Dump(Stream *s, Process *process) const;
+ Dump(Stream *s, Target *target) const;
//------------------------------------------------------------------
/// Get accessor for a symbol context at index \a idx.
Modified: lldb/trunk/include/lldb/Symbol/Symtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symtab.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Symtab.h (original)
+++ lldb/trunk/include/lldb/Symbol/Symtab.h Tue Sep 14 18:36:40 2010
@@ -41,8 +41,8 @@
Symbol * Resize (uint32_t count);
uint32_t AddSymbol(const Symbol& symbol);
size_t GetNumSymbols() const;
- void Dump(Stream *s, Process *process) const;
- void Dump(Stream *s, Process *process, std::vector<uint32_t>& indexes) const;
+ void Dump(Stream *s, Target *target) const;
+ void Dump(Stream *s, Target *target, std::vector<uint32_t>& indexes) const;
uint32_t GetIndexForSymbol (const Symbol *symbol) const;
Symbol * FindSymbolByID (lldb::user_id_t uid) const;
Symbol * SymbolAtIndex (uint32_t idx);
Modified: lldb/trunk/include/lldb/Symbol/UnwindPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/UnwindPlan.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/UnwindPlan.h (original)
+++ lldb/trunk/include/lldb/Symbol/UnwindPlan.h Tue Sep 14 18:36:40 2010
@@ -178,7 +178,7 @@
UnwindPlan () : m_register_kind(-1), m_row_list(), m_plan_valid_address_range() { }
- void Dump (Stream& s, Process* process, Thread* thread) const;
+ void Dump (Stream& s, Thread* thread) const;
void
AppendRow (const Row& row);
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Tue Sep 14 18:36:40 2010
@@ -24,7 +24,6 @@
#include "lldb/Core/Event.h"
#include "lldb/Core/StringList.h"
#include "lldb/Core/ThreadSafeValue.h"
-#include "lldb/Core/ThreadSafeSTLMap.h"
#include "lldb/Core/PluginInterface.h"
#include "lldb/Core/UserSettingsController.h"
#include "lldb/Breakpoint/BreakpointSiteList.h"
@@ -1459,27 +1458,6 @@
virtual DynamicLoader *
GetDynamicLoader ();
- lldb::addr_t
- GetSectionLoadAddress (const Section *section) const;
-
- bool
- ResolveLoadAddress (lldb::addr_t load_addr, Address &so_addr) const;
-
- bool
- SectionLoaded (const Section *section, lldb::addr_t load_addr);
-
- // The old load address should be specified when unloading to ensure we get
- // the correct instance of the section as a shared library could be loaded
- // at more than one location.
- bool
- SectionUnloaded (const Section *section, lldb::addr_t load_addr);
-
- // Unload all instances of a section. This function can be used on systems
- // that don't support multiple copies of the same shared library to be
- // loaded at the same time.
- size_t
- SectionUnloaded (const Section *section);
-
bool
IsRunning () const;
@@ -1521,12 +1499,10 @@
GetObjCObjectPrinter();
protected:
- typedef ThreadSafeSTLMap<lldb::addr_t, const Section *> SectionLoadColl;
//------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
Target & m_target; ///< The target that owns this process.
- SectionLoadColl m_section_load_info; ///< A mapping of all currently loaded sections.
ThreadSafeValue<lldb::StateType> m_public_state;
ThreadSafeValue<lldb::StateType> m_private_state; // The actual state of our process
Broadcaster m_private_state_broadcaster; // This broadcaster feeds state changed events into the private state thread's listener.
Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Tue Sep 14 18:36:40 2010
@@ -25,6 +25,7 @@
#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/PathMappingList.h"
+#include "lldb/Target/SectionLoadList.h"
#include "lldb/API/SBTarget.h"
@@ -290,6 +291,20 @@
size_t dst_len,
Error &error);
+
+
+ SectionLoadList&
+ GetSectionLoadList()
+ {
+ return m_section_load_list;
+ }
+
+ const SectionLoadList&
+ GetSectionLoadList() const
+ {
+ return m_section_load_list;
+ }
+
//------------------------------------------------------------------
// lldb::ExecutionContextScope pure virtual functions
//------------------------------------------------------------------
@@ -323,6 +338,7 @@
Debugger & m_debugger;
ArchSpec m_arch_spec;
ModuleList m_images; ///< The list of images for this process (shared libraries and anything dynamically loaded).
+ SectionLoadList m_section_load_list;
BreakpointList m_breakpoint_list;
BreakpointList m_internal_breakpoint_list;
// We want to tightly control the process destruction process so
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Sep 14 18:36:40 2010
@@ -14,6 +14,8 @@
2615DBCB1208B5FC0021781D /* StopInfoMachException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2615DBC91208B5FC0021781D /* StopInfoMachException.h */; };
261744781168585B005ADD65 /* SBType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261744771168585B005ADD65 /* SBType.cpp */; };
2617447A11685869005ADD65 /* SBType.h in Headers */ = {isa = PBXBuildFile; fileRef = 2617447911685869005ADD65 /* SBType.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2618D7901240115500F2B8FE /* SectionLoadList.h in Headers */ = {isa = PBXBuildFile; fileRef = 2618D78F1240115500F2B8FE /* SectionLoadList.h */; };
+ 2618D7921240116900F2B8FE /* SectionLoadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618D7911240116900F2B8FE /* SectionLoadList.cpp */; };
261B5A5411C3F2AD00AABD0A /* SharingPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */; };
261B5A5511C3F2AD00AABD0A /* SharingPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 261B5A5311C3F2AD00AABD0A /* SharingPtr.h */; settings = {ATTRIBUTES = (Public, ); }; };
262CFC7711A4510000946C6C /* debugserver in Resources */ = {isa = PBXBuildFile; fileRef = 26CE05A0115C31E50022F371 /* debugserver */; };
@@ -530,6 +532,8 @@
2615DBC91208B5FC0021781D /* StopInfoMachException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StopInfoMachException.h; path = Utility/StopInfoMachException.h; sourceTree = "<group>"; };
261744771168585B005ADD65 /* SBType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBType.cpp; path = source/API/SBType.cpp; sourceTree = "<group>"; };
2617447911685869005ADD65 /* SBType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBType.h; path = include/lldb/API/SBType.h; sourceTree = "<group>"; };
+ 2618D78F1240115500F2B8FE /* SectionLoadList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SectionLoadList.h; path = include/lldb/Target/SectionLoadList.h; sourceTree = "<group>"; };
+ 2618D7911240116900F2B8FE /* SectionLoadList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionLoadList.cpp; path = source/Target/SectionLoadList.cpp; sourceTree = "<group>"; };
261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharingPtr.cpp; path = source/Utility/SharingPtr.cpp; sourceTree = "<group>"; };
261B5A5311C3F2AD00AABD0A /* SharingPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharingPtr.h; path = include/lldb/Utility/SharingPtr.h; sourceTree = "<group>"; };
261E18CC1148966100BADCD3 /* GDBRemoteRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDBRemoteRegisterContext.h; path = "source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h"; sourceTree = "<group>"; };
@@ -1967,6 +1971,8 @@
26BC7F3610F1B90C00F91463 /* Process.cpp */,
26BC7DF410F1B81A00F91463 /* RegisterContext.h */,
26BC7F3710F1B90C00F91463 /* RegisterContext.cpp */,
+ 2618D78F1240115500F2B8FE /* SectionLoadList.h */,
+ 2618D7911240116900F2B8FE /* SectionLoadList.cpp */,
26BC7DF510F1B81A00F91463 /* StackFrame.h */,
26BC7F3810F1B90C00F91463 /* StackFrame.cpp */,
26BC7DF610F1B81A00F91463 /* StackFrameList.h */,
@@ -2271,6 +2277,7 @@
961FABEB1235F26800F93A47 /* UnwindAssemblyProfiler-x86.h in Headers */,
961FAC1F12360C7D00F93A47 /* ArchDefaultUnwindPlan-x86.h in Headers */,
268F9D53123AA15200B91E9B /* SBSymbolContextList.h in Headers */,
+ 2618D7901240115500F2B8FE /* SectionLoadList.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2325,6 +2332,7 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
@@ -2733,6 +2741,7 @@
69A01E251236C5D400C660B5 /* Symbols.cpp in Sources */,
69A01E261236C5D400C660B5 /* TimeValue.cpp in Sources */,
268F9D55123AA16600B91E9B /* SBSymbolContextList.cpp in Sources */,
+ 2618D7921240116900F2B8FE /* SectionLoadList.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: lldb/trunk/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAddress.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/API/SBAddress.cpp (original)
+++ lldb/trunk/source/API/SBAddress.cpp Tue Sep 14 18:36:40 2010
@@ -85,10 +85,10 @@
}
lldb::addr_t
-SBAddress::GetLoadAddress (const SBProcess &process) const
+SBAddress::GetLoadAddress (const SBTarget &target) const
{
if (m_opaque_ap.get())
- return m_opaque_ap->GetLoadAddress(process.get());
+ return m_opaque_ap->GetLoadAddress(target.get());
else
return LLDB_INVALID_ADDRESS;
}
Modified: lldb/trunk/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpoint.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpoint.cpp (original)
+++ lldb/trunk/source/API/SBBreakpoint.cpp Tue Sep 14 18:36:40 2010
@@ -134,8 +134,8 @@
if (vm_addr != LLDB_INVALID_ADDRESS)
{
Address address;
- Process *sb_process = m_opaque_sp->GetTarget().GetProcessSP().get();
- if (sb_process == NULL || sb_process->ResolveLoadAddress (vm_addr, address) == false)
+ Target &target = m_opaque_sp->GetTarget();
+ if (target.GetSectionLoadList().ResolveLoadAddress (vm_addr, address) == false)
{
address.SetSection (NULL);
address.SetOffset (vm_addr);
@@ -156,8 +156,8 @@
if (vm_addr != LLDB_INVALID_ADDRESS)
{
Address address;
- Process *sb_process = m_opaque_sp->GetTarget().GetProcessSP().get();
- if (sb_process == NULL || sb_process->ResolveLoadAddress (vm_addr, address) == false)
+ Target &target = m_opaque_sp->GetTarget();
+ if (target.GetSectionLoadList().ResolveLoadAddress (vm_addr, address) == false)
{
address.SetSection (NULL);
address.SetOffset (vm_addr);
Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Tue Sep 14 18:36:40 2010
@@ -132,7 +132,7 @@
SBFrame::GetPC () const
{
if (m_opaque_sp)
- return m_opaque_sp->GetFrameCodeAddress().GetLoadAddress (&m_opaque_sp->GetThread().GetProcess());
+ return m_opaque_sp->GetFrameCodeAddress().GetLoadAddress (&m_opaque_sp->GetThread().GetProcess().GetTarget());
return LLDB_INVALID_ADDRESS;
}
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Tue Sep 14 18:36:40 2010
@@ -399,6 +399,7 @@
// Make sure the process object is alive if we have one (it might be
// created but we might not be launched yet).
+
Process *process = m_opaque_sp->GetProcessSP().get();
if (process && !process->IsAlive())
process = NULL;
@@ -410,11 +411,11 @@
if (!module_sp->ResolveFileAddress (start_addr, range.GetBaseAddress()))
range.GetBaseAddress().SetOffset(start_addr);
}
- else if (process)
+ else if (m_opaque_sp->GetSectionLoadList().IsEmpty() == false)
{
// We don't have a module, se we need to figure out if "start_addr"
// resolves to anything in a running process.
- if (!process->ResolveLoadAddress(start_addr, range.GetBaseAddress()))
+ if (!m_opaque_sp->GetSectionLoadList().ResolveLoadAddress (start_addr, range.GetBaseAddress()))
range.GetBaseAddress().SetOffset(start_addr);
}
else
Modified: lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointLocation.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointLocation.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointLocation.cpp Tue Sep 14 18:36:40 2010
@@ -35,7 +35,7 @@
lldb::tid_t tid,
bool hardware
) :
- StoppointLocation (loc_id, addr.GetLoadAddress(owner.GetTarget().GetProcessSP().get()), hardware),
+ StoppointLocation (loc_id, addr.GetLoadAddress(&owner.GetTarget()), hardware),
m_address (addr),
m_owner (owner),
m_options_ap (),
@@ -52,7 +52,7 @@
lldb::addr_t
BreakpointLocation::GetLoadAddress () const
{
- return m_address.GetLoadAddress(m_owner.GetTarget().GetProcessSP().get());
+ return m_address.GetLoadAddress(&m_owner.GetTarget());
}
Address &
@@ -223,10 +223,13 @@
if (m_bp_site_sp)
return true;
- Process* process = m_owner.GetTarget().GetProcessSP().get();
+ Process *process = m_owner.GetTarget().GetProcessSP().get();
if (process == NULL)
return false;
+ if (m_owner.GetTarget().GetSectionLoadList().IsEmpty())
+ return false;
+
BreakpointLocationSP myself_sp(m_owner.GetLocationSP (this));
lldb::break_id_t new_id = process->CreateBreakpointSite (myself_sp, false);
@@ -236,7 +239,7 @@
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS);
if (log)
log->Warning ("Tried to add breakpoint site at 0x%llx but it was already present.\n",
- m_address.GetLoadAddress(process));
+ m_address.GetLoadAddress(&m_owner.GetTarget()));
return false;
}
@@ -384,7 +387,7 @@
"hw_index = %i hit_count = %-4u ignore_count = %-4u",
GetID(),
GetOptionsNoCreate()->GetThreadSpecNoCreate()->GetTID(),
- (uint64_t) m_address.GetLoadAddress(m_owner.GetTarget().GetProcessSP().get()),
+ (uint64_t) m_address.GetLoadAddress (&m_owner.GetTarget()),
(m_options_ap.get() ? m_options_ap->IsEnabled() : m_owner.IsEnabled()) ? "enabled " : "disabled",
IsHardware() ? "hardware" : "software",
GetHardwareIndex(),
Modified: lldb/trunk/source/Commands/CommandObjectImage.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectImage.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectImage.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectImage.cpp Tue Sep 14 18:36:40 2010
@@ -87,7 +87,7 @@
LineTable *line_table = sc.comp_unit->GetLineTable();
if (line_table)
line_table->GetDescription (&strm,
- interpreter.GetDebugger().GetExecutionContext().process,
+ interpreter.GetDebugger().GetExecutionContext().target,
lldb::eDescriptionLevelBrief);
else
strm << "No line table";
@@ -165,7 +165,7 @@
{
Symtab *symtab = objfile->GetSymtab();
if (symtab)
- symtab->Dump(&strm, interpreter.GetDebugger().GetExecutionContext().process);
+ symtab->Dump(&strm, interpreter.GetDebugger().GetExecutionContext().target);
}
}
}
@@ -180,7 +180,7 @@
{
SectionList *section_list = objfile->GetSectionList();
if (section_list)
- section_list->Dump(&strm, interpreter.GetDebugger().GetExecutionContext().process, true);
+ section_list->Dump(&strm, interpreter.GetDebugger().GetExecutionContext().target, true);
}
}
}
@@ -217,10 +217,10 @@
lldb::addr_t addr = raw_addr - offset;
Address so_addr;
SymbolContext sc;
- Process *process = interpreter.GetDebugger().GetExecutionContext().process;
- if (process && process->IsAlive())
+ Target *target = interpreter.GetDebugger().GetExecutionContext().target;
+ if (target && !target->GetSectionLoadList().IsEmpty())
{
- if (!process->ResolveLoadAddress (addr, so_addr))
+ if (!target->GetSectionLoadList().ResolveLoadAddress (addr, so_addr))
return false;
else if (so_addr.GetModule() != module)
return false;
@@ -299,7 +299,7 @@
{
Symbol *symbol = symtab->SymbolAtIndex(match_indexes[i]);
strm.Indent ();
- symbol->Dump (&strm, interpreter.GetDebugger().GetExecutionContext().process, i);
+ symbol->Dump (&strm, interpreter.GetDebugger().GetExecutionContext().target, i);
}
strm.IndentLess ();
return num_matches;
@@ -328,8 +328,7 @@
{
if (sc.line_entry.range.GetBaseAddress().IsValid())
{
- lldb::addr_t vm_addr =
- sc.line_entry.range.GetBaseAddress().GetLoadAddress(interpreter.GetDebugger().GetExecutionContext().process);
+ lldb::addr_t vm_addr = sc.line_entry.range.GetBaseAddress().GetLoadAddress(interpreter.GetDebugger().GetExecutionContext().target);
int addr_size = sizeof (addr_t);
Process *process = interpreter.GetDebugger().GetExecutionContext().process;
if (process)
Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Tue Sep 14 18:36:40 2010
@@ -1067,7 +1067,8 @@
{
bool synchronous_execution = interpreter.GetSynchronous ();
- if (!interpreter.GetDebugger().GetSelectedTarget().get())
+ Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
+ if (target == NULL)
{
result.AppendError ("invalid target, set executable file using 'file' command");
result.SetStatus (eReturnStatusFailed);
@@ -1166,7 +1167,7 @@
if (index_ptr == UINT32_MAX)
break;
- addr_t address = line_entry.range.GetBaseAddress().GetLoadAddress(process);
+ addr_t address = line_entry.range.GetBaseAddress().GetLoadAddress(target);
if (address != LLDB_INVALID_ADDRESS)
address_list.push_back (address);
index_ptr++;
Modified: lldb/trunk/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Tue Sep 14 18:36:40 2010
@@ -11,6 +11,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
@@ -138,27 +139,30 @@
addr_t deref_addr = ReadUIntMax64 (exe_scope, address, pointer_size, success);
if (success)
{
- Process *process = exe_scope->CalculateProcess();
- if (process && process->IsAlive())
+ ExecutionContext exe_ctx;
+ exe_scope->Calculate(exe_ctx);
+ // If we have any sections that are loaded, try and resolve using the
+ // section load list
+ if (exe_ctx.target && !exe_ctx.target->GetSectionLoadList().IsEmpty())
{
- if (!process->ResolveLoadAddress (deref_addr, deref_so_addr))
- {
- deref_so_addr.SetSection(NULL);
- deref_so_addr.SetOffset(deref_addr);
- }
+ if (exe_ctx.target->GetSectionLoadList().ResolveLoadAddress (deref_addr, deref_so_addr))
+ return true;
}
else
{
- Target *target = exe_scope->CalculateTarget();
- if (target == NULL)
- return false;
-
- if (!target->GetImages().ResolveFileAddress(deref_addr, deref_so_addr))
- {
- deref_so_addr.SetSection(NULL);
- deref_so_addr.SetOffset(deref_addr);
- }
+ // If we were not running, yet able to read an integer, we must
+ // have a module
+ Module *module = address.GetModule();
+ assert (module);
+ if (module->ResolveFileAddress(deref_addr, deref_so_addr))
+ return true;
}
+
+ // We couldn't make "deref_addr" into a section offset value, but we were
+ // able to read the address, so we return a section offset address with
+ // no section and "deref_addr" as the offset (address).
+ deref_so_addr.SetSection(NULL);
+ deref_so_addr.SetOffset(deref_addr);
return true;
}
return false;
@@ -334,27 +338,28 @@
}
addr_t
-Address::GetLoadAddress (Process *process) const
+Address::GetLoadAddress (Target *target) const
{
- if (m_section != NULL)
+ if (m_section == NULL)
{
- if (process)
- {
- addr_t sect_load_addr = m_section->GetLoadBaseAddress (process);
+ // No section, we just return the offset since it is the value in this case
+ return m_offset;
+ }
+
+ if (target)
+ {
+ addr_t sect_load_addr = m_section->GetLoadBaseAddress (target);
- if (sect_load_addr != LLDB_INVALID_ADDRESS)
- {
- // We have a valid file range, so we can return the file based
- // address by adding the file base address to our offset
- return sect_load_addr + m_offset;
- }
+ if (sect_load_addr != LLDB_INVALID_ADDRESS)
+ {
+ // We have a valid file range, so we can return the file based
+ // address by adding the file base address to our offset
+ return sect_load_addr + m_offset;
}
- // The section isn't resolved or no process was supplied so we can't
- // return a valid file address.
- return LLDB_INVALID_ADDRESS;
}
- // No section, we just return the offset since it is the value in this case
- return m_offset;
+ // The section isn't resolved or no process was supplied so we can't
+ // return a valid file address.
+ return LLDB_INVALID_ADDRESS;
}
bool
@@ -424,7 +429,7 @@
case DumpStyleLoadAddress:
{
- addr_t load_addr = GetLoadAddress (process);
+ addr_t load_addr = GetLoadAddress (target);
if (load_addr == LLDB_INVALID_ADDRESS)
{
if (fallback_style != DumpStyleInvalid)
@@ -440,7 +445,7 @@
if (IsSectionOffset())
{
lldb::AddressType addr_type = eAddressTypeLoad;
- addr_t addr = GetLoadAddress (process);
+ addr_t addr = GetLoadAddress (target);
if (addr == LLDB_INVALID_ADDRESS)
{
addr = GetFileAddress();
@@ -670,7 +675,7 @@
if (sc.symbol->GetAddressRangePtr() && sc.symbol->GetAddressRangePtr()->GetBaseAddress().GetSection() != GetSection())
sc.symbol = NULL;
}
- sc.GetDescription(s, eDescriptionLevelBrief, process);
+ sc.GetDescription(s, eDescriptionLevelBrief, target);
}
}
if (fallback_style != DumpStyleInvalid)
@@ -733,11 +738,11 @@
int
-Address::CompareLoadAddress (const Address& a, const Address& b, Process *process)
+Address::CompareLoadAddress (const Address& a, const Address& b, Target *target)
{
- assert (process != NULL);
- addr_t a_load_addr = a.GetLoadAddress (process);
- addr_t b_load_addr = b.GetLoadAddress (process);
+ assert (target != NULL);
+ addr_t a_load_addr = a.GetLoadAddress (target);
+ addr_t b_load_addr = b.GetLoadAddress (target);
if (a_load_addr < b_load_addr)
return -1;
if (a_load_addr > b_load_addr)
Modified: lldb/trunk/source/Core/AddressRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/AddressRange.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/AddressRange.cpp (original)
+++ lldb/trunk/source/Core/AddressRange.cpp Tue Sep 14 18:36:40 2010
@@ -11,6 +11,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/Stream.h"
#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
using namespace lldb;
using namespace lldb_private;
@@ -96,15 +97,15 @@
bool
-AddressRange::ContainsLoadAddress (const Address &addr, Process *process) const
+AddressRange::ContainsLoadAddress (const Address &addr, Target *target) const
{
if (addr.GetSection() == m_base_addr.GetSection())
return (addr.GetOffset() - m_base_addr.GetOffset()) < GetByteSize();
- addr_t load_base_addr = GetBaseAddress().GetLoadAddress(process);
+ addr_t load_base_addr = GetBaseAddress().GetLoadAddress(target);
if (load_base_addr == LLDB_INVALID_ADDRESS)
return false;
- addr_t load_addr = addr.GetLoadAddress(process);
+ addr_t load_addr = addr.GetLoadAddress(target);
if (load_addr == LLDB_INVALID_ADDRESS)
return false;
@@ -115,12 +116,12 @@
}
bool
-AddressRange::ContainsLoadAddress (addr_t load_addr, Process *process) const
+AddressRange::ContainsLoadAddress (addr_t load_addr, Target *target) const
{
if (load_addr == LLDB_INVALID_ADDRESS)
return false;
- addr_t load_base_addr = GetBaseAddress().GetLoadAddress(process);
+ addr_t load_base_addr = GetBaseAddress().GetLoadAddress(target);
if (load_base_addr == LLDB_INVALID_ADDRESS)
return false;
@@ -138,12 +139,12 @@
}
bool
-AddressRange::Dump(Stream *s, Process *process, Address::DumpStyle style, Address::DumpStyle fallback_style) const
+AddressRange::Dump(Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style) const
{
addr_t vmaddr = LLDB_INVALID_ADDRESS;
int addr_size = sizeof (addr_t);
- if (process)
- addr_size = process->GetAddressByteSize ();
+ if (target && target->GetProcessSP())
+ addr_size = target->GetProcessSP()->GetAddressByteSize ();
bool show_module = false;
switch (style)
@@ -153,7 +154,7 @@
case Address::DumpStyleSectionNameOffset:
case Address::DumpStyleSectionPointerOffset:
s->PutChar ('[');
- m_base_addr.Dump(s, process, style, fallback_style);
+ m_base_addr.Dump(s, target, style, fallback_style);
s->PutChar ('-');
s->Address (m_base_addr.GetOffset() + GetByteSize(), addr_size);
s->PutChar (')');
@@ -168,7 +169,7 @@
break;
case Address::DumpStyleLoadAddress:
- vmaddr = m_base_addr.GetLoadAddress(process);
+ vmaddr = m_base_addr.GetLoadAddress(target);
break;
}
@@ -185,7 +186,7 @@
}
else if (fallback_style != Address::DumpStyleInvalid)
{
- return Dump(s, process, fallback_style, Address::DumpStyleInvalid);
+ return Dump(s, target, fallback_style, Address::DumpStyleInvalid);
}
return false;
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Tue Sep 14 18:36:40 2010
@@ -155,17 +155,19 @@
// try and resolve it to something
if (range.GetBaseAddress().IsSectionOffset() == false)
{
- if (process && process->IsAlive())
+ if (exe_ctx.target)
{
- process->ResolveLoadAddress (range.GetBaseAddress().GetOffset(), range.GetBaseAddress());
- }
- else if (exe_ctx.target)
- {
- exe_ctx.target->GetImages().ResolveFileAddress (range.GetBaseAddress().GetOffset(), range.GetBaseAddress());
+ if (exe_ctx.target->GetSectionLoadList().IsEmpty())
+ {
+ exe_ctx.target->GetImages().ResolveFileAddress (range.GetBaseAddress().GetOffset(), range.GetBaseAddress());
+ }
+ else
+ {
+ exe_ctx.target->GetSectionLoadList().ResolveLoadAddress (range.GetBaseAddress().GetOffset(), range.GetBaseAddress());
+ }
}
}
-
DataExtractor data;
size_t bytes_disassembled = disassembler->ParseInstructions (&exe_ctx, range, data);
if (bytes_disassembled == 0)
Modified: lldb/trunk/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Section.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/Section.cpp (original)
+++ lldb/trunk/source/Core/Section.cpp Tue Sep 14 18:36:40 2010
@@ -10,7 +10,7 @@
#include "lldb/Core/Section.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
using namespace lldb;
using namespace lldb_private;
@@ -112,23 +112,23 @@
addr_t
-Section::GetLoadBaseAddress (Process *process) const
+Section::GetLoadBaseAddress (Target *target) const
{
addr_t load_base_addr = LLDB_INVALID_ADDRESS;
if (m_linked_section)
{
- load_base_addr = m_linked_section->GetLoadBaseAddress(process) + m_linked_offset;
+ load_base_addr = m_linked_section->GetLoadBaseAddress(target) + m_linked_offset;
}
else
if (m_parent)
{
- load_base_addr = m_parent->GetLoadBaseAddress (process);
+ load_base_addr = m_parent->GetLoadBaseAddress (target);
if (load_base_addr != LLDB_INVALID_ADDRESS)
load_base_addr += GetOffset();
}
else
{
- load_base_addr = process->GetSectionLoadAddress(this);
+ load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress (this);
}
return load_base_addr;
@@ -222,7 +222,7 @@
void
-Section::Dump(Stream *s, Process *process) const
+Section::Dump(Stream *s, Target *target) const
{
s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
@@ -234,12 +234,12 @@
s->Printf("%39s", "");
else
{
- if (process)
- addr = GetLoadBaseAddress (process);
+ if (target)
+ addr = GetLoadBaseAddress (target);
if (addr == LLDB_INVALID_ADDRESS)
{
- if (process)
+ if (target)
resolved = false;
addr = GetFileAddress();
}
@@ -258,16 +258,16 @@
{
addr = LLDB_INVALID_ADDRESS;
- if (process)
+ if (target)
{
- addr = m_linked_section->GetLoadBaseAddress(process);
+ addr = m_linked_section->GetLoadBaseAddress(target);
if (addr != LLDB_INVALID_ADDRESS)
addr += m_linked_offset;
}
if (addr == LLDB_INVALID_ADDRESS)
{
- if (process)
+ if (target)
resolved = false;
addr = m_linked_section->GetFileAddress() + m_linked_offset;
}
@@ -283,7 +283,7 @@
s->Printf(" + 0x%llx\n", m_linked_offset);
}
- m_children.Dump(s, process, false);
+ m_children.Dump(s, target, false);
}
void
@@ -668,7 +668,7 @@
}
void
-SectionList::Dump (Stream *s, Process *process, bool show_header) const
+SectionList::Dump (Stream *s, Target *target, bool show_header) const
{
if (show_header && !m_sections.empty())
{
@@ -678,7 +678,7 @@
s->IndentMore();
s->Printf("%*s", 2*(sizeof(void *) + 2), "");
s->Indent();
- s->Printf("SectID %s Address File Off. File Size Flags Section Name\n", process ? "Load" : "File");
+ s->Printf("SectID %s Address File Off. File Size Flags Section Name\n", (target && target->GetSectionLoadList().IsEmpty() == false) ? "Load" : "File");
s->Printf("%*s", 2*(sizeof(void *) + 2), "");
s->Indent();
s->PutCString("---------- --------------------------------------- ---------- ---------- ---------- ----------------------------\n");
@@ -689,7 +689,7 @@
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter)
{
- (*sect_iter)->Dump(s, process);
+ (*sect_iter)->Dump(s, target);
}
if (show_header && !m_sections.empty())
Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Tue Sep 14 18:36:40 2010
@@ -558,7 +558,7 @@
if (objfile)
{
Address so_addr(file_addr, objfile->GetSectionList());
- address = so_addr.GetLoadAddress (exe_ctx->process);
+ address = so_addr.GetLoadAddress (exe_ctx->target);
if (address != LLDB_INVALID_ADDRESS)
{
address_type = eAddressTypeLoad;
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Sep 14 18:36:40 2010
@@ -10,6 +10,8 @@
#include "lldb/Core/ValueObject.h"
// C Includes
+#include <stdlib.h>
+
// C++ Includes
// Other libraries and framework includes
#include "llvm/Support/raw_ostream.h"
@@ -27,8 +29,8 @@
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
-#include <stdlib.h>
using namespace lldb;
using namespace lldb_private;
@@ -495,10 +497,10 @@
case eAddressTypeLoad:
{
Address so_addr;
- Process *process = exe_scope->CalculateProcess();
- if (process != NULL)
+ Target *target = exe_scope->CalculateTarget();
+ if (target && target->GetSectionLoadList().IsEmpty() == false)
{
- if (process->ResolveLoadAddress(func_ptr_address, so_addr))
+ if (target->GetSectionLoadList().ResolveLoadAddress(func_ptr_address, so_addr))
{
so_addr.Dump (&sstr,
exe_scope,
Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Tue Sep 14 18:36:40 2010
@@ -110,7 +110,7 @@
SymbolContext sc;
variable->CalculateSymbolContext (&sc);
if (sc.function)
- loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.process);
+ loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.target);
}
Value old_value(m_value);
if (expr.Evaluate (&exe_ctx, GetClangAST(), loclist_base_load_addr, NULL, m_value, &m_error))
@@ -156,7 +156,7 @@
if (objfile)
{
Address so_addr(file_addr, objfile->GetSectionList());
- lldb::addr_t load_addr = so_addr.GetLoadAddress (exe_ctx.process);
+ lldb::addr_t load_addr = so_addr.GetLoadAddress (exe_ctx.target);
if (load_addr != LLDB_INVALID_ADDRESS)
{
m_value.SetValueType(Value::eValueTypeLoadAddress);
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Sep 14 18:36:40 2010
@@ -279,7 +279,7 @@
else
return false;
- ptr = fun_address->GetLoadAddress(m_exe_ctx->process);
+ ptr = fun_address->GetLoadAddress(m_exe_ctx->target);
return true;
}
@@ -886,7 +886,7 @@
{
SymbolContext var_sc;
var->CalculateSymbolContext (&var_sc);
- loclist_base_load_addr = var_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.process);
+ loclist_base_load_addr = var_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.target);
}
Error err;
@@ -929,7 +929,7 @@
Address so_addr(var_location->GetScalar().ULongLong(), object_file->GetSectionList());
- lldb::addr_t load_addr = so_addr.GetLoadAddress(m_exe_ctx->process);
+ lldb::addr_t load_addr = so_addr.GetLoadAddress(m_exe_ctx->target);
var_location->GetScalar() = load_addr;
var_location->SetValueType(Value::eValueTypeLoadAddress);
@@ -1062,7 +1062,7 @@
return;
}
- lldb::addr_t load_addr = fun_address->GetLoadAddress(m_exe_ctx->process);
+ lldb::addr_t load_addr = fun_address->GetLoadAddress(m_exe_ctx->target);
fun_location->SetValueType(Value::eValueTypeLoadAddress);
fun_location->GetScalar() = load_addr;
Modified: lldb/trunk/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangFunction.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangFunction.cpp (original)
+++ lldb/trunk/source/Expression/ClangFunction.cpp Tue Sep 14 18:36:40 2010
@@ -294,7 +294,7 @@
// FIXME: This is fake, and just assumes that it matches that architecture.
// Make a data extractor and put the address into the right byte order & size.
- uint64_t fun_addr = function_address.GetLoadAddress(exe_ctx.process);
+ uint64_t fun_addr = function_address.GetLoadAddress(exe_ctx.target);
int first_offset = m_member_offsets[0];
process->WriteMemory(args_addr_ref + first_offset, &fun_addr, 8, error);
Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Tue Sep 14 18:36:40 2010
@@ -139,14 +139,14 @@
int currentOpIndex = -1;
- lldb_private::Process *process = exe_ctx.process;
+ //lldb_private::Process *process = exe_ctx.process;
std::auto_ptr<RegisterReaderArg> rra;
if (!raw)
{
addr_t base_addr = LLDB_INVALID_ADDRESS;
- if (process && process->IsAlive())
- base_addr = inst_addr_ptr->GetLoadAddress (process);
+ if (exe_ctx.target && !exe_ctx.target->GetSectionLoadList().IsEmpty())
+ base_addr = inst_addr_ptr->GetLoadAddress (exe_ctx.target);
if (base_addr == LLDB_INVALID_ADDRESS)
base_addr = inst_addr_ptr->GetFileAddress ();
@@ -246,9 +246,9 @@
}
lldb_private::Address so_addr;
- if (process && process->IsAlive())
+ if (exe_ctx.target && !exe_ctx.target->GetSectionLoadList().IsEmpty())
{
- if (process->ResolveLoadAddress (operand_value, so_addr))
+ if (exe_ctx.target->GetSectionLoadList().ResolveLoadAddress (operand_value, so_addr))
so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset);
}
else if (inst_addr_ptr)
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Sep 14 18:36:40 2010
@@ -218,7 +218,7 @@
static ConstString g_dyld_all_image_infos ("dyld_all_image_infos");
const Symbol *symbol = dyld_module_sp->FindFirstSymbolWithNameAndType (g_dyld_all_image_infos, eSymbolTypeData);
if (symbol)
- m_dyld_all_image_infos_addr = symbol->GetValue().GetLoadAddress(m_process);
+ m_dyld_all_image_infos_addr = symbol->GetValue().GetLoadAddress(&m_process->GetTarget());
}
// Update all image infos
@@ -263,11 +263,11 @@
if (section)
{
const addr_t new_section_load_addr = section->GetFileAddress ();
- const addr_t old_section_load_addr = m_process->GetSectionLoadAddress (section);
+ const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section);
if (old_section_load_addr == LLDB_INVALID_ADDRESS ||
old_section_load_addr != new_section_load_addr)
{
- if (m_process->SectionLoaded (section, section->GetFileAddress ()))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress ()))
changed = true;
}
}
@@ -336,11 +336,11 @@
SectionSP section_sp(section_list->FindSectionByName(info.segments[i].name));
assert (section_sp.get() != NULL);
const addr_t new_section_load_addr = info.segments[i].addr + info.slide;
- const addr_t old_section_load_addr = m_process->GetSectionLoadAddress (section_sp.get());
+ const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp.get());
if (old_section_load_addr == LLDB_INVALID_ADDRESS ||
old_section_load_addr != new_section_load_addr)
{
- if (m_process->SectionLoaded (section_sp.get(), new_section_load_addr))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), new_section_load_addr))
changed = true;
}
}
@@ -372,7 +372,7 @@
SectionSP section_sp(section_list->FindSectionByName(info.segments[i].name));
assert (section_sp.get() != NULL);
const addr_t old_section_load_addr = info.segments[i].addr + info.slide;
- if (m_process->SectionUnloaded (section_sp.get(), old_section_load_addr))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionUnloaded (section_sp.get(), old_section_load_addr))
changed = true;
}
}
@@ -1008,7 +1008,7 @@
// breakpoint gets hit. We will use this to track when shared
// libraries get loaded/unloaded.
- if (m_process->ResolveLoadAddress(m_dyld_all_image_infos.notification, so_addr))
+ if (m_process->GetTarget().GetSectionLoadList().ResolveLoadAddress(m_dyld_all_image_infos.notification, so_addr))
{
Breakpoint *dyld_break = m_process->GetTarget().CreateBreakpoint (so_addr, true).get();
dyld_break->SetCallback (DynamicLoaderMacOSXDYLD::NotifyBreakpointHit, this, true);
@@ -1109,7 +1109,7 @@
if (target_symbols.GetContextAtIndex(i, context))
{
context.GetAddressRange (eSymbolContextEverything, addr_range);
- lldb::addr_t load_addr = addr_range.GetBaseAddress().GetLoadAddress(&(thread.GetProcess()));
+ lldb::addr_t load_addr = addr_range.GetBaseAddress().GetLoadAddress(&thread.GetProcess().GetTarget());
addresses[i] = load_addr;
}
}
Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp Tue Sep 14 18:36:40 2010
@@ -84,13 +84,14 @@
ConstString get_impl_name("class_getMethodImplementation");
ConstString get_impl_stret_name("class_getMethodImplementation_stret");
+ Target *target = m_process_sp ? &m_process_sp->GetTarget() : NULL;
const Symbol *class_getMethodImplementation = m_objc_module_sp->FindFirstSymbolWithNameAndType (get_impl_name, eSymbolTypeCode);
const Symbol *class_getMethodImplementation_stret = m_objc_module_sp->FindFirstSymbolWithNameAndType (get_impl_stret_name, eSymbolTypeCode);
if (class_getMethodImplementation)
- m_impl_fn_addr = class_getMethodImplementation->GetValue().GetLoadAddress(m_process_sp.get());
+ m_impl_fn_addr = class_getMethodImplementation->GetValue().GetLoadAddress(target);
if (class_getMethodImplementation_stret)
- m_impl_stret_fn_addr = class_getMethodImplementation_stret->GetValue().GetLoadAddress(m_process_sp.get());
+ m_impl_stret_fn_addr = class_getMethodImplementation_stret->GetValue().GetLoadAddress(target);
// FIXME: Do some kind of logging here.
if (m_impl_fn_addr == LLDB_INVALID_ADDRESS || m_impl_stret_fn_addr == LLDB_INVALID_ADDRESS)
@@ -111,7 +112,7 @@
// Problem is we also need to lookup the dispatch function. For now we could have a side table of stret & non-stret
// dispatch functions. If that's as complex as it gets, we're fine.
- lldb::addr_t sym_addr = msgSend_symbol->GetValue().GetLoadAddress(m_process_sp.get());
+ lldb::addr_t sym_addr = msgSend_symbol->GetValue().GetLoadAddress(target);
m_msgSend_map.insert(std::pair<lldb::addr_t, int>(sym_addr, i));
}
Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp Tue Sep 14 18:36:40 2010
@@ -115,7 +115,7 @@
lldb::addr_t dispatch_queue_offsets_addr = LLDB_INVALID_ADDRESS;
const Symbol *dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (ConstString("dispatch_queue_offsets"), eSymbolTypeData);
if (dispatch_queue_offsets_symbol)
- dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetValue().GetLoadAddress(&GetProcess());
+ dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetValue().GetLoadAddress(&m_process.GetTarget());
if (dispatch_queue_offsets_addr == LLDB_INVALID_ADDRESS)
return NULL;
Modified: lldb/trunk/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/MacOSXLibunwindCallbacks.cpp Tue Sep 14 18:36:40 2010
@@ -69,19 +69,20 @@
{
if (arg == 0)
return -1;
- Thread *th = (Thread *) arg;
+ Thread *thread = (Thread *) arg;
+ Target &target = thread->GetProcess().GetTarget();
Address addr;
- if (!th->GetProcess().ResolveLoadAddress(ip, addr))
+ if (!target.GetSectionLoadList().ResolveLoadAddress(ip, addr))
return -1;
SymbolContext sc;
- if (!th->GetProcess().GetTarget().GetImages().ResolveSymbolContextForAddress (addr, eSymbolContextFunction, sc))
+ if (!target.GetImages().ResolveSymbolContextForAddress (addr, eSymbolContextFunction, sc))
return -1;
if (!sc.symbol)
return -1;
strlcpy (bufp, sc.symbol->GetMangled().GetMangledName().AsCString(""), buf_len);
if (offp)
- *offp = addr.GetLoadAddress(&th->GetProcess()) - sc.symbol->GetValue().GetLoadAddress(&th->GetProcess());
+ *offp = addr.GetLoadAddress(&target) - sc.symbol->GetValue().GetLoadAddress(&target);
return UNW_ESUCCESS;
}
@@ -93,13 +94,14 @@
{
if (arg == 0)
return -1;
- Thread *th = (Thread *) arg;
+ Thread *thread = (Thread *) arg;
+ Target &target = thread->GetProcess().GetTarget();
Address addr;
- if (!th->GetProcess().ResolveLoadAddress(load_addr, addr))
+ if (!target.GetSectionLoadList().ResolveLoadAddress(load_addr, addr))
return -1;
SymbolContext sc;
- if (!th->GetProcess().GetTarget().GetImages().ResolveSymbolContextForAddress (addr, eSymbolContextModule, sc))
+ if (!target.GetImages().ResolveSymbolContextForAddress (addr, eSymbolContextModule, sc))
return -1;
SectionList *sl = sc.module_sp->GetObjectFile()->GetSectionList();
@@ -108,14 +110,14 @@
if (!text_segment_sp)
return -1;
- *mh = text_segment_sp->GetLoadBaseAddress (&th->GetProcess());
- *text_start = text_segment_sp->GetLoadBaseAddress (&th->GetProcess());
+ *mh = text_segment_sp->GetLoadBaseAddress (&target);
+ *text_start = text_segment_sp->GetLoadBaseAddress (&target);
*text_end = *text_start + text_segment_sp->GetByteSize();
static ConstString g_section_name_eh_frame ("__eh_frame");
SectionSP eh_frame_section_sp = text_segment_sp->GetChildren().FindSectionByName(g_section_name_eh_frame);
if (eh_frame_section_sp.get()) {
- *eh_frame = eh_frame_section_sp->GetLoadBaseAddress (&th->GetProcess());
+ *eh_frame = eh_frame_section_sp->GetLoadBaseAddress (&target);
*eh_frame_len = eh_frame_section_sp->GetByteSize();
} else {
*eh_frame = 0;
@@ -125,7 +127,7 @@
static ConstString g_section_name_unwind_info ("__unwind_info");
SectionSP unwind_info_section_sp = text_segment_sp->GetChildren().FindSectionByName(g_section_name_unwind_info);
if (unwind_info_section_sp.get()) {
- *compact_unwind_start = unwind_info_section_sp->GetLoadBaseAddress (&th->GetProcess());
+ *compact_unwind_start = unwind_info_section_sp->GetLoadBaseAddress (&target);
*compact_unwind_len = unwind_info_section_sp->GetByteSize();
} else {
*compact_unwind_start = 0;
@@ -139,17 +141,18 @@
{
if (arg == 0)
return -1;
- Thread *th = (Thread *) arg;
+ Thread *thread = (Thread *) arg;
+ Target &target = thread->GetProcess().GetTarget();
Address addr;
- if (!th->GetProcess().ResolveLoadAddress(ip, addr))
+ if (!target.GetSectionLoadList().ResolveLoadAddress(ip, addr))
return -1;
SymbolContext sc;
- if (!th->GetProcess().GetTarget().GetImages().ResolveSymbolContextForAddress (addr, eSymbolContextFunction | eSymbolContextSymbol, sc))
+ if (!target.GetImages().ResolveSymbolContextForAddress (addr, eSymbolContextFunction | eSymbolContextSymbol, sc))
return -1;
if (sc.function)
{
lldb::addr_t start, len;
- start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(&th->GetProcess());
+ start = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress(&target);
len = sc.function->GetAddressRange().GetByteSize();
if (start == LLDB_INVALID_ADDRESS || len == LLDB_INVALID_ADDRESS)
return -1;
@@ -160,7 +163,7 @@
if (sc.symbol)
{
lldb::addr_t start, len;
- start = sc.symbol->GetAddressRangeRef().GetBaseAddress().GetLoadAddress(&th->GetProcess());
+ start = sc.symbol->GetAddressRangeRef().GetBaseAddress().GetLoadAddress(&target);
len = sc.symbol->GetAddressRangeRef().GetByteSize();
if (start == LLDB_INVALID_ADDRESS)
return -1;
@@ -260,8 +263,9 @@
if (arg == 0)
return -1;
Thread *thread = (Thread *) arg;
-
- const ArchSpec::CPU arch_cpu = thread->GetProcess().GetTarget().GetArchitecture ().GetGenericCPUType();
+ Target &target = thread->GetProcess().GetTarget();
+
+ const ArchSpec::CPU arch_cpu = target.GetArchitecture ().GetGenericCPUType();
if (arch_cpu == ArchSpec::eCPU_i386)
{
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue Sep 14 18:36:40 2010
@@ -398,8 +398,7 @@
ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS, "error: failed to send packet: %s", packet.GetData());
}
return bytes_written;
- }
- //m_error.SetErrorString("Not connected.");
+ }
return 0;
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Sep 14 18:36:40 2010
@@ -2246,7 +2246,7 @@
const Symbol *dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (ConstString("dispatch_queue_offsets"), eSymbolTypeData);
if (dispatch_queue_offsets_symbol)
- m_dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetValue().GetLoadAddress(this);
+ m_dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetValue().GetLoadAddress(&m_target);
if (m_dispatch_queue_offsets_addr == LLDB_INVALID_ADDRESS)
return NULL;
Modified: lldb/trunk/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Block.cpp (original)
+++ lldb/trunk/source/Symbol/Block.cpp Tue Sep 14 18:36:40 2010
@@ -36,7 +36,7 @@
}
void
-Block::GetDescription(Stream *s, Function *function, lldb::DescriptionLevel level, Process *process) const
+Block::GetDescription(Stream *s, Function *function, lldb::DescriptionLevel level, Target *target) const
{
*s << "id = " << ((const UserID&)*this);
@@ -45,8 +45,8 @@
{
addr_t base_addr = LLDB_INVALID_ADDRESS;
- if (process)
- base_addr = function->GetAddressRange().GetBaseAddress().GetLoadAddress(process);
+ if (target)
+ base_addr = function->GetAddressRange().GetBaseAddress().GetLoadAddress(target);
if (base_addr == LLDB_INVALID_ADDRESS)
base_addr = function->GetAddressRange().GetBaseAddress().GetFileAddress();
Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Tue Sep 14 18:36:40 2010
@@ -326,7 +326,7 @@
void
-Function::GetDescription(Stream *s, lldb::DescriptionLevel level, Process *process)
+Function::GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target)
{
Type* func_type = GetType();
*s << "id = " << (const UserID&)*this << ", name = \"" << func_type->GetName() << "\", range = ";
@@ -336,7 +336,7 @@
fallback_style = Address::DumpStyleModuleWithFileAddress;
else
fallback_style = Address::DumpStyleFileAddress;
- GetAddressRange().Dump(s, process, Address::DumpStyleLoadAddress, fallback_style);
+ GetAddressRange().Dump(s, target, Address::DumpStyleLoadAddress, fallback_style);
}
void
Modified: lldb/trunk/source/Symbol/LineEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineEntry.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/LineEntry.cpp (original)
+++ lldb/trunk/source/Symbol/LineEntry.cpp Tue Sep 14 18:36:40 2010
@@ -10,6 +10,7 @@
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
using namespace lldb_private;
@@ -100,7 +101,7 @@
LineEntry::Dump
(
Stream *s,
- Process *process,
+ Target *target,
bool show_file,
Address::DumpStyle style,
Address::DumpStyle fallback_style,
@@ -110,14 +111,14 @@
if (show_range)
{
// Show address range
- if (!range.Dump(s, process, style, fallback_style))
+ if (!range.Dump(s, target, style, fallback_style))
return false;
}
else
{
// Show address only
if (!range.GetBaseAddress().Dump(s,
- process,
+ target,
style,
fallback_style))
return false;
@@ -146,18 +147,18 @@
}
bool
-LineEntry::GetDescription (Stream *s, lldb::DescriptionLevel level, CompileUnit* cu, Process *process, bool show_address_only) const
+LineEntry::GetDescription (Stream *s, lldb::DescriptionLevel level, CompileUnit* cu, Target *target, bool show_address_only) const
{
if (level == lldb::eDescriptionLevelBrief || level == lldb::eDescriptionLevelFull)
{
if (show_address_only)
{
- range.GetBaseAddress().Dump(s, process, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
+ range.GetBaseAddress().Dump(s, target, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
}
else
{
- range.Dump(s, process, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
+ range.Dump(s, target, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
}
*s << ": " << file;
@@ -195,7 +196,7 @@
}
else
{
- return Dump (s, process, true, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress, true);
+ return Dump (s, target, true, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress, true);
}
return true;
}
Modified: lldb/trunk/source/Symbol/LineTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineTable.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/LineTable.cpp (original)
+++ lldb/trunk/source/Symbol/LineTable.cpp Tue Sep 14 18:36:40 2010
@@ -387,7 +387,7 @@
}
void
-LineTable::Dump (Stream *s, Process *process, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_line_ranges)
+LineTable::Dump (Stream *s, Target *target, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_line_ranges)
{
const size_t count = m_entries.size();
LineEntry line_entry;
@@ -395,7 +395,7 @@
for (size_t idx = 0; idx < count; ++idx)
{
ConvertEntryAtIndexToLineEntry (idx, line_entry);
- line_entry.Dump (s, process, prev_file != line_entry.file, style, fallback_style, show_line_ranges);
+ line_entry.Dump (s, target, prev_file != line_entry.file, style, fallback_style, show_line_ranges);
s->EOL();
prev_file = line_entry.file;
}
@@ -403,14 +403,14 @@
void
-LineTable::GetDescription (Stream *s, Process *process, DescriptionLevel level)
+LineTable::GetDescription (Stream *s, Target *target, DescriptionLevel level)
{
const size_t count = m_entries.size();
LineEntry line_entry;
for (size_t idx = 0; idx < count; ++idx)
{
ConvertEntryAtIndexToLineEntry (idx, line_entry);
- line_entry.GetDescription (s, level, m_comp_unit, process, true);
+ line_entry.GetDescription (s, level, m_comp_unit, target, true);
s->EOL();
}
}
Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Tue Sep 14 18:36:40 2010
@@ -13,6 +13,7 @@
#include "lldb/Core/Section.h"
#include "lldb/Core/Stream.h"
#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
using namespace lldb;
using namespace lldb_private;
@@ -173,7 +174,7 @@
}
void
-Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Process *process) const
+Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const
{
*s << "id = " << (const UserID&)*this << ", name = \"" << m_mangled.GetName() << '"';
const Section *section = m_addr_range.GetBaseAddress().GetSection();
@@ -184,12 +185,12 @@
if (m_addr_range.GetByteSize() > 0)
{
s->PutCString (", range = ");
- m_addr_range.Dump(s, process, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
+ m_addr_range.Dump(s, target, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
}
else
{
s->PutCString (", address = ");
- m_addr_range.GetBaseAddress().Dump(s, process, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
+ m_addr_range.GetBaseAddress().Dump(s, target, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
}
}
else
@@ -203,7 +204,7 @@
}
void
-Symbol::Dump(Stream *s, Process *process, uint32_t index) const
+Symbol::Dump(Stream *s, Target *target, uint32_t index) const
{
// s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
// s->Indent();
@@ -224,7 +225,7 @@
s->PutChar(' ');
- if (!m_addr_range.GetBaseAddress().Dump(s, process, Address::DumpStyleLoadAddress))
+ if (!m_addr_range.GetBaseAddress().Dump(s, target, Address::DumpStyleLoadAddress))
s->Printf("%*s", 18, "");
const char *format = m_size_is_sibling ?
Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Tue Sep 14 18:36:40 2010
@@ -197,7 +197,7 @@
}
void
-SymbolContext::GetDescription(Stream *s, lldb::DescriptionLevel level, Process *process) const
+SymbolContext::GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target) const
{
if (module_sp)
{
@@ -219,7 +219,7 @@
if (function != NULL)
{
s->Indent(" Function: ");
- function->GetDescription (s, level, process);
+ function->GetDescription (s, level, target);
s->EOL();
Type *func_type = function->GetType();
@@ -251,7 +251,7 @@
s->Indent(" Blocks: ");
else
s->Indent(" ");
- (*pos)->GetDescription(s, function, level, process);
+ (*pos)->GetDescription(s, function, level, target);
s->EOL();
}
}
@@ -259,14 +259,14 @@
if (line_entry.IsValid())
{
s->Indent(" LineEntry: ");
- line_entry.GetDescription (s, level, comp_unit, process, false);
+ line_entry.GetDescription (s, level, comp_unit, target, false);
s->EOL();
}
if (symbol != NULL)
{
s->Indent(" Symbol: ");
- symbol->GetDescription(s, level, process);
+ symbol->GetDescription(s, level, target);
s->EOL();
}
}
@@ -287,7 +287,7 @@
void
-SymbolContext::Dump(Stream *s, Process *process) const
+SymbolContext::Dump(Stream *s, Target *target) const
{
*s << (void *)this << ": ";
s->Indent();
@@ -310,7 +310,7 @@
if (function != NULL)
{
*s << " {0x" << function->GetID() << "} " << function->GetType()->GetName() << ", address-range = ";
- function->GetAddressRange().Dump(s, process, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress);
+ function->GetAddressRange().Dump(s, target, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress);
s->EOL();
s->Indent();
Type* func_type = function->GetType();
@@ -331,7 +331,7 @@
s->EOL();
s->Indent();
*s << "LineEntry = ";
- line_entry.Dump (s, process, true, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress, true);
+ line_entry.Dump (s, target, true, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress, true);
s->EOL();
s->Indent();
*s << "Symbol = " << (void *)symbol;
@@ -494,7 +494,7 @@
}
void
-SymbolContextList::Dump(Stream *s, Process *process) const
+SymbolContextList::Dump(Stream *s, Target *target) const
{
*s << (void *)this << ": ";
@@ -506,7 +506,7 @@
collection::const_iterator pos, end = m_symbol_contexts.end();
for (pos = m_symbol_contexts.begin(); pos != end; ++pos)
{
- pos->Dump(s, process);
+ pos->Dump(s, target);
}
s->IndentLess();
}
Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Tue Sep 14 18:36:40 2010
@@ -62,7 +62,7 @@
}
void
-Symtab::Dump(Stream *s, Process *process) const
+Symtab::Dump(Stream *s, Target *target) const
{
const_iterator pos;
s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
@@ -92,14 +92,14 @@
for (pos = m_symbols.begin(); pos != end; ++pos)
{
s->Indent();
- pos->Dump(s, process, std::distance(begin, pos));
+ pos->Dump(s, target, std::distance(begin, pos));
}
}
s->IndentLess ();
}
void
-Symtab::Dump(Stream *s, Process *process, std::vector<uint32_t>& indexes) const
+Symtab::Dump(Stream *s, Target *target, std::vector<uint32_t>& indexes) const
{
const size_t num_symbols = GetNumSymbols();
s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
@@ -118,7 +118,7 @@
if (idx < num_symbols)
{
s->Indent();
- m_symbols[idx].Dump(s, process, idx);
+ m_symbols[idx].Dump(s, target, idx);
}
}
}
Modified: lldb/trunk/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/UnwindPlan.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/trunk/source/Symbol/UnwindPlan.cpp Tue Sep 14 18:36:40 2010
@@ -8,8 +8,9 @@
//===----------------------------------------------------------------------===//
#include "lldb/Symbol/UnwindPlan.h"
-#include "lldb/Target/Thread.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/Thread.h"
using namespace lldb;
using namespace lldb_private;
@@ -285,10 +286,10 @@
}
void
-UnwindPlan::Dump (Stream& s, Process* process, Thread *thread) const
+UnwindPlan::Dump (Stream& s, Thread *thread) const
{
s.Printf ("Address range of this UnwindPlan: ");
- m_plan_valid_address_range.Dump (&s, process, Address::DumpStyleSectionNameOffset);
+ m_plan_valid_address_range.Dump (&s, &thread->GetProcess().GetTarget(), Address::DumpStyleSectionNameOffset);
s.Printf ("\n");
s.Printf ("UnwindPlan register kind %d", m_register_kind);
switch (m_register_kind)
Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Tue Sep 14 18:36:40 2010
@@ -14,9 +14,11 @@
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/Type.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Target/Target.h"
using namespace lldb;
using namespace lldb_private;
@@ -155,14 +157,14 @@
// Currently we only support functions that have things with
// locations lists. If this expands, we will need to add support
assert (sc.function);
- Process *process = &frame->GetThread().GetProcess();
- addr_t loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (process);
+ Target *target = &frame->GetThread().GetProcess().GetTarget();
+ addr_t loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (target);
if (loclist_base_load_addr == LLDB_INVALID_ADDRESS)
return false;
// It is a location list. We just need to tell if the location
// list contains the current address when converted to a load
// address
- return m_location.LocationListContainsAddress (loclist_base_load_addr, frame->GetFrameCodeAddress().GetLoadAddress (process));
+ return m_location.LocationListContainsAddress (loclist_base_load_addr, frame->GetFrameCodeAddress().GetLoadAddress (target));
}
else
{
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Sep 14 18:36:40 2010
@@ -66,7 +66,6 @@
Broadcaster ("Process"),
ProcessInstanceSettings (*(Process::GetSettingsController().get())),
m_target (target),
- m_section_load_info (),
m_public_state (eStateUnloaded),
m_private_state (eStateUnloaded),
m_private_state_broadcaster ("lldb.process.internal_state_broadcaster"),
@@ -529,7 +528,7 @@
lldb::break_id_t
Process::CreateBreakpointSite (BreakpointLocationSP &owner, bool use_hardware)
{
- const addr_t load_addr = owner->GetAddress().GetLoadAddress (this);
+ const addr_t load_addr = owner->GetAddress().GetLoadAddress (&m_target);
if (load_addr != LLDB_INVALID_ADDRESS)
{
BreakpointSiteSP bp_site_sp;
@@ -1575,103 +1574,6 @@
return NULL;
}
-addr_t
-Process::GetSectionLoadAddress (const Section *section) const
-{
- // TODO: add support for the same section having multiple load addresses
- addr_t section_load_addr = LLDB_INVALID_ADDRESS;
- if (m_section_load_info.GetFirstKeyForValue (section, section_load_addr))
- return section_load_addr;
- return LLDB_INVALID_ADDRESS;
-}
-
-bool
-Process::SectionLoaded (const Section *section, addr_t load_addr)
-{
- Log *log = lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_SHLIB | LIBLLDB_LOG_VERBOSE);
-
- if (log)
- log->Printf ("Process::%s (section = %p (%s.%s), load_addr = 0x%16.16llx)",
- __FUNCTION__,
- section,
- section->GetModule()->GetFileSpec().GetFilename().AsCString(),
- section->GetName().AsCString(),
- load_addr);
-
-
- const Section *existing_section = NULL;
- Mutex::Locker locker(m_section_load_info.GetMutex());
-
- if (m_section_load_info.GetValueForKeyNoLock (load_addr, existing_section))
- {
- if (existing_section == section)
- return false; // No change
- }
- m_section_load_info.SetValueForKeyNoLock (load_addr, section);
- return true; // Changed
-}
-
-size_t
-Process::SectionUnloaded (const Section *section)
-{
- Log *log = lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_SHLIB | LIBLLDB_LOG_VERBOSE);
-
- if (log)
- log->Printf ("Process::%s (section = %p (%s.%s))",
- __FUNCTION__,
- section,
- section->GetModule()->GetFileSpec().GetFilename().AsCString(),
- section->GetName().AsCString());
-
- Mutex::Locker locker(m_section_load_info.GetMutex());
-
- size_t unload_count = 0;
- addr_t section_load_addr;
- while (m_section_load_info.GetFirstKeyForValueNoLock (section, section_load_addr))
- {
- unload_count += m_section_load_info.EraseNoLock (section_load_addr);
- }
- return unload_count;
-}
-
-bool
-Process::SectionUnloaded (const Section *section, addr_t load_addr)
-{
- Log *log = lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_SHLIB | LIBLLDB_LOG_VERBOSE);
-
- if (log)
- log->Printf ("Process::%s (section = %p (%s.%s), load_addr = 0x%16.16llx)",
- __FUNCTION__,
- section,
- section->GetModule()->GetFileSpec().GetFilename().AsCString(),
- section->GetName().AsCString(),
- load_addr);
-
- return m_section_load_info.Erase (load_addr) == 1;
-}
-
-
-bool
-Process::ResolveLoadAddress (addr_t load_addr, Address &so_addr) const
-{
- addr_t section_load_addr = LLDB_INVALID_ADDRESS;
- const Section *section = NULL;
-
- // First find the top level section that this load address exists in
- if (m_section_load_info.LowerBound (load_addr, section_load_addr, section, true))
- {
- addr_t offset = load_addr - section_load_addr;
- if (offset < section->GetByteSize())
- {
- // We have found the top level section, now we need to find the
- // deepest child section.
- return section->ResolveContainedAddress (offset, so_addr);
- }
- }
- so_addr.Clear();
- return false;
-}
-
//------------------------------------------------------------------
// Process Event Data
//------------------------------------------------------------------
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Tue Sep 14 18:36:40 2010
@@ -115,7 +115,7 @@
m_unwind_frame_index (unwind_frame_index),
m_thread (thread),
m_reg_context_sp (reg_context_sp),
- m_id (pc_addr.GetLoadAddress (&thread.GetProcess()), cfa, NULL),
+ m_id (pc_addr.GetLoadAddress (&thread.GetProcess().GetTarget()), cfa, NULL),
m_frame_code_addr (pc_addr),
m_sc (),
m_flags (),
@@ -213,7 +213,7 @@
// Resolve the PC into a temporary address because if ResolveLoadAddress
// fails to resolve the address, it will clear the address object...
Address resolved_pc;
- if (m_thread.GetProcess().ResolveLoadAddress(m_frame_code_addr.GetOffset(), resolved_pc))
+ if (m_thread.GetProcess().GetTarget().GetSectionLoadList().ResolveLoadAddress(m_frame_code_addr.GetOffset(), resolved_pc))
{
m_frame_code_addr = resolved_pc;
const Section *section = m_frame_code_addr.GetSection();
@@ -488,7 +488,7 @@
Value expr_value;
addr_t loclist_base_addr = LLDB_INVALID_ADDRESS;
if (m_sc.function->GetFrameBaseExpression().IsLocationList())
- loclist_base_addr = m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (&m_thread.GetProcess());
+ loclist_base_addr = m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (&m_thread.GetProcess().GetTarget());
if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false)
{
@@ -629,7 +629,7 @@
if (show_frame_index)
strm->Printf("frame #%u: ", m_frame_index);
- strm->Printf("0x%0*llx ", m_thread.GetProcess().GetAddressByteSize() * 2, GetFrameCodeAddress().GetLoadAddress(&m_thread.GetProcess()));
+ strm->Printf("0x%0*llx ", m_thread.GetProcess().GetAddressByteSize() * 2, GetFrameCodeAddress().GetLoadAddress(&m_thread.GetProcess().GetTarget()));
GetSymbolContext(eSymbolContextEverything);
const bool show_module = true;
const bool show_inline = true;
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Tue Sep 14 18:36:40 2010
@@ -37,6 +37,7 @@
Broadcaster("Target"),
m_debugger (debugger),
m_images(),
+ m_section_load_list (),
m_breakpoint_list (false),
m_internal_breakpoint_list (true),
m_process_sp(),
@@ -162,10 +163,8 @@
// Attempt to resolve our load address if possible, though it is ok if
// it doesn't resolve to section/offset.
- Process *process = GetProcessSP().get();
// Try and resolve as a load address if possible
- if (process)
- process->ResolveLoadAddress(addr, so_addr);
+ m_section_load_list.ResolveLoadAddress(addr, so_addr);
if (!so_addr.IsValid())
{
// The address didn't resolve, so just set this as an absolute address
@@ -567,7 +566,7 @@
{
if (process_is_valid)
{
- m_process_sp->ResolveLoadAddress (addr.GetOffset(), resolved_addr);
+ m_section_load_list.ResolveLoadAddress (addr.GetOffset(), resolved_addr);
}
else
{
@@ -578,7 +577,7 @@
if (process_is_valid)
{
- lldb::addr_t load_addr = resolved_addr.GetLoadAddress(m_process_sp.get());
+ lldb::addr_t load_addr = resolved_addr.GetLoadAddress (this);
if (load_addr == LLDB_INVALID_ADDRESS)
{
if (resolved_addr.GetModule() && resolved_addr.GetModule()->GetFileSpec())
Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Tue Sep 14 18:36:40 2010
@@ -66,13 +66,13 @@
contexts.GetContextAtIndex(0, context);
m_start_addr = context.symbol->GetValue();
- lldb::addr_t StartLoadAddr = m_start_addr.GetLoadAddress(&process);
+ lldb::addr_t StartLoadAddr = m_start_addr.GetLoadAddress(&target);
if (!thread.SaveFrameZeroState(m_register_backup))
return;
m_function_addr = function;
- lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&process);
+ lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target);
if (!abi->PrepareTrivialCall(thread,
spBelowRedZone,
@@ -120,13 +120,13 @@
contexts.GetContextAtIndex(0, context);
m_start_addr = context.symbol->GetValue();
- lldb::addr_t StartLoadAddr = m_start_addr.GetLoadAddress(&process);
+ lldb::addr_t StartLoadAddr = m_start_addr.GetLoadAddress(&target);
if(!thread.SaveFrameZeroState(m_register_backup))
return;
m_function_addr = function;
- lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&process);
+ lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target);
if (!abi->PrepareNormalCall(thread,
spBelowRedZone,
@@ -152,9 +152,9 @@
else
{
if (m_args)
- s->Printf("Thread plan to call 0x%llx with parsed arguments", m_function_addr.GetLoadAddress(&m_process), m_arg_addr);
+ s->Printf("Thread plan to call 0x%llx with parsed arguments", m_function_addr.GetLoadAddress(&m_process.GetTarget()), m_arg_addr);
else
- s->Printf("Thread plan to call 0x%llx void * argument at: 0x%llx", m_function_addr.GetLoadAddress(&m_process), m_arg_addr);
+ s->Printf("Thread plan to call 0x%llx void * argument at: 0x%llx", m_function_addr.GetLoadAddress(&m_process.GetTarget()), m_arg_addr);
}
}
Modified: lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp Tue Sep 14 18:36:40 2010
@@ -39,7 +39,7 @@
m_addresses (),
m_break_ids ()
{
- m_addresses.push_back (address.GetLoadAddress(&m_thread.GetProcess()));
+ m_addresses.push_back (address.GetLoadAddress(&m_thread.GetProcess().GetTarget()));
SetInitialBreakpoints();
}
Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Tue Sep 14 18:36:40 2010
@@ -61,7 +61,7 @@
else
{
s->Printf ("Stepping through range (stepping into functions): ");
- m_address_range.Dump (s, &m_thread.GetProcess(), Address::DumpStyleLoadAddress);
+ m_address_range.Dump (s, &m_thread.GetProcess().GetTarget(), Address::DumpStyleLoadAddress);
}
}
Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Tue Sep 14 18:36:40 2010
@@ -56,7 +56,7 @@
else
{
s->Printf ("stepping through range (stepping over functions): ");
- m_address_range.Dump (s, &m_thread.GetProcess(), Address::DumpStyleLoadAddress);
+ m_address_range.Dump (s, &m_thread.GetProcess().GetTarget(), Address::DumpStyleLoadAddress);
}
}
Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=113895&r1=113894&r2=113895&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Tue Sep 14 18:36:40 2010
@@ -100,7 +100,7 @@
lldb::addr_t pc_load_addr = m_thread.GetRegisterContext()->GetPC();
- ret_value = m_address_range.ContainsLoadAddress(pc_load_addr, &m_thread.GetProcess());
+ ret_value = m_address_range.ContainsLoadAddress(pc_load_addr, &m_thread.GetProcess().GetTarget());
if (!ret_value)
{
@@ -119,7 +119,7 @@
if (log)
{
StreamString s;
- m_address_range.Dump (&s, &m_thread.GetProcess(), Address::DumpStyleLoadAddress);
+ m_address_range.Dump (&s, &m_thread.GetProcess().GetTarget(), Address::DumpStyleLoadAddress);
log->Printf ("Step range plan stepped to another range of same line: %s", s.GetData());
}
@@ -138,15 +138,13 @@
ThreadPlanStepRange::InSymbol()
{
lldb::addr_t cur_pc = m_thread.GetRegisterContext()->GetPC();
- Process *process = m_thread.CalculateProcess();
-
if (m_addr_context.function != NULL)
{
- return m_addr_context.function->GetAddressRange().ContainsLoadAddress (cur_pc, process);
+ return m_addr_context.function->GetAddressRange().ContainsLoadAddress (cur_pc, &m_thread.GetProcess().GetTarget());
}
else if (m_addr_context.symbol != NULL)
{
- return m_addr_context.symbol->GetAddressRangeRef().ContainsLoadAddress (cur_pc, process);
+ return m_addr_context.symbol->GetAddressRangeRef().ContainsLoadAddress (cur_pc, &m_thread.GetProcess().GetTarget());
}
return false;
}
More information about the lldb-commits
mailing list