[Lldb-commits] [lldb] r159984 - in /lldb/branches/apple/python-GIL: examples/darwin/heap_find/ examples/python/ include/lldb/API/ include/lldb/Core/ include/lldb/Target/ resources/ source/API/ source/Commands/ source/Core/ source/Expression/ source/Host/common/ source/Host/macosx/launcherXPCService/ source/Interpreter/ source/Plugins/ABI/MacOSX-arm/ source/Plugins/ABI/MacOSX-i386/ source/Plugins/DynamicLoader/Darwin-Kernel/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/DynamicLoader/POSIX-DYLD/ source/Plugin...
Filipe Cabecinhas
me at filcab.net
Tue Jul 10 00:32:45 PDT 2012
Author: filcab
Date: Tue Jul 10 02:32:45 2012
New Revision: 159984
URL: http://llvm.org/viewvc/llvm-project?rev=159984&view=rev
Log:
Merge changes from ToT trunk.
Added:
lldb/branches/apple/python-GIL/examples/python/globals.py
- copied unchanged from r159975, lldb/trunk/examples/python/globals.py
Modified:
lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py
lldb/branches/apple/python-GIL/examples/python/crashlog.py
lldb/branches/apple/python-GIL/examples/python/symbolication.py
lldb/branches/apple/python-GIL/include/lldb/API/SBTarget.h
lldb/branches/apple/python-GIL/include/lldb/Core/EmulateInstruction.h
lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h
lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectConstResult.h
lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectDynamicValue.h
lldb/branches/apple/python-GIL/include/lldb/Target/SectionLoadList.h
lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h
lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
lldb/branches/apple/python-GIL/source/API/SBTarget.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp
lldb/branches/apple/python-GIL/source/Core/Module.cpp
lldb/branches/apple/python-GIL/source/Core/Section.cpp
lldb/branches/apple/python-GIL/source/Core/ValueObjectConstResult.cpp
lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp
lldb/branches/apple/python-GIL/source/Host/common/Mutex.cpp
lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
lldb/branches/apple/python-GIL/source/Target/Process.cpp
lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp
lldb/branches/apple/python-GIL/test/lldbutil.py
lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj
Modified: lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py (original)
+++ lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py Tue Jul 10 02:32:45 2012
@@ -77,6 +77,41 @@
if lldb.target.FindModule(libheap_dylib_spec):
return None # success, 'libheap.dylib' already loaded
return 'error: failed to load "%s"' % libheap_dylib_path
+
+def get_member_types_for_offset(value_type, offset, member_list):
+ member = value_type.GetFieldAtIndex(0)
+ search_bases = False
+ if member:
+ if member.GetOffsetInBytes() <= offset:
+ for field_idx in range (value_type.GetNumberOfFields()):
+ member = value_type.GetFieldAtIndex(field_idx)
+ member_byte_offset = member.GetOffsetInBytes()
+ member_end_byte_offset = member_byte_offset + member.type.size
+ if member_byte_offset <= offset and offset < member_end_byte_offset:
+ member_list.append(member)
+ get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+ return
+ else:
+ search_bases = True
+ else:
+ search_bases = True
+ if search_bases:
+ for field_idx in range (value_type.GetNumberOfDirectBaseClasses()):
+ member = value_type.GetDirectBaseClassAtIndex(field_idx)
+ member_byte_offset = member.GetOffsetInBytes()
+ member_end_byte_offset = member_byte_offset + member.type.size
+ if member_byte_offset <= offset and offset < member_end_byte_offset:
+ member_list.append(member)
+ get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+ return
+ for field_idx in range (value_type.GetNumberOfVirtualBaseClasses()):
+ member = value_type.GetVirtualBaseClassAtIndex(field_idx)
+ member_byte_offset = member.GetOffsetInBytes()
+ member_end_byte_offset = member_byte_offset + member.type.size
+ if member_byte_offset <= offset and offset < member_end_byte_offset:
+ member_list.append(member)
+ get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+ return
def add_common_options(parser):
parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
@@ -179,15 +214,13 @@
break
malloc_size = int(match_entry.size)
offset = int(match_entry.offset)
+ match_addr = malloc_addr + offset
dynamic_value = match_entry.addr.sbvalue.GetDynamicValue(lldb.eDynamicCanRunTarget)
- # If the type is still 'void *' then we weren't able to figure
- # out a dynamic type for the malloc_addr
- type_name = dynamic_value.type.name
description = '[%u] %s: addr = 0x%x' % (i, arg_str_description, malloc_addr)
if offset != 0:
description += ' + %u' % (offset)
description += ', size = %u' % (malloc_size)
- if type_name == 'void *':
+ if dynamic_value.type.name == 'void *':
if options.type == 'pointer' and malloc_size == 4096:
error = lldb.SBError()
data = bytearray(lldb.process.ReadMemory(malloc_addr, 16, error))
@@ -195,50 +228,32 @@
description += ', type = (AUTORELEASE!)'
print description
else:
- description += ', type = %s' % (type_name)
derefed_dynamic_value = dynamic_value.deref
- ivar_member = None
- if derefed_dynamic_value:
+ if derefed_dynamic_value:
derefed_dynamic_type = derefed_dynamic_value.type
- member = derefed_dynamic_type.GetFieldAtIndex(0)
- search_bases = False
- if member:
- if member.GetOffsetInBytes() <= offset:
- for field_idx in range (derefed_dynamic_type.GetNumberOfFields()):
- member = derefed_dynamic_type.GetFieldAtIndex(field_idx)
- member_byte_offset = member.GetOffsetInBytes()
- if member_byte_offset == offset:
- ivar_member = member
- break
- else:
- search_bases = True
- else:
- search_bases = True
-
- if not ivar_member and search_bases:
- for field_idx in range (derefed_dynamic_type.GetNumberOfDirectBaseClasses()):
- member = derefed_dynamic_type.GetDirectBaseClassAtIndex(field_idx)
- member_byte_offset = member.GetOffsetInBytes()
- if member_byte_offset == offset:
- ivar_member = member
- break
- if not ivar_member:
- for field_idx in range (derefed_dynamic_type.GetNumberOfVirtualBaseClasses()):
- member = derefed_dynamic_type.GetVirtualBaseClassAtIndex(field_idx)
- member_byte_offset = member.GetOffsetInBytes()
- if member_byte_offset == offset:
- ivar_member = member
- break
- if ivar_member:
- description +=', ivar = %s' % (ivar_member.name)
-
- print description
- if derefed_dynamic_value:
- print derefed_dynamic_value
- if options.print_object_description:
- desc = dynamic_value.GetObjectDescription()
- if desc:
- print ' (%s) 0x%x %s\n' % (type_name, malloc_addr, desc)
+ derefed_dynamic_type_size = derefed_dynamic_type.size
+ derefed_dynamic_type_name = derefed_dynamic_type.name
+ description += ', type = %s <%u>' % (derefed_dynamic_type_name, derefed_dynamic_type_size)
+ if offset < derefed_dynamic_type_size:
+ member_list = list();
+ get_member_types_for_offset (derefed_dynamic_type, offset, member_list)
+ if member_list:
+ member_path = ''
+ for member in member_list:
+ member_name = member.name
+ if member_name:
+ if member_path:
+ member_path += '.'
+ member_path += member_name
+ if member_path:
+ description += ', ivar = %s' % (member_path)
+ print description
+ if derefed_dynamic_value:
+ print derefed_dynamic_value
+ if options.print_object_description:
+ desc = dynamic_value.GetObjectDescription()
+ if desc:
+ print ' (%s) 0x%x %s\n' % (type_name, malloc_addr, desc)
if options.memory:
memory_format = options.format
if not memory_format:
Modified: lldb/branches/apple/python-GIL/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/python/crashlog.py?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/python/crashlog.py (original)
+++ lldb/branches/apple/python-GIL/examples/python/crashlog.py Tue Jul 10 02:32:45 2012
@@ -370,6 +370,7 @@
def __init__(self, crash_logs):
cmd.Cmd.__init__(self)
+ self.use_rawinput = False
self.intro = 'Interactive crashlogs prompt, type "help" to see a list of supported commands.'
self.crash_logs = crash_logs
self.prompt = '% '
Modified: lldb/branches/apple/python-GIL/examples/python/symbolication.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/python/symbolication.py?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/python/symbolication.py (original)
+++ lldb/branches/apple/python-GIL/examples/python/symbolication.py Tue Jul 10 02:32:45 2012
@@ -408,31 +408,30 @@
image = self.find_image_containing_load_addr (load_addr)
if image:
image.add_module (self.target)
- symbolicated_address = Address(self.target, load_addr)
- if symbolicated_address.symbolicate (verbose):
+ symbolicated_address = Address(self.target, load_addr)
+ if symbolicated_address.symbolicate (verbose):
+ if symbolicated_address.so_addr:
+ symbolicated_addresses = list()
+ symbolicated_addresses.append(symbolicated_address)
+ # See if we were able to reconstruct anything?
+ while 1:
+ inlined_parent_so_addr = lldb.SBAddress()
+ inlined_parent_sym_ctx = symbolicated_address.sym_ctx.GetParentOfInlinedScope (symbolicated_address.so_addr, inlined_parent_so_addr)
+ if not inlined_parent_sym_ctx:
+ break
+ if not inlined_parent_so_addr:
+ break
+
+ symbolicated_address = Address(self.target, inlined_parent_so_addr.GetLoadAddress(self.target))
+ symbolicated_address.sym_ctx = inlined_parent_sym_ctx
+ symbolicated_address.so_addr = inlined_parent_so_addr
+ symbolicated_address.symbolicate (verbose)
- if symbolicated_address.so_addr:
- symbolicated_addresses = list()
- symbolicated_addresses.append(symbolicated_address)
- # See if we were able to reconstruct anything?
- while 1:
- inlined_parent_so_addr = lldb.SBAddress()
- inlined_parent_sym_ctx = symbolicated_address.sym_ctx.GetParentOfInlinedScope (symbolicated_address.so_addr, inlined_parent_so_addr)
- if not inlined_parent_sym_ctx:
- break
- if not inlined_parent_so_addr:
- break
-
- symbolicated_address = Address(self.target, inlined_parent_so_addr.GetLoadAddress(self.target))
- symbolicated_address.sym_ctx = inlined_parent_sym_ctx
- symbolicated_address.so_addr = inlined_parent_so_addr
- symbolicated_address.symbolicate (verbose)
-
- # push the new frame onto the new frame stack
- symbolicated_addresses.append (symbolicated_address)
-
- if symbolicated_addresses:
- return symbolicated_addresses
+ # push the new frame onto the new frame stack
+ symbolicated_addresses.append (symbolicated_address)
+
+ if symbolicated_addresses:
+ return symbolicated_addresses
else:
print 'error: no target in Symbolicator'
return None
Modified: lldb/branches/apple/python-GIL/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/API/SBTarget.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/API/SBTarget.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/API/SBTarget.h Tue Jul 10 02:32:45 2012
@@ -15,6 +15,7 @@
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBFileSpecList.h"
+#include "lldb/API/SBSymbolContextList.h"
#include "lldb/API/SBType.h"
#include "lldb/API/SBWatchpoint.h"
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/EmulateInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/EmulateInstruction.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/EmulateInstruction.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/EmulateInstruction.h Tue Jul 10 02:32:45 2012
@@ -57,26 +57,26 @@
/// Instruction Set Architecture (ISA) will be emulated.
///
/// Subclasses at the very least should implement the instructions that
-/// save and restore regiters onto the stack and adjustment to the stack
+/// save and restore registers onto the stack and adjustment to the stack
/// pointer. By just implementing a few instructions for an ISA that are
/// the typical prologue opcodes, you can then generate CFI using a
/// class that will soon be available.
///
-/// Implmenting all of the instructions that affect the PC can then
+/// Implementing all of the instructions that affect the PC can then
/// allow single step prediction support.
///
-/// Implmenting all of the instructions allows for emulation of opcodes
+/// Implementing all of the instructions allows for emulation of opcodes
/// for breakpoint traps and will pave the way for "thread centric"
/// debugging. The current debugging model is "process centric" where
-/// all threads must be stopped when any thread is stopped since when
-/// hitting software breakpoints once must disable the breakpoint by
+/// all threads must be stopped when any thread is stopped; when
+/// hitting software breakpoints we must disable the breakpoint by
/// restoring the original breakpoint opcde, single stepping and
/// restoring the breakpoint trap. If all threads were allowed to run
/// then other threads could miss the breakpoint.
///
/// This class centralizes the code that usually is done in separate
/// code paths in a debugger (single step prediction, finding save
-/// restore locations of registers for unwinding stack frame variables,
+/// restore locations of registers for unwinding stack frame variables)
/// and emulating the intruction is just a bonus.
//----------------------------------------------------------------------
@@ -98,7 +98,7 @@
// Read an instruciton opcode from memory
eContextReadOpcode,
- // Usually used for writing a register value whose source value in an
+ // Usually used for writing a register value whose source value is an
// immediate
eContextImmediate,
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h Tue Jul 10 02:32:45 2012
@@ -823,7 +823,7 @@
virtual lldb::ValueObjectSP
GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
- lldb::ValueObjectSP
+ virtual lldb::ValueObjectSP
GetDynamicValue (lldb::DynamicValueType valueType);
virtual lldb::ValueObjectSP
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectConstResult.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectConstResult.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectConstResult.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectConstResult.h Tue Jul 10 02:32:45 2012
@@ -131,6 +131,9 @@
m_impl.SetLiveAddress(addr,
address_type);
}
+
+ virtual lldb::ValueObjectSP
+ GetDynamicValue (lldb::DynamicValueType valueType);
protected:
virtual bool
@@ -142,13 +145,6 @@
virtual lldb::clang_type_t
GetClangTypeImpl ();
- // CalculateDynamicValue doesn't change the dynamic value, since this can get
- // called at any time and you can't reliably fetch the dynamic value at any time.
- // If we want to have dynamic values for ConstResults, then we'll need to make them
- // up when we make the const result & stuff them in by hand.
- virtual void
- CalculateDynamicValue (lldb::DynamicValueType use_dynamic) {}
-
clang::ASTContext *m_clang_ast; // The clang AST that the clang type comes from
ConstString m_type_name;
uint32_t m_byte_size;
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectDynamicValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectDynamicValue.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ValueObjectDynamicValue.h Tue Jul 10 02:32:45 2012
@@ -180,6 +180,7 @@
private:
friend class ValueObject;
+ friend class ValueObjectConstResult;
ValueObjectDynamicValue (ValueObject &parent, lldb::DynamicValueType use_dynamic);
//------------------------------------------------------------------
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/SectionLoadList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/SectionLoadList.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/SectionLoadList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/SectionLoadList.h Tue Jul 10 02:32:45 2012
@@ -47,31 +47,31 @@
Clear ();
lldb::addr_t
- GetSectionLoadAddress (const Section *section) const;
+ GetSectionLoadAddress (const lldb::SectionSP §ion_sp) const;
bool
ResolveLoadAddress (lldb::addr_t load_addr, Address &so_addr) const;
bool
- SetSectionLoadAddress (const Section *section, lldb::addr_t load_addr, bool warn_multiple = false);
+ SetSectionLoadAddress (const lldb::SectionSP §ion_sp, lldb::addr_t load_addr, bool warn_multiple = false);
// 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
- SetSectionUnloaded (const Section *section, lldb::addr_t load_addr);
+ SetSectionUnloaded (const lldb::SectionSP §ion_sp, 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
- SetSectionUnloaded (const Section *section);
+ SetSectionUnloaded (const lldb::SectionSP §ion_sp);
void
Dump (Stream &s, Target *target);
protected:
- typedef std::map<lldb::addr_t, const Section *> addr_to_sect_collection;
+ typedef std::map<lldb::addr_t, lldb::SectionSP> addr_to_sect_collection;
typedef llvm::DenseMap<const Section *, lldb::addr_t> sect_to_addr_collection;
addr_to_sect_collection m_addr_to_sect;
sect_to_addr_collection m_sect_to_addr;
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Thread.h Tue Jul 10 02:32:45 2012
@@ -775,6 +775,13 @@
{
return m_destroy_called;
}
+
+ // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
+ // valid. The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
+ // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
+ virtual lldb::StopInfoSP
+ GetPrivateStopReason () = 0;
+
protected:
friend class ThreadPlan;
@@ -796,12 +803,6 @@
ThreadPlan *GetPreviousPlan (ThreadPlan *plan);
- // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
- // valid. The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
- // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
- virtual lldb::StopInfoSP
- GetPrivateStopReason () = 0;
-
typedef std::vector<lldb::ThreadPlanSP> plan_stack;
void
Modified: lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/resources/LLDB-Info.plist?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/resources/LLDB-Info.plist (original)
+++ lldb/branches/apple/python-GIL/resources/LLDB-Info.plist Tue Jul 10 02:32:45 2012
@@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>160</string>
+ <string>161</string>
<key>CFBundleName</key>
<string>${EXECUTABLE_NAME}</string>
</dict>
Modified: lldb/branches/apple/python-GIL/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBTarget.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBTarget.cpp Tue Jul 10 02:32:45 2012
@@ -2137,7 +2137,7 @@
}
else
{
- target_sp->GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), section_base_addr);
+ target_sp->GetSectionLoadList().SetSectionLoadAddress (section_sp, section_base_addr);
}
}
}
@@ -2163,7 +2163,7 @@
}
else
{
- target_sp->GetSectionLoadList().SetSectionUnloaded (section.GetSP().get());
+ target_sp->GetSectionLoadList().SetSectionUnloaded (section.GetSP());
}
}
else
@@ -2233,7 +2233,7 @@
{
SectionSP section_sp (section_list->GetSectionAtIndex(sect_idx));
if (section_sp)
- target_sp->GetSectionLoadList().SetSectionUnloaded (section_sp.get());
+ target_sp->GetSectionLoadList().SetSectionUnloaded (section_sp);
}
}
else
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectTarget.cpp Tue Jul 10 02:32:45 2012
@@ -474,6 +474,13 @@
if (argc > 0)
{
const uint32_t num_targets = target_list.GetNumTargets();
+ // Bail out if don't have any targets.
+ if (num_targets == 0) {
+ result.AppendError("no targets to delete");
+ result.SetStatus(eReturnStatusFailed);
+ success = false;
+ }
+
for (uint32_t arg_idx = 0; success && arg_idx < argc; ++arg_idx)
{
const char *target_idx_arg = args.GetArgumentAtIndex(arg_idx);
@@ -489,9 +496,14 @@
continue;
}
}
- result.AppendErrorWithFormat ("target index %u is out of range, valid target indexes are 0 - %u\n",
- target_idx,
- num_targets - 1);
+ if (num_targets > 1)
+ result.AppendErrorWithFormat ("target index %u is out of range, valid target indexes are 0 - %u\n",
+ target_idx,
+ num_targets - 1);
+ else
+ result.AppendErrorWithFormat("target index %u is out of range, the only valid index is 0\n",
+ target_idx);
+
result.SetStatus (eReturnStatusFailed);
success = false;
}
@@ -2651,7 +2663,7 @@
}
else
{
- if (target->GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), load_addr))
+ if (target->GetSectionLoadList().SetSectionLoadAddress (section_sp, load_addr))
changed = true;
result.AppendMessageWithFormat("section '%s' loaded at 0x%llx\n", sect_name, load_addr);
}
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp Tue Jul 10 02:32:45 2012
@@ -646,37 +646,41 @@
StateType state = process->GetState();
if ((state == eStateCrashed) || (state == eStateStopped) || (state == eStateSuspended))
{
+ Mutex::Locker locker (process->GetThreadList().GetMutex());
const uint32_t num_threads = process->GetThreadList().GetSize();
- uint32_t idx;
const size_t argc = command.GetArgumentCount();
if (argc > 0)
{
- std::vector<uint32_t> resume_thread_indexes;
+ std::vector<Thread *> resume_threads;
for (uint32_t i=0; i<argc; ++i)
{
bool success;
const int base = 0;
- idx = Args::StringToUInt32 (command.GetArgumentAtIndex(i), LLDB_INVALID_INDEX32, base, &success);
- if (!success)
+ uint32_t thread_idx = Args::StringToUInt32 (command.GetArgumentAtIndex(i), LLDB_INVALID_INDEX32, base, &success);
+ if (success)
{
- result.AppendErrorWithFormat ("invalid value for thread index: %s.", command.GetArgumentAtIndex(i));
- result.SetStatus (eReturnStatusFailed);
- return false;
- }
- else if (process->GetThreadList().FindThreadByIndexID(idx))
- {
- if (find(resume_thread_indexes.begin(), resume_thread_indexes.end(), idx) == resume_thread_indexes.end())
- resume_thread_indexes.push_back(idx);
+ Thread *thread = process->GetThreadList().FindThreadByIndexID(thread_idx).get();
+
+ if (thread)
+ {
+ resume_threads.push_back(thread);
+ }
+ else
+ {
+ result.AppendErrorWithFormat("invalid thread index %u.\n", thread_idx);
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
}
else
{
- result.AppendErrorWithFormat("thread index %u out of range.\n", idx);
+ result.AppendErrorWithFormat ("invalid thread index argument: \"%s\".\n", command.GetArgumentAtIndex(i));
result.SetStatus (eReturnStatusFailed);
return false;
}
}
-
- if (resume_thread_indexes.empty())
+
+ if (resume_threads.empty())
{
result.AppendError ("no valid thread indexes were specified");
result.SetStatus (eReturnStatusFailed);
@@ -684,20 +688,20 @@
}
else
{
- if (resume_thread_indexes.size() == 1)
+ if (resume_threads.size() == 1)
result.AppendMessageWithFormat ("Resuming thread: ");
else
result.AppendMessageWithFormat ("Resuming threads: ");
-
- for (idx=0; idx<num_threads; ++idx)
+
+ for (uint32_t idx=0; idx<num_threads; ++idx)
{
- Thread *thread = process->GetThreadList().FindThreadByIndexID(idx).get();
- std::vector<uint32_t>::iterator this_thread_pos = find(resume_thread_indexes.begin(), resume_thread_indexes.end(), thread->GetIndexID());
+ Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get();
+ std::vector<Thread *>::iterator this_thread_pos = find(resume_threads.begin(), resume_threads.end(), thread);
- if (this_thread_pos != resume_thread_indexes.end())
+ if (this_thread_pos != resume_threads.end())
{
- resume_thread_indexes.erase(this_thread_pos);
- if (resume_thread_indexes.size() > 0)
+ resume_threads.erase(this_thread_pos);
+ if (resume_threads.size() > 0)
result.AppendMessageWithFormat ("%u, ", thread->GetIndexID());
else
result.AppendMessageWithFormat ("%u ", thread->GetIndexID());
@@ -722,9 +726,9 @@
return false;
}
// Set the actions that the threads should each take when resuming
- for (idx=0; idx<num_threads; ++idx)
+ for (uint32_t idx=0; idx<num_threads; ++idx)
{
- Thread *thread = process->GetThreadList().FindThreadByIndexID(idx).get();
+ Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get();
if (thread == current_thread)
{
result.AppendMessageWithFormat ("Resuming thread 0x%4.4llx in process %llu\n", thread->GetID(), process->GetID());
@@ -736,7 +740,7 @@
}
}
}
-
+
Error error (process->Resume());
if (error.Success())
{
@@ -744,7 +748,7 @@
if (synchronous_execution)
{
state = process->WaitForProcessToStop (NULL);
-
+
result.SetDidChangeProcessState (true);
result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
result.SetStatus (eReturnStatusSuccessFinishNoResult);
Modified: lldb/branches/apple/python-GIL/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/Module.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Module.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Module.cpp Tue Jul 10 02:32:45 2012
@@ -693,10 +693,6 @@
types.RemoveMismatchedTypes (type_scope, type_basename, exact_match);
num_matches = types.GetSize();
}
- else
- {
- types.Clear();
- }
}
else
{
@@ -1139,11 +1135,11 @@
// Iterate through the object file sections to find the
// first section that starts of file offset zero and that
// has bytes in the file...
- Section *section = section_list->GetSectionAtIndex (sect_idx).get();
+ SectionSP section_sp (section_list->GetSectionAtIndex (sect_idx));
// Only load non-thread specific sections when given a slide
- if (section && !section->IsThreadSpecific())
+ if (section_sp && !section_sp->IsThreadSpecific())
{
- if (target.GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress() + offset))
+ if (target.GetSectionLoadList().SetSectionLoadAddress (section_sp, section_sp->GetFileAddress() + offset))
++num_loaded_sections;
}
}
Modified: lldb/branches/apple/python-GIL/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/Section.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Section.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Section.cpp Tue Jul 10 02:32:45 2012
@@ -152,7 +152,7 @@
}
else
{
- load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress (this);
+ load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress (const_cast<Section *>(this)->shared_from_this());
}
}
Modified: lldb/branches/apple/python-GIL/source/Core/ValueObjectConstResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ValueObjectConstResult.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ValueObjectConstResult.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ValueObjectConstResult.cpp Tue Jul 10 02:32:45 2012
@@ -13,6 +13,7 @@
#include "lldb/Core/ValueObjectConstResultChild.h"
#include "lldb/Core/DataExtractor.h"
#include "lldb/Core/Module.h"
+#include "lldb/Core/ValueObjectDynamicValue.h"
#include "lldb/Core/ValueObjectList.h"
#include "lldb/Symbol/ClangASTType.h"
@@ -375,3 +376,24 @@
{
return m_impl.GetPointeeData(data, item_idx, item_count);
}
+
+lldb::ValueObjectSP
+ValueObjectConstResult::GetDynamicValue (lldb::DynamicValueType use_dynamic)
+{
+ // Always recalculate dynamic values for const results as the memory that
+ // they might point to might have changed at any time.
+ if (use_dynamic != eNoDynamicValues)
+ {
+ if (!IsDynamic())
+ {
+ ExecutionContext exe_ctx (GetExecutionContextRef());
+ Process *process = exe_ctx.GetProcessPtr();
+ if (process && process->IsPossibleDynamicValue(*this))
+ m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic);
+ }
+ if (m_dynamic_value)
+ return m_dynamic_value->GetSP();
+ }
+ return ValueObjectSP();
+}
+
Modified: lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/IRForTarget.cpp Tue Jul 10 02:32:45 2012
@@ -1378,7 +1378,7 @@
// What we're going to do here is make believe this was a regular old external
// variable. That means we need to make the metadata valid.
- NamedMDNode *named_metadata = m_module->getNamedMetadata("clang.global.decl.ptrs");
+ NamedMDNode *named_metadata = m_module->getOrInsertNamedMetadata("clang.global.decl.ptrs");
llvm::Value* values[2];
values[0] = persistent_global;
Modified: lldb/branches/apple/python-GIL/source/Host/common/Mutex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/common/Mutex.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/common/Mutex.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Host/common/Mutex.cpp Tue Jul 10 02:32:45 2012
@@ -275,7 +275,7 @@
int
Mutex::Lock()
{
- DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_lock (%p)...\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), mutex_ptr);
+ DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_lock (%p)...\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex);
#if ENABLE_MUTEX_ERROR_CHECKING
error_check_mutex (&m_mutex, eMutexActionAssertInitialized);
@@ -291,7 +291,7 @@
assert(err == 0);
}
#endif
- DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_lock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+ DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_lock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
return err;
}
@@ -311,7 +311,7 @@
#endif
int err = ::pthread_mutex_trylock (&m_mutex);
- DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_trylock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+ DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_trylock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
return err;
}
@@ -340,7 +340,7 @@
assert(err == 0);
}
#endif
- DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_unlock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+ DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_unlock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
return err;
}
Modified: lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist Tue Jul 10 02:32:45 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>160</string>
+ <string>161</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
<key>XPCService</key>
Modified: lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist Tue Jul 10 02:32:45 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>160</string>
+ <string>161</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
<key>XPCService</key>
Modified: lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp Tue Jul 10 02:32:45 2012
@@ -248,7 +248,11 @@
if (cmd_obj_sp)
{
alias_arguments_vector_sp.reset (new OptionArgVector);
+#if defined (__arm__)
+ ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
+#else
ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=/bin/bash --", alias_arguments_vector_sp);
+#endif
AddAlias ("r", cmd_obj_sp);
AddAlias ("run", cmd_obj_sp);
AddOrReplaceAliasOptions ("r", alias_arguments_vector_sp);
Modified: lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Tue Jul 10 02:32:45 2012
@@ -538,10 +538,10 @@
UnwindPlan::Row row;
- // Our previous Call Frame Address is the stack pointer
+ // Our Call Frame Address is the stack pointer value
row.SetCFARegister (sp_reg_num);
- // Our previous PC is in the LR
+ // The previous PC is in the LR
row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
unwind_plan.AppendRow (row);
@@ -554,36 +554,15 @@
bool
ABIMacOSX_arm::CreateDefaultUnwindPlan (UnwindPlan &unwind_plan)
{
- uint32_t reg_kind = unwind_plan.GetRegisterKind();
- uint32_t fp_reg_num = LLDB_INVALID_REGNUM;
- uint32_t sp_reg_num = LLDB_INVALID_REGNUM;
- uint32_t pc_reg_num = LLDB_INVALID_REGNUM;
-
- switch (reg_kind)
- {
- case eRegisterKindDWARF:
- case eRegisterKindGCC:
- fp_reg_num = dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11
- sp_reg_num = dwarf_sp;
- pc_reg_num = dwarf_pc;
- break;
-
- case eRegisterKindGeneric:
- fp_reg_num = LLDB_REGNUM_GENERIC_FP;
- sp_reg_num = LLDB_REGNUM_GENERIC_SP;
- pc_reg_num = LLDB_REGNUM_GENERIC_PC;
- break;
- }
-
- if (fp_reg_num == LLDB_INVALID_REGNUM ||
- sp_reg_num == LLDB_INVALID_REGNUM ||
- pc_reg_num == LLDB_INVALID_REGNUM)
- return false;
+ uint32_t fp_reg_num = dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11;
+ uint32_t sp_reg_num = dwarf_sp;
+ uint32_t pc_reg_num = dwarf_pc;
UnwindPlan::Row row;
const int32_t ptr_size = 4;
- unwind_plan.SetRegisterKind (eRegisterKindGeneric);
+ unwind_plan.Clear ();
+ unwind_plan.SetRegisterKind (eRegisterKindDWARF);
row.SetCFARegister (fp_reg_num);
row.SetCFAOffset (2 * ptr_size);
row.SetOffset (0);
@@ -601,7 +580,7 @@
{
if (reg_info)
{
- // Volatile registers include: ebx, ebp, esi, edi, esp, eip
+ // Volatile registers include: r0, r1, r2, r3, r9, r12, r13
const char *name = reg_info->name;
if (name[0] == 'r')
{
Modified: lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Tue Jul 10 02:32:45 2012
@@ -272,6 +272,8 @@
// the actual register it pertains to is not important, just the size needs
// to be correct. Here we use "eax"...
const RegisterInfo *reg_info_32 = reg_ctx->GetRegisterInfoByName("eax");
+ if (!reg_info_32)
+ return false; // TODO this should actually never happen
// Make room for the argument(s) on the stack
@@ -818,47 +820,15 @@
bool
ABIMacOSX_i386::CreateDefaultUnwindPlan (UnwindPlan &unwind_plan)
{
- uint32_t reg_kind = unwind_plan.GetRegisterKind();
- uint32_t fp_reg_num = LLDB_INVALID_REGNUM;
- uint32_t sp_reg_num = LLDB_INVALID_REGNUM;
- uint32_t pc_reg_num = LLDB_INVALID_REGNUM;
+ uint32_t fp_reg_num = dwarf_ebp;
+ uint32_t sp_reg_num = dwarf_esp;
+ uint32_t pc_reg_num = dwarf_eip;
- switch (reg_kind)
- {
- case eRegisterKindDWARF:
- fp_reg_num = dwarf_ebp;
- sp_reg_num = dwarf_esp;
- pc_reg_num = dwarf_eip;
- break;
-
- case eRegisterKindGCC:
- fp_reg_num = gcc_ebp;
- sp_reg_num = gcc_esp;
- pc_reg_num = gcc_eip;
- break;
-
- case eRegisterKindGDB:
- fp_reg_num = gdb_ebp;
- sp_reg_num = gdb_esp;
- pc_reg_num = gdb_eip;
- break;
-
- case eRegisterKindGeneric:
- fp_reg_num = LLDB_REGNUM_GENERIC_FP;
- sp_reg_num = LLDB_REGNUM_GENERIC_SP;
- pc_reg_num = LLDB_REGNUM_GENERIC_PC;
- break;
- }
-
- if (fp_reg_num == LLDB_INVALID_REGNUM ||
- sp_reg_num == LLDB_INVALID_REGNUM ||
- pc_reg_num == LLDB_INVALID_REGNUM)
- return false;
-
UnwindPlan::Row row;
const int32_t ptr_size = 4;
- unwind_plan.SetRegisterKind (eRegisterKindGeneric);
+ unwind_plan.Clear ();
+ unwind_plan.SetRegisterKind (eRegisterKindDWARF);
row.SetCFARegister (fp_reg_num);
row.SetCFAOffset (2 * ptr_size);
row.SetOffset (0);
Modified: lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Tue Jul 10 02:32:45 2012
@@ -252,13 +252,13 @@
uint32_t num_sections_loaded = 0;
for (sect_idx=0; sect_idx<num_ondisk_sections; ++sect_idx)
{
- const Section *ondisk_section = ondisk_section_list->GetSectionAtIndex(sect_idx).get();
- if (ondisk_section)
+ SectionSP ondisk_section_sp(ondisk_section_list->GetSectionAtIndex(sect_idx));
+ if (ondisk_section_sp)
{
- const Section *memory_section = memory_section_list->FindSectionByName(ondisk_section->GetName()).get();
+ const Section *memory_section = memory_section_list->FindSectionByName(ondisk_section_sp->GetName()).get();
if (memory_section)
{
- target.GetSectionLoadList().SetSectionLoadAddress (ondisk_section, memory_section->GetFileAddress());
+ target.GetSectionLoadList().SetSectionLoadAddress (ondisk_section_sp, memory_section->GetFileAddress());
++num_sections_loaded;
}
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Jul 10 02:32:45 2012
@@ -390,15 +390,15 @@
uint32_t num_sections = section_list->GetSize();
for (uint32_t i=0; i<num_sections; ++i)
{
- Section* section = section_list->GetSectionAtIndex (i).get();
- if (section)
+ SectionSP section_sp (section_list->GetSectionAtIndex (i));
+ if (section_sp)
{
- const addr_t new_section_load_addr = section->GetFileAddress ();
- const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section);
+ const addr_t new_section_load_addr = section_sp->GetFileAddress ();
+ const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp);
if (old_section_load_addr == LLDB_INVALID_ADDRESS ||
old_section_load_addr != new_section_load_addr)
{
- if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress ()))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp, section_sp->GetFileAddress ()))
changed = true;
}
}
@@ -453,11 +453,11 @@
// "Section" objects, and "true" for all other sections.
const bool warn_multiple = section_sp->GetName() != g_section_name_LINKEDIT;
- const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp.get());
+ const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp);
if (old_section_load_addr == LLDB_INVALID_ADDRESS ||
old_section_load_addr != new_section_load_addr)
{
- if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), new_section_load_addr, warn_multiple))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp, new_section_load_addr, warn_multiple))
changed = true;
}
}
@@ -530,7 +530,7 @@
if (section_sp)
{
const addr_t old_section_load_addr = info.segments[i].vmaddr + info.slide;
- if (m_process->GetTarget().GetSectionLoadList().SetSectionUnloaded (section_sp.get(), old_section_load_addr))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionUnloaded (section_sp, old_section_load_addr))
changed = true;
}
else
Modified: lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Tue Jul 10 02:32:45 2012
@@ -172,9 +172,9 @@
for (unsigned i = 0; i < num_sections; ++i)
{
- Section *section = sections->GetSectionAtIndex(i).get();
- lldb::addr_t new_load_addr = section->GetFileAddress() + base_addr;
- lldb::addr_t old_load_addr = load_list.GetSectionLoadAddress(section);
+ SectionSP section_sp (sections->GetSectionAtIndex(i));
+ lldb::addr_t new_load_addr = section_sp->GetFileAddress() + base_addr;
+ lldb::addr_t old_load_addr = load_list.GetSectionLoadAddress(section_sp);
// If the file address of the section is zero then this is not an
// allocatable/loadable section (property of ELF sh_addr). Skip it.
@@ -183,7 +183,7 @@
if (old_load_addr == LLDB_INVALID_ADDRESS ||
old_load_addr != new_load_addr)
- load_list.SetSectionLoadAddress(section, new_load_addr);
+ load_list.SetSectionLoadAddress(section_sp, new_load_addr);
}
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp Tue Jul 10 02:32:45 2012
@@ -126,10 +126,10 @@
// Iterate through the object file sections to find the
// first section that starts of file offset zero and that
// has bytes in the file...
- Section *section = section_list->GetSectionAtIndex (sect_idx).get();
- if (section)
+ SectionSP section_sp (section_list->GetSectionAtIndex (sect_idx));
+ if (section_sp)
{
- if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress()))
+ if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp, section_sp->GetFileAddress()))
changed = true;
}
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Tue Jul 10 02:32:45 2012
@@ -119,11 +119,29 @@
const bool exact_match = true;
TypeList class_types;
- uint32_t num_matches = target->GetImages().FindTypes (sc,
- ConstString(class_name),
- exact_match,
- UINT32_MAX,
- class_types);
+ uint32_t num_matches = 0;
+ // First look in the module that the vtable symbol came from
+ // and look for a single exact match.
+ if (sc.module_sp)
+ {
+ num_matches = sc.module_sp->FindTypes (sc,
+ ConstString(class_name),
+ exact_match,
+ 1,
+ class_types);
+ }
+
+ // If we didn't find a symbol, then move on to the entire
+ // module list in the target and get as many unique matches
+ // as possible
+ if (num_matches == 0)
+ {
+ num_matches = target->GetImages().FindTypes (sc,
+ ConstString(class_name),
+ exact_match,
+ UINT32_MAX,
+ class_types);
+ }
lldb::TypeSP type_sp;
if (num_matches == 0)
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue Jul 10 02:32:45 2012
@@ -381,6 +381,7 @@
StringExtractorGDBRemote &response
)
{
+ m_curr_tid = LLDB_INVALID_THREAD_ID;
LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
if (log)
log->Printf ("GDBRemoteCommunicationClient::%s ()", __FUNCTION__);
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Jul 10 02:32:45 2012
@@ -47,6 +47,7 @@
// Project includes
#include "lldb/Host/Host.h"
#include "Plugins/Process/Utility/InferiorCallPOSIX.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
#include "Utility/StringExtractorGDBRemote.h"
#include "GDBRemoteRegisterContext.h"
#include "ProcessGDBRemote.h"
@@ -175,7 +176,8 @@
m_max_memory_size (512),
m_addr_to_mmap_size (),
m_thread_create_bp_sp (),
- m_waiting_for_attach (false)
+ m_waiting_for_attach (false),
+ m_destroy_tried_resuming (false)
{
m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit, "async thread should exit");
m_async_broadcaster.SetEventName (eBroadcastBitAsyncContinue, "async thread continue");
@@ -1689,6 +1691,7 @@
return error;
}
+
Error
ProcessGDBRemote::DoDestroy ()
{
@@ -1697,6 +1700,110 @@
if (log)
log->Printf ("ProcessGDBRemote::DoDestroy()");
+ // There is a bug in older iOS debugservers where they don't shut down the process
+ // they are debugging properly. If the process is sitting at a breakpoint or an exception,
+ // this can cause problems with restarting. So we check to see if any of our threads are stopped
+ // at a breakpoint, and if so we remove all the breakpoints, resume the process, and THEN
+ // destroy it again.
+ //
+ // Note, we don't have a good way to test the version of debugserver, but I happen to know that
+ // the set of all the iOS debugservers which don't support GetThreadSuffixSupported() and that of
+ // the debugservers with this bug are equal. There really should be a better way to test this!
+ //
+ // We also use m_destroy_tried_resuming to make sure we only do this once, if we resume and then halt and
+ // get called here to destroy again and we're still at a breakpoint or exception, then we should
+ // just do the straight-forward kill.
+ //
+ // And of course, if we weren't able to stop the process by the time we get here, it isn't
+ // necessary (or helpful) to do any of this.
+
+ if (!m_gdb_comm.GetThreadSuffixSupported() && m_public_state.GetValue() != eStateRunning)
+ {
+ PlatformSP platform_sp = GetTarget().GetPlatform();
+
+ // FIXME: These should be ConstStrings so we aren't doing strcmp'ing.
+ if (platform_sp
+ && platform_sp->GetName()
+ && strcmp (platform_sp->GetName(), PlatformRemoteiOS::GetShortPluginNameStatic()) == 0)
+ {
+ if (m_destroy_tried_resuming)
+ {
+ if (log)
+ log->PutCString ("ProcessGDBRemote::DoDestroy()Tried resuming to destroy once already, not doing it again.");
+ }
+ else
+ {
+ // At present, the plans are discarded and the breakpoints disabled Process::Destroy,
+ // but we really need it to happen here and it doesn't matter if we do it twice.
+ m_thread_list.DiscardThreadPlans();
+ DisableAllBreakpointSites();
+
+ bool stop_looks_like_crash = false;
+ ThreadList &threads = GetThreadList();
+
+ {
+ Mutex::Locker(threads.GetMutex());
+
+ size_t num_threads = threads.GetSize();
+ for (size_t i = 0; i < num_threads; i++)
+ {
+ ThreadSP thread_sp = threads.GetThreadAtIndex(i);
+ StopInfoSP stop_info_sp = thread_sp->GetPrivateStopReason();
+ StopReason reason = eStopReasonInvalid;
+ if (stop_info_sp)
+ reason = stop_info_sp->GetStopReason();
+ if (reason == eStopReasonBreakpoint
+ || reason == eStopReasonException)
+ {
+ if (log)
+ log->Printf ("ProcessGDBRemote::DoDestroy() - thread: %lld stopped with reason: %s.",
+ thread_sp->GetID(),
+ stop_info_sp->GetDescription());
+ stop_looks_like_crash = true;
+ break;
+ }
+ }
+ }
+
+ if (stop_looks_like_crash)
+ {
+ if (log)
+ log->PutCString ("ProcessGDBRemote::DoDestroy() - Stopped at a breakpoint, continue and then kill.");
+ m_destroy_tried_resuming = true;
+
+ // If we are going to run again before killing, it would be good to suspend all the threads
+ // before resuming so they won't get into more trouble. Sadly, for the threads stopped with
+ // the breakpoint or exception, the exception doesn't get cleared if it is suspended, so we do
+ // have to run the risk of letting those threads proceed a bit.
+
+ {
+ Mutex::Locker(threads.GetMutex());
+
+ size_t num_threads = threads.GetSize();
+ for (size_t i = 0; i < num_threads; i++)
+ {
+ ThreadSP thread_sp = threads.GetThreadAtIndex(i);
+ StopInfoSP stop_info_sp = thread_sp->GetPrivateStopReason();
+ StopReason reason = eStopReasonInvalid;
+ if (stop_info_sp)
+ reason = stop_info_sp->GetStopReason();
+ if (reason != eStopReasonBreakpoint
+ && reason != eStopReasonException)
+ {
+ if (log)
+ log->Printf ("ProcessGDBRemote::DoDestroy() - Suspending thread: %lld before running.",
+ thread_sp->GetID());
+ thread_sp->SetResumeState(eStateSuspended);
+ }
+ }
+ }
+ Resume ();
+ return Destroy();
+ }
+ }
+ }
+ }
+
// Interrupt if our inferior is running...
int exit_status = SIGABRT;
std::string exit_string;
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Tue Jul 10 02:32:45 2012
@@ -321,6 +321,7 @@
MMapMap m_addr_to_mmap_size;
lldb::BreakpointSP m_thread_create_bp_sp;
bool m_waiting_for_attach;
+ bool m_destroy_tried_resuming;
bool
StartAsyncThread ();
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h Tue Jul 10 02:32:45 2012
@@ -46,9 +46,11 @@
bool
NameMatches (const Entry& rhs) const
{
- if (name && rhs.name)
+ if (name == rhs.name)
+ return true;
+ else if (name && rhs.name)
return strcmp(name, rhs.name) == 0;
- return name == NULL && rhs.name == NULL;
+ return false;
}
// Test operator
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Jul 10 02:32:45 2012
@@ -4995,6 +4995,18 @@
if (src_size && dst_size)
{
+ if (src_size != dst_size)
+ {
+ if (log)
+ log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but they didn't have the same size (src=%d, dst=%d)",
+ src_class_die->GetOffset(),
+ dst_class_die->GetOffset(),
+ src_size,
+ dst_size);
+
+ return false;
+ }
+
uint32_t idx;
for (idx = 0; idx < src_size; ++idx)
{
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Tue Jul 10 02:32:45 2012
@@ -280,6 +280,9 @@
// it will have the remapped sections that we do below.
SymbolFileDWARF *oso_symfile = (SymbolFileDWARF *)comp_unit_info->oso_symbol_vendor->GetSymbolFile();
+ if (!oso_symfile)
+ return NULL;
+
if (oso_symfile->GetNumCompileUnits() != 1)
{
oso_symfile->GetObjectFile()->GetModule()->ReportError ("DWARF for object file '%s' contains multiple translation units!",
Modified: lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Tue Jul 10 02:32:45 2012
@@ -30,7 +30,7 @@
//-----------------------------------------------------------------------------------------------
-// UnwindAssemblyParser_x86 method definitions
+// UnwindAssemblyInstEmulation method definitions
//-----------------------------------------------------------------------------------------------
bool
@@ -71,9 +71,6 @@
const uint32_t addr_byte_size = m_arch.GetAddressByteSize();
const bool show_address = true;
const bool show_bytes = true;
- // Initialize the CFA with a known value. In the 32 bit case
- // it will be 0x80000000, and in the 64 bit case 0x8000000000000000.
- // We use the address byte size to be safe for any future addresss sizes
m_inst_emulator_ap->GetRegisterInfo (unwind_plan.GetRegisterKind(),
unwind_plan.GetInitialCFARegister(),
m_cfa_reg_info);
@@ -82,6 +79,9 @@
m_register_values.clear();
m_pushed_regs.clear();
+ // Initialize the CFA with a known value. In the 32 bit case
+ // it will be 0x80000000, and in the 64 bit case 0x8000000000000000.
+ // We use the address byte size to be safe for any future addresss sizes
m_initial_sp = (1ull << ((addr_byte_size * 8) - 1));
RegisterValue cfa_reg_value;
cfa_reg_value.SetUInt (m_initial_sp, m_cfa_reg_info.byte_size);
Modified: lldb/branches/apple/python-GIL/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Process.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Tue Jul 10 02:32:45 2012
@@ -1621,6 +1621,11 @@
Process::DisableAllBreakpointSites ()
{
m_breakpoint_site_list.SetEnabledForAll (false);
+ size_t num_sites = m_breakpoint_site_list.GetSize();
+ for (size_t i = 0; i < num_sites; i++)
+ {
+ DisableBreakpoint (m_breakpoint_site_list.GetByIndex(i).get());
+ }
}
Error
Modified: lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/SectionLoadList.cpp Tue Jul 10 02:32:45 2012
@@ -41,14 +41,14 @@
}
addr_t
-SectionLoadList::GetSectionLoadAddress (const Section *section) const
+SectionLoadList::GetSectionLoadAddress (const lldb::SectionSP §ion) const
{
// TODO: add support for the same section having multiple load addresses
addr_t section_load_addr = LLDB_INVALID_ADDRESS;
if (section)
{
Mutex::Locker locker(m_mutex);
- sect_to_addr_collection::const_iterator pos = m_sect_to_addr.find (section);
+ sect_to_addr_collection::const_iterator pos = m_sect_to_addr.find (section.get());
if (pos != m_sect_to_addr.end())
section_load_addr = pos->second;
@@ -57,7 +57,7 @@
}
bool
-SectionLoadList::SetSectionLoadAddress (const Section *section, addr_t load_addr, bool warn_multiple)
+SectionLoadList::SetSectionLoadAddress (const lldb::SectionSP §ion, addr_t load_addr, bool warn_multiple)
{
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
@@ -66,7 +66,7 @@
const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
__FUNCTION__,
- section,
+ section.get(),
module_file_spec.GetDirectory().AsCString(),
module_file_spec.GetDirectory() ? "/" : "",
module_file_spec.GetFilename().AsCString(),
@@ -79,7 +79,7 @@
// Fill in the section -> load_addr map
Mutex::Locker locker(m_mutex);
- sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section);
+ sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section.get());
if (sta_pos != m_sect_to_addr.end())
{
if (load_addr == sta_pos->second)
@@ -88,7 +88,7 @@
sta_pos->second = load_addr;
}
else
- m_sect_to_addr[section] = load_addr;
+ m_sect_to_addr[section.get()] = load_addr;
// Fill in the load_addr -> section map
addr_to_sect_collection::iterator ats_pos = m_addr_to_sect.find(load_addr);
@@ -126,59 +126,62 @@
}
size_t
-SectionLoadList::SetSectionUnloaded (const Section *section)
+SectionLoadList::SetSectionUnloaded (const lldb::SectionSP §ion_sp)
{
- LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
+ size_t unload_count = 0;
- if (log)
+ if (section_sp)
{
- const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
- log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s))",
- __FUNCTION__,
- section,
- module_file_spec.GetDirectory().AsCString(),
- module_file_spec.GetDirectory() ? "/" : "",
- module_file_spec.GetFilename().AsCString(),
- section->GetName().AsCString());
- }
+ LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
- size_t unload_count = 0;
- Mutex::Locker locker(m_mutex);
-
- sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section);
- if (sta_pos != m_sect_to_addr.end())
- {
- addr_t load_addr = sta_pos->second;
- m_sect_to_addr.erase (sta_pos);
+ if (log)
+ {
+ const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
+ log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s))",
+ __FUNCTION__,
+ section_sp.get(),
+ module_file_spec.GetDirectory().AsCString(),
+ module_file_spec.GetDirectory() ? "/" : "",
+ module_file_spec.GetFilename().AsCString(),
+ section_sp->GetName().AsCString());
+ }
- addr_to_sect_collection::iterator ats_pos = m_addr_to_sect.find(load_addr);
- if (ats_pos != m_addr_to_sect.end())
- m_addr_to_sect.erase (ats_pos);
+ Mutex::Locker locker(m_mutex);
+
+ sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section_sp.get());
+ if (sta_pos != m_sect_to_addr.end())
+ {
+ addr_t load_addr = sta_pos->second;
+ m_sect_to_addr.erase (sta_pos);
+
+ addr_to_sect_collection::iterator ats_pos = m_addr_to_sect.find(load_addr);
+ if (ats_pos != m_addr_to_sect.end())
+ m_addr_to_sect.erase (ats_pos);
+ }
}
-
return unload_count;
}
bool
-SectionLoadList::SetSectionUnloaded (const Section *section, addr_t load_addr)
+SectionLoadList::SetSectionUnloaded (const lldb::SectionSP §ion_sp, addr_t load_addr)
{
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
if (log)
{
- const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
+ const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
__FUNCTION__,
- section,
+ section_sp.get(),
module_file_spec.GetDirectory().AsCString(),
module_file_spec.GetDirectory() ? "/" : "",
module_file_spec.GetFilename().AsCString(),
- section->GetName().AsCString(),
+ section_sp->GetName().AsCString(),
load_addr);
}
bool erased = false;
Mutex::Locker locker(m_mutex);
- sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section);
+ sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section_sp.get());
if (sta_pos != m_sect_to_addr.end())
{
erased = true;
@@ -247,7 +250,7 @@
addr_to_sect_collection::const_iterator pos, end;
for (pos = m_addr_to_sect.begin(), end = m_addr_to_sect.end(); pos != end; ++pos)
{
- s.Printf("addr = 0x%16.16llx, section = %p: ", pos->first, pos->second);
+ s.Printf("addr = 0x%16.16llx, section = %p: ", pos->first, pos->second.get());
pos->second->Dump (&s, target, 0);
}
}
Modified: lldb/branches/apple/python-GIL/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lldbutil.py?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lldbutil.py (original)
+++ lldb/branches/apple/python-GIL/test/lldbutil.py Tue Jul 10 02:32:45 2012
@@ -82,7 +82,7 @@
import struct
if bytesize == 1:
- return ba[0]
+ return bytes[0]
# Little endian followed by a format character.
template = "<%c"
Modified: lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=159984&r1=159983&r2=159984&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Jul 10 02:32:45 2012
@@ -495,7 +495,7 @@
i386,
);
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 187;
+ CURRENT_PROJECT_VERSION = 188;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
@@ -515,7 +515,7 @@
armv7s,
);
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
- CURRENT_PROJECT_VERSION = 187;
+ CURRENT_PROJECT_VERSION = 188;
DEAD_CODE_STRIPPING = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -540,7 +540,7 @@
x86_64,
i386,
);
- CURRENT_PROJECT_VERSION = 187;
+ CURRENT_PROJECT_VERSION = 188;
DEAD_CODE_STRIPPING = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -560,7 +560,7 @@
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 187;
+ CURRENT_PROJECT_VERSION = 188;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -612,7 +612,7 @@
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 187;
+ CURRENT_PROJECT_VERSION = 188;
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -661,7 +661,7 @@
"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 187;
+ CURRENT_PROJECT_VERSION = 188;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
More information about the lldb-commits
mailing list