[Lldb-commits] [lldb] r157279 - in /lldb/branches/apple/python-GIL: ./ examples/summaries/cocoa/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Target/ scripts/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Interpreter/ source/Plugins/DynamicLoader/Darwin-Kernel/ source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/Platform/MacOSX/ source/Plugins/Process/gdb-remote/ source/Plu...
Filipe Cabecinhas
me at filcab.net
Tue May 22 12:47:58 PDT 2012
Author: filcab
Date: Tue May 22 14:47:58 2012
New Revision: 157279
URL: http://llvm.org/viewvc/llvm-project?rev=157279&view=rev
Log:
Merge changes from ToT trunk.
Added:
lldb/branches/apple/python-GIL/test/lang/cpp/rvalue-references/
- copied from r157275, lldb/trunk/test/lang/cpp/rvalue-references/
lldb/branches/apple/python-GIL/test/lang/cpp/rvalue-references/Makefile
- copied unchanged from r157275, lldb/trunk/test/lang/cpp/rvalue-references/Makefile
lldb/branches/apple/python-GIL/test/lang/cpp/rvalue-references/TestRvalueReferences.py
- copied unchanged from r157275, lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py
lldb/branches/apple/python-GIL/test/lang/cpp/rvalue-references/main.cpp
- copied unchanged from r157275, lldb/trunk/test/lang/cpp/rvalue-references/main.cpp
lldb/branches/apple/python-GIL/test/lang/objc/rdar-11355592/
- copied from r157275, lldb/trunk/test/lang/objc/rdar-11355592/
lldb/branches/apple/python-GIL/test/lang/objc/rdar-11355592/Makefile
- copied unchanged from r157275, lldb/trunk/test/lang/objc/rdar-11355592/Makefile
lldb/branches/apple/python-GIL/test/lang/objc/rdar-11355592/TestRdar11355592.py
- copied unchanged from r157275, lldb/trunk/test/lang/objc/rdar-11355592/TestRdar11355592.py
lldb/branches/apple/python-GIL/test/lang/objc/rdar-11355592/main.m
- copied unchanged from r157275, lldb/trunk/test/lang/objc/rdar-11355592/main.m
Modified:
lldb/branches/apple/python-GIL/ (props changed)
lldb/branches/apple/python-GIL/examples/summaries/cocoa/objc_runtime.py
lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointResolverFileLine.h
lldb/branches/apple/python-GIL/include/lldb/Core/Broadcaster.h
lldb/branches/apple/python-GIL/include/lldb/Core/Disassembler.h
lldb/branches/apple/python-GIL/include/lldb/Core/SearchFilter.h
lldb/branches/apple/python-GIL/include/lldb/Core/SourceManager.h
lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h
lldb/branches/apple/python-GIL/include/lldb/Expression/ClangExpressionDeclMap.h
lldb/branches/apple/python-GIL/include/lldb/Target/LanguageRuntime.h
lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
lldb/branches/apple/python-GIL/include/lldb/Target/Target.h
lldb/branches/apple/python-GIL/llvm.zip
lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff
lldb/branches/apple/python-GIL/source/API/SBTarget.cpp
lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointResolverFileLine.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.h
lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp
lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/branches/apple/python-GIL/source/Symbol/CompileUnit.cpp
lldb/branches/apple/python-GIL/source/Target/Process.cpp
lldb/branches/apple/python-GIL/source/Target/Target.cpp
lldb/branches/apple/python-GIL/test/dotest.py
lldb/branches/apple/python-GIL/test/lang/cpp/this/TestCPPThis.py
lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
lldb/branches/apple/python-GIL/www/lldb-gdb.html
Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 22 14:47:58 2012
@@ -1 +1 @@
-/lldb/trunk:156467-157110
+/lldb/trunk:156467-157275
Modified: lldb/branches/apple/python-GIL/examples/summaries/cocoa/objc_runtime.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/summaries/cocoa/objc_runtime.py?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/summaries/cocoa/objc_runtime.py (original)
+++ lldb/branches/apple/python-GIL/examples/summaries/cocoa/objc_runtime.py Tue May 22 14:47:58 2012
@@ -21,19 +21,19 @@
content = process.ReadCStringFromMemory(pointer,max_len,error)
except:
pass
- if content == None or len(content) == 0 or error.fail == True:
+ if content is None or len(content) == 0 or error.fail:
return None
return content
@staticmethod
- def is_valid_pointer(pointer, pointer_size, allow_tagged=False, allow_NULL=False):
+ def is_valid_pointer(pointer, pointer_size, allow_tagged=0, allow_NULL=0):
logger = lldb.formatters.Logger.Logger()
- if pointer == None:
- return False
+ if pointer is None:
+ return 0
if pointer == 0:
return allow_NULL
if allow_tagged and (pointer % 2) == 1:
- return True
+ return 1
return ((pointer % pointer_size) == 0)
# Objective-C runtime has a rule that pointers in a class_t will only have bits 0 thru 46 set
@@ -41,15 +41,17 @@
@staticmethod
def is_allowed_pointer(pointer):
logger = lldb.formatters.Logger.Logger()
- if pointer == None:
- return False
+ if pointer is None:
+ return 0
return ((pointer & 0xFFFF800000000000) == 0)
@staticmethod
def read_child_of(valobj,offset,type):
logger = lldb.formatters.Logger.Logger()
+ if offset == 0 and type.GetByteSize() == valobj.GetByteSize():
+ return valobj.GetValueAsUnsigned()
child = valobj.CreateChildAtOffset("childUNK",offset,type)
- if child == None or child.IsValid() == False:
+ if child is None or child.IsValid() == 0:
return None;
return child.GetValueAsUnsigned()
@@ -74,10 +76,10 @@
# assume the only thing that has a Foundation.framework is a Mac
# assume anything < Lion does not even exist
mod = target.module['Foundation']
- if mod == None or mod.IsValid() == False:
+ if mod is None or mod.IsValid() == 0:
return None
ver = mod.GetVersion()
- if ver == None or ver == []:
+ if ver is None or ver == []:
return None
return (ver[0] < 900)
@@ -88,18 +90,18 @@
def prepare_class_detection(valobj,statistics):
logger = lldb.formatters.Logger.Logger()
class_data = ObjCRuntime(valobj)
- if class_data.is_valid() == False:
+ if class_data.is_valid() == 0:
statistics.metric_hit('invalid_pointer',valobj)
wrapper = InvalidPointer_Description(valobj.GetValueAsUnsigned(0) == 0)
return class_data,wrapper
class_data = class_data.read_class_data()
- if class_data.is_valid() == False:
+ if class_data.is_valid() == 0:
statistics.metric_hit('invalid_isa',valobj)
wrapper = InvalidISA_Description()
return class_data,wrapper
if class_data.is_kvo():
class_data = class_data.get_superclass()
- if class_data.is_valid() == False:
+ if class_data.is_valid() == 0:
statistics.metric_hit('invalid_isa',valobj)
wrapper = InvalidISA_Description()
return class_data,wrapper
@@ -109,7 +111,7 @@
class RoT_Data:
def __init__(self,rot_pointer,params):
logger = lldb.formatters.Logger.Logger()
- if (Utilities.is_valid_pointer(rot_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=False)):
+ if (Utilities.is_valid_pointer(rot_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=0)):
self.sys_params = params
self.valobj = rot_pointer
#self.flags = Utilities.read_child_of(self.valobj,0,self.sys_params.uint32_t)
@@ -118,22 +120,22 @@
offset = 24 if self.sys_params.is_64_bit else 16
#self.ivarLayoutPtr = Utilities.read_child_of(self.valobj,offset,self.sys_params.addr_ptr_type)
self.namePointer = Utilities.read_child_of(self.valobj,offset,self.sys_params.types_cache.addr_ptr_type)
- self.check_valid()
+ self.valid = 1 # self.check_valid()
else:
logger >> "Marking as invalid - rot is invalid"
- self.valid = False
+ self.valid = 0
if self.valid:
self.name = Utilities.read_ascii(self.valobj.GetTarget().GetProcess(),self.namePointer)
if not(Utilities.is_valid_identifier(self.name)):
logger >> "Marking as invalid - name is invalid"
- self.valid = False
+ self.valid = 0
# perform sanity checks on the contents of this class_ro_t
def check_valid(self):
- self.valid = True
+ self.valid = 1
# misaligned pointers seem to be possible for this field
- #if not(Utilities.is_valid_pointer(self.namePointer,self.sys_params.pointer_size,allow_tagged=False)):
- # self.valid = False
+ #if not(Utilities.is_valid_pointer(self.namePointer,self.sys_params.pointer_size,allow_tagged=0)):
+ # self.valid = 0
# pass
def __str__(self):
@@ -145,14 +147,14 @@
def is_valid(self):
return self.valid
- def instance_size(self,align=False):
+ def instance_size(self,align=0):
logger = lldb.formatters.Logger.Logger()
- if self.is_valid() == False:
+ if self.is_valid() == 0:
return None
- if self.instanceSize == None:
+ if self.instanceSize is None:
self.instanceSize = Utilities.read_child_of(self.valobj,8,self.sys_params.types_cache.uint32_t)
if align:
- unalign = self.instance_size(False)
+ unalign = self.instance_size(0)
if self.sys_params.is_64_bit:
return ((unalign + 7) & ~7) % 0x100000000
else:
@@ -163,7 +165,7 @@
class RwT_Data:
def __init__(self,rwt_pointer,params):
logger = lldb.formatters.Logger.Logger()
- if (Utilities.is_valid_pointer(rwt_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=False)):
+ if (Utilities.is_valid_pointer(rwt_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=0)):
self.sys_params = params
self.valobj = rwt_pointer
#self.flags = Utilities.read_child_of(self.valobj,0,self.sys_params.uint32_t)
@@ -172,7 +174,7 @@
self.check_valid()
else:
logger >> "Marking as invalid - rwt is invald"
- self.valid = False
+ self.valid = 0
if self.valid:
self.rot = self.valobj.CreateValueFromData("rot",lldb.SBData.CreateDataFromUInt64Array(self.sys_params.endianness, self.sys_params.pointer_size, [self.roPointer]),self.sys_params.types_cache.addr_ptr_type)
# self.rot = self.valobj.CreateValueFromAddress("rot",self.roPointer,self.sys_params.types_cache.addr_ptr_type).AddressOf()
@@ -181,10 +183,10 @@
# perform sanity checks on the contents of this class_rw_t
def check_valid(self):
logger = lldb.formatters.Logger.Logger()
- self.valid = True
- if not(Utilities.is_valid_pointer(self.roPointer,self.sys_params.pointer_size,allow_tagged=False)):
+ self.valid = 1
+ if not(Utilities.is_valid_pointer(self.roPointer,self.sys_params.pointer_size,allow_tagged=0)):
logger >> "Marking as invalid - ropointer is invalid"
- self.valid = False
+ self.valid = 0
def __str__(self):
logger = lldb.formatters.Logger.Logger()
@@ -195,18 +197,18 @@
logger = lldb.formatters.Logger.Logger()
if self.valid:
return self.data.is_valid()
- return False
+ return 0
class Class_Data_V2:
def __init__(self,isa_pointer,params):
logger = lldb.formatters.Logger.Logger()
- if (isa_pointer != None) and (Utilities.is_valid_pointer(isa_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=False)):
+ if (isa_pointer != None) and (Utilities.is_valid_pointer(isa_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=0)):
self.sys_params = params
self.valobj = isa_pointer
self.check_valid()
else:
logger >> "Marking as invalid - isa is invalid or None"
- self.valid = False
+ self.valid = 0
if self.valid:
self.rwt = self.valobj.CreateValueFromData("rwt",lldb.SBData.CreateDataFromUInt64Array(self.sys_params.endianness, self.sys_params.pointer_size, [self.dataPointer]),self.sys_params.types_cache.addr_ptr_type)
# self.rwt = self.valobj.CreateValueFromAddress("rwt",self.dataPointer,self.sys_params.types_cache.addr_ptr_type).AddressOf()
@@ -217,56 +219,56 @@
# that we have an invalid object, we stop reading
def check_valid(self):
logger = lldb.formatters.Logger.Logger()
- self.valid = True
-
+ self.valid = 1
+
self.isaPointer = Utilities.read_child_of(self.valobj,0,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.isaPointer,self.sys_params.pointer_size,allow_tagged=False)):
+ if not(Utilities.is_valid_pointer(self.isaPointer,self.sys_params.pointer_size,allow_tagged=0)):
logger >> "Marking as invalid - isaPointer is invalid"
- self.valid = False
+ self.valid = 0
return
if not(Utilities.is_allowed_pointer(self.isaPointer)):
logger >> "Marking as invalid - isaPointer is not allowed"
- self.valid = False
+ self.valid = 0
return
self.cachePointer = Utilities.read_child_of(self.valobj,2*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.cachePointer,self.sys_params.pointer_size,allow_tagged=False)):
+ if not(Utilities.is_valid_pointer(self.cachePointer,self.sys_params.pointer_size,allow_tagged=0)):
logger >> "Marking as invalid - cachePointer is invalid"
- self.valid = False
+ self.valid = 0
return
if not(Utilities.is_allowed_pointer(self.cachePointer)):
logger >> "Marking as invalid - cachePointer is not allowed"
- self.valid = False
+ self.valid = 0
return
self.vtablePointer = Utilities.read_child_of(self.valobj,3*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.vtablePointer,self.sys_params.pointer_size,allow_tagged=False)):
+ if not(Utilities.is_valid_pointer(self.vtablePointer,self.sys_params.pointer_size,allow_tagged=0)):
logger >> "Marking as invalid - vtablePointer is invalid"
- self.valid = False
+ self.valid = 0
return
if not(Utilities.is_allowed_pointer(self.vtablePointer)):
logger >> "Marking as invalid - vtablePointer is not allowed"
- self.valid = False
+ self.valid = 0
return
self.dataPointer = Utilities.read_child_of(self.valobj,4*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.dataPointer,self.sys_params.pointer_size,allow_tagged=False)):
+ if not(Utilities.is_valid_pointer(self.dataPointer,self.sys_params.pointer_size,allow_tagged=0)):
logger >> "Marking as invalid - dataPointer is invalid"
- self.valid = False
+ self.valid = 0
return
if not(Utilities.is_allowed_pointer(self.dataPointer)):
logger >> "Marking as invalid - dataPointer is not allowed"
- self.valid = False
+ self.valid = 0
return
self.superclassIsaPointer = Utilities.read_child_of(self.valobj,1*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.superclassIsaPointer,self.sys_params.pointer_size,allow_tagged=False, allow_NULL=True)):
+ if not(Utilities.is_valid_pointer(self.superclassIsaPointer,self.sys_params.pointer_size,allow_tagged=0, allow_NULL=1)):
logger >> "Marking as invalid - superclassIsa is invalid"
- self.valid = False
+ self.valid = 0
return
if not(Utilities.is_allowed_pointer(self.superclassIsaPointer)):
logger >> "Marking as invalid - superclassIsa is not allowed"
- self.valid = False
+ self.valid = 0
return
# in general, KVO is implemented by transparently subclassing
@@ -277,8 +279,8 @@
logger = lldb.formatters.Logger.Logger()
if self.is_valid():
if self.class_name().startswith("NSKVONotifying_"):
- return True
- return False
+ return 1
+ return 0
# some CF classes have a valid ObjC isa in their CFRuntimeBase
# but instead of being class-specific this isa points to a match-'em-all class
@@ -310,7 +312,7 @@
logger = lldb.formatters.Logger.Logger()
if self.valid:
return self.data.is_valid()
- return False
+ return 0
def __str__(self):
logger = lldb.formatters.Logger.Logger()
@@ -321,11 +323,11 @@
"data = " + hex(self.dataPointer)
def is_tagged(self):
- return False
+ return 0
- def instance_size(self,align=False):
+ def instance_size(self,align=0):
logger = lldb.formatters.Logger.Logger()
- if self.is_valid() == False:
+ if self.is_valid() == 0:
return None
return self.rwt.rot.instance_size(align)
@@ -333,40 +335,40 @@
class Class_Data_V1:
def __init__(self,isa_pointer,params):
logger = lldb.formatters.Logger.Logger()
- if (isa_pointer != None) and (Utilities.is_valid_pointer(isa_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=False)):
- self.valid = True
+ if (isa_pointer != None) and (Utilities.is_valid_pointer(isa_pointer.GetValueAsUnsigned(),params.pointer_size, allow_tagged=0)):
+ self.valid = 1
self.sys_params = params
self.valobj = isa_pointer
self.check_valid()
else:
logger >> "Marking as invalid - isaPointer is invalid or None"
- self.valid = False
+ self.valid = 0
if self.valid:
self.name = Utilities.read_ascii(self.valobj.GetTarget().GetProcess(),self.namePointer)
if not(Utilities.is_valid_identifier(self.name)):
logger >> "Marking as invalid - name is not valid"
- self.valid = False
+ self.valid = 0
# perform sanity checks on the contents of this class_t
def check_valid(self):
logger = lldb.formatters.Logger.Logger()
- self.valid = True
+ self.valid = 1
self.isaPointer = Utilities.read_child_of(self.valobj,0,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.isaPointer,self.sys_params.pointer_size,allow_tagged=False)):
+ if not(Utilities.is_valid_pointer(self.isaPointer,self.sys_params.pointer_size,allow_tagged=0)):
logger >> "Marking as invalid - isaPointer is invalid"
- self.valid = False
+ self.valid = 0
return
self.superclassIsaPointer = Utilities.read_child_of(self.valobj,1*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
- if not(Utilities.is_valid_pointer(self.superclassIsaPointer,self.sys_params.pointer_size,allow_tagged=False,allow_NULL=True)):
+ if not(Utilities.is_valid_pointer(self.superclassIsaPointer,self.sys_params.pointer_size,allow_tagged=0,allow_NULL=1)):
logger >> "Marking as invalid - superclassIsa is invalid"
- self.valid = False
+ self.valid = 0
return
self.namePointer = Utilities.read_child_of(self.valobj,2*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
- #if not(Utilities.is_valid_pointer(self.namePointer,self.sys_params.pointer_size,allow_tagged=False,allow_NULL=False)):
- # self.valid = False
+ #if not(Utilities.is_valid_pointer(self.namePointer,self.sys_params.pointer_size,allow_tagged=0,allow_NULL=0)):
+ # self.valid = 0
# return
# in general, KVO is implemented by transparently subclassing
@@ -377,8 +379,8 @@
logger = lldb.formatters.Logger.Logger()
if self.is_valid():
if self.class_name().startswith("NSKVONotifying_"):
- return True
- return False
+ return 1
+ return 0
# some CF classes have a valid ObjC isa in their CFRuntimeBase
# but instead of being class-specific this isa points to a match-'em-all class
@@ -417,16 +419,16 @@
"instanceSize = " + hex(self.instanceSize()) + "\n"
def is_tagged(self):
- return False
+ return 0
- def instance_size(self,align=False):
+ def instance_size(self,align=0):
logger = lldb.formatters.Logger.Logger()
- if self.is_valid() == False:
+ if self.is_valid() == 0:
return None
- if self.instanceSize == None:
+ if self.instanceSize is None:
self.instanceSize = Utilities.read_child_of(self.valobj,5*self.sys_params.pointer_size,self.sys_params.types_cache.addr_ptr_type)
if align:
- unalign = self.instance_size(False)
+ unalign = self.instance_size(0)
if self.sys_params.is_64_bit:
return ((unalign + 7) & ~7) % 0x100000000
else:
@@ -452,7 +454,7 @@
def __init__(self,pointer,params):
logger = lldb.formatters.Logger.Logger()
global TaggedClass_Values_Lion,TaggedClass_Values_NMOS
- self.valid = True
+ self.valid = 1
self.name = None
self.sys_params = params
self.valobj = pointer
@@ -465,13 +467,13 @@
self.name = TaggedClass_Values_Lion[self.class_bits]
else:
logger >> "Marking as invalid - not a good tagged pointer for Lion"
- self.valid = False
+ self.valid = 0
else:
if self.class_bits in TaggedClass_Values_NMOS:
self.name = TaggedClass_Values_NMOS[self.class_bits]
else:
logger >> "Marking as invalid - not a good tagged pointer for NMOS"
- self.valid = False
+ self.valid = 0
def is_valid(self):
@@ -482,7 +484,7 @@
if self.is_valid():
return self.name
else:
- return False
+ return 0
def value(self):
return self.val if self.is_valid() else None
@@ -491,10 +493,10 @@
return self.i_bits if self.is_valid() else None
def is_kvo(self):
- return False
+ return 0
def is_cftype(self):
- return False
+ return 0
# we would need to go around looking for the superclass or ask the runtime
# for now, we seem not to require support for this operation so we will merrily
@@ -504,12 +506,12 @@
# anything that is handled here is tagged
def is_tagged(self):
- return True
+ return 1
# it seems reasonable to say that a tagged pointer is the size of a pointer
- def instance_size(self,align=False):
+ def instance_size(self,align=0):
logger = lldb.formatters.Logger.Logger()
- if self.is_valid() == False:
+ if self.is_valid() == 0:
return None
return self.sys_params.pointer_size
@@ -518,7 +520,7 @@
def __init__(self):
pass
def is_valid(self):
- return False
+ return 0
@functools.total_ordering
class Version:
@@ -544,14 +546,14 @@
def __lt__(self,other):
if (self.major < other.major):
- return True
+ return 1
if (self.minor < other.minor):
- return True
+ return 1
if (self.release < other.release):
- return True
+ return 1
# build strings are not compared since they are heavily platform-dependent and might not always
# be available
- return False
+ return 0
def __eq__(self,other):
return (self.major == other.major) and \
@@ -595,7 +597,7 @@
if types_caches.look_for_key(self.pid):
self.types_cache = types_caches.get_value(self.pid)
else:
- self.types_cache = lldb.formatters.attrib_fromdict.AttributesDictionary(allow_reset=False)
+ self.types_cache = lldb.formatters.attrib_fromdict.AttributesDictionary(allow_reset=0)
self.types_cache.addr_type = valobj.GetType().GetBasicType(lldb.eBasicTypeUnsignedLong)
self.types_cache.addr_ptr_type = self.types_cache.addr_type.GetPointerType()
self.types_cache.uint32_t = valobj.GetType().GetBasicType(lldb.eBasicTypeUnsignedInt)
@@ -632,7 +634,7 @@
@staticmethod
def runtime_version(process):
logger = lldb.formatters.Logger.Logger()
- if process.IsValid() == False:
+ if process.IsValid() == 0:
logger >> "No process - bailing out"
return None
target = process.GetTarget()
@@ -643,7 +645,7 @@
if module.GetFileSpec().GetFilename() == 'libobjc.A.dylib':
module_objc = module
break
- if module_objc == None or module_objc.IsValid() == False:
+ if module_objc is None or module_objc.IsValid() == 0:
logger >> "no libobjc - bailing out"
return None
num_sections = module.GetNumSections()
@@ -681,17 +683,17 @@
def is_tagged(self):
logger = lldb.formatters.Logger.Logger()
if self.valobj is None:
- return False
- return (Utilities.is_valid_pointer(self.unsigned_value,self.sys_params.pointer_size, allow_tagged=True) and \
- not(Utilities.is_valid_pointer(self.unsigned_value,self.sys_params.pointer_size, allow_tagged=False)))
+ return 0
+ return (Utilities.is_valid_pointer(self.unsigned_value,self.sys_params.pointer_size, allow_tagged=1) and \
+ not(Utilities.is_valid_pointer(self.unsigned_value,self.sys_params.pointer_size, allow_tagged=0)))
def is_valid(self):
logger = lldb.formatters.Logger.Logger()
if self.valobj is None:
- return False
- if self.valobj.IsInScope() == False:
- return False
- return Utilities.is_valid_pointer(self.unsigned_value,self.sys_params.pointer_size, allow_tagged=True)
+ return 0
+ if self.valobj.IsInScope() == 0:
+ return 0
+ return Utilities.is_valid_pointer(self.unsigned_value,self.sys_params.pointer_size, allow_tagged=1)
def is_nil(self):
return self.unsigned_value == 0
@@ -701,17 +703,17 @@
if self.isa_value != None:
logger >> "using cached isa"
return self.isa_value
- isa_pointer = self.valobj.CreateChildAtOffset("cfisa",
+ self.isa_pointer = self.valobj.CreateChildAtOffset("cfisa",
0,
self.sys_params.types_cache.addr_ptr_type)
- if isa_pointer == None or isa_pointer.IsValid() == False:
+ if self.isa_pointer is None or self.isa_pointer.IsValid() == 0:
logger >> "invalid isa - bailing out"
return None;
- if isa_pointer.GetValueAsUnsigned(1) == 1:
+ self.isa_value = self.isa_pointer.GetValueAsUnsigned(1)
+ if self.isa_value == 1:
logger >> "invalid isa value - bailing out"
return None;
- self.isa_value = isa_pointer
- return isa_pointer
+ return Ellipsis
def read_class_data(self):
logger = lldb.formatters.Logger.Logger()
@@ -733,25 +735,19 @@
else:
logger >> "on v1 and tagged - error"
return InvalidClass_Data()
- if self.is_valid() == False:
- return InvalidClass_Data()
- isa = self.read_isa()
- if isa == None:
- return InvalidClass_Data()
- isa_value = isa.GetValueAsUnsigned(1)
- if isa_value == 1:
+ if self.is_valid() == 0 or self.read_isa() is None:
return InvalidClass_Data()
- data = self.sys_params.isa_cache.get_value(isa_value,default=None)
+ data = self.sys_params.isa_cache.get_value(self.isa_value,default=None)
if data != None:
return data
if self.sys_params.runtime_version == 2:
- data = Class_Data_V2(isa,self.sys_params)
+ data = Class_Data_V2(self.isa_pointer,self.sys_params)
else:
- data = Class_Data_V1(isa,self.sys_params)
- if data == None:
+ data = Class_Data_V1(self.isa_pointer,self.sys_params)
+ if data is None:
return InvalidClass_Data()
if data.is_valid():
- self.sys_params.isa_cache.add_item(isa_value,data,ok_to_replace=True)
+ self.sys_params.isa_cache.add_item(self.isa_value,data,ok_to_replace=1)
return data
# these classes below can be used by the data formatters to provide a consistent message that describes a given runtime-generated situation
Modified: lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointResolverFileLine.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointResolverFileLine.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointResolverFileLine.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointResolverFileLine.h Tue May 22 14:47:58 2012
@@ -31,7 +31,8 @@
BreakpointResolverFileLine (Breakpoint *bkpt,
const FileSpec &resolver,
uint32_t line_no,
- bool check_inlines);
+ bool check_inlines,
+ bool skip_prologue);
virtual
~BreakpointResolverFileLine ();
@@ -62,6 +63,7 @@
FileSpec m_file_spec; // This is the file spec we are looking for.
uint32_t m_line_number; // This is the line number that we are looking for.
bool m_inlines; // This determines whether the resolver looks for inlined functions or not.
+ bool m_skip_prologue;
private:
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/Broadcaster.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/Broadcaster.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/Broadcaster.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/Broadcaster.h Tue May 22 14:47:58 2012
@@ -86,9 +86,9 @@
{
public:
BroadcasterManager ();
-
- ~BroadcasterManager () {};
-
+
+ ~BroadcasterManager () {}
+
uint32_t
RegisterListenerForEvents (Listener &listener, BroadcastEventSpec event_spec);
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/Disassembler.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/Disassembler.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/Disassembler.h Tue May 22 14:47:58 2012
@@ -92,7 +92,7 @@
uint32_t data_offset) = 0;
virtual void
- SetDescription (const char *) {}; // May be overridden in sub-classes that have descriptions.
+ SetDescription (const char *) {} // May be overridden in sub-classes that have descriptions.
lldb::OptionValueSP
ReadArray (FILE *in_file, Stream *out_stream, OptionValue::Type data_type);
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/SearchFilter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/SearchFilter.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/SearchFilter.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/SearchFilter.h Tue May 22 14:47:58 2012
@@ -281,7 +281,7 @@
public SearchFilter
{
public:
- SearchFilterForNonModuleSpecificSearches (const lldb::TargetSP &targetSP) : SearchFilter(targetSP) {};
+ SearchFilterForNonModuleSpecificSearches (const lldb::TargetSP &targetSP) : SearchFilter(targetSP) {}
~SearchFilterForNonModuleSpecificSearches () {}
virtual bool
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/SourceManager.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/SourceManager.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/SourceManager.h Tue May 22 14:47:58 2012
@@ -88,8 +88,8 @@
class SourceFileCache
{
public:
- SourceFileCache () {};
- ~SourceFileCache() {};
+ SourceFileCache () {}
+ ~SourceFileCache() {}
void AddSourceFile (const FileSP &file_sp);
FileSP FindSourceFile (const FileSpec &file_spec) const;
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=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h Tue May 22 14:47:58 2012
@@ -600,9 +600,6 @@
IsPointerOrReferenceType ();
virtual bool
- IsPossibleCPlusPlusDynamicType ();
-
- virtual bool
IsPossibleDynamicType ();
virtual bool
Modified: lldb/branches/apple/python-GIL/include/lldb/Expression/ClangExpressionDeclMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Expression/ClangExpressionDeclMap.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Expression/ClangExpressionDeclMap.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Expression/ClangExpressionDeclMap.h Tue May 22 14:47:58 2012
@@ -809,6 +809,10 @@
/// during parsing, in which case we don't know its type; hence the
/// default.
///
+ /// @param[in] object_pointer
+ /// The type expected is an object type. This means we will ignore
+ /// constness of the pointer target.
+ ///
/// @return
/// The LLDB Variable found, or NULL if none was found.
//------------------------------------------------------------------
@@ -816,7 +820,7 @@
FindVariableInScope (StackFrame &frame,
const ConstString &name,
TypeFromUser *type = NULL,
- bool ignore_const = false);
+ bool object_pointer = false);
//------------------------------------------------------------------
/// Given a target, find a data symbol that has the given name.
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/LanguageRuntime.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/LanguageRuntime.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/LanguageRuntime.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/LanguageRuntime.h Tue May 22 14:47:58 2012
@@ -99,7 +99,7 @@
bool catch_bp,
bool throw_bp);
- virtual ~ExceptionBreakpointResolver() {};
+ virtual ~ExceptionBreakpointResolver() {}
virtual Searcher::CallbackReturn
SearchCallback (SearchFilter &filter,
@@ -114,7 +114,7 @@
GetDescription (Stream *s);
virtual void
- Dump (Stream *s) const {};
+ Dump (Stream *s) const {}
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const BreakpointResolverName *) { return true; }
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Process.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Process.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Process.h Tue May 22 14:47:58 2012
@@ -3088,6 +3088,9 @@
GetObjCLanguageRuntime (bool retry_if_null = true);
bool
+ IsPossibleDynamicValue (ValueObject& in_value);
+
+ bool
IsRunning () const;
DynamicCheckerFunctions *GetDynamicCheckers()
@@ -3236,7 +3239,7 @@
}
virtual EventActionResult PerformAction (lldb::EventSP &event_sp) = 0;
- virtual void HandleBeingUnshipped () {};
+ virtual void HandleBeingUnshipped () {}
virtual EventActionResult HandleBeingInterrupted () = 0;
virtual const char *GetExitString() = 0;
protected:
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/Target.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Target.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Target.h Tue May 22 14:47:58 2012
@@ -448,6 +448,7 @@
const FileSpec &file,
uint32_t line_no,
bool check_inlines,
+ LazyBool skip_prologue = eLazyBoolCalculate,
bool internal = false);
// Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
@@ -474,8 +475,8 @@
CreateFuncRegexBreakpoint (const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
RegularExpression &func_regexp,
- bool internal = false,
- LazyBool skip_prologue = eLazyBoolCalculate);
+ LazyBool skip_prologue = eLazyBoolCalculate,
+ bool internal = false);
// Use this to create a function breakpoint by name in containingModule, or all modules if it is NULL
// When "skip_prologue is set to eLazyBoolCalculate, we use the current target
@@ -485,8 +486,8 @@
const FileSpecList *containingSourceFiles,
const char *func_name,
uint32_t func_name_type_mask,
- bool internal = false,
- LazyBool skip_prologue = eLazyBoolCalculate);
+ LazyBool skip_prologue = eLazyBoolCalculate,
+ bool internal = false);
lldb::BreakpointSP
CreateExceptionBreakpoint (enum lldb::LanguageType language, bool catch_bp, bool throw_bp, bool internal = false);
@@ -500,16 +501,16 @@
const char *func_names[],
size_t num_names,
uint32_t func_name_type_mask,
- bool internal = false,
- LazyBool skip_prologue = eLazyBoolCalculate);
+ LazyBool skip_prologue = eLazyBoolCalculate,
+ bool internal = false);
lldb::BreakpointSP
CreateBreakpoint (const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
const std::vector<std::string> &func_names,
uint32_t func_name_type_mask,
- bool internal = false,
- LazyBool skip_prologue = eLazyBoolCalculate);
+ LazyBool skip_prologue = eLazyBoolCalculate,
+ bool internal = false);
// Use this to create a general breakpoint:
Modified: lldb/branches/apple/python-GIL/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/llvm.zip?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
Binary files - no diff available.
Modified: lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff Tue May 22 14:47:58 2012
@@ -814,6 +814,24 @@
} else if (ObjCArrayLiteral *ArrayLit = dyn_cast<ObjCArrayLiteral>(E)) {
D = ArrayLit->getArrayWithObjectsMethod();
} else if (ObjCDictionaryLiteral *DictLit
+@@ -4529,6 +4529,17 @@
+ if (RD->isInvalidDecl() || RD->isDependentContext())
+ return Owned(E);
+
++ if (!RD->getDefinition()) {
++ if (RD->hasExternalLexicalStorage()) {
++ ExternalASTSource *ext_source = RD->getASTContext().getExternalSource();
++ if (ext_source)
++ ext_source->CompleteType(RD);
++ }
++ }
++
++ if (!RD->getDefinition())
++ return Owned(E);
++
+ bool IsDecltype = ExprEvalContexts.back().IsDecltype;
+ CXXDestructorDecl *Destructor = IsDecltype ? 0 : LookupDestructor(RD);
+
Index: lib/Sema/SemaExceptionSpec.cpp
===================================================================
--- lib/Sema/SemaExceptionSpec.cpp (revision 152265)
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=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBTarget.cpp Tue May 22 14:47:58 2012
@@ -1170,7 +1170,11 @@
if (target_sp && line != 0)
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
- *sb_bp = target_sp->CreateBreakpoint (NULL, *sb_file_spec, line, true, false);
+
+ const bool check_inlines = true;
+ const bool internal = false;
+ const LazyBool skip_prologue = eLazyBoolCalculate;
+ *sb_bp = target_sp->CreateBreakpoint (NULL, *sb_file_spec, line, check_inlines, skip_prologue, internal);
}
if (log)
@@ -1200,15 +1204,18 @@
if (target_sp.get())
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
+
+ const bool internal = false;
+ const LazyBool skip_prologue = eLazyBoolCalculate;
if (module_name && module_name[0])
{
FileSpecList module_spec_list;
module_spec_list.Append (FileSpec (module_name, false));
- *sb_bp = target_sp->CreateBreakpoint (&module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto, false);
+ *sb_bp = target_sp->CreateBreakpoint (&module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto, skip_prologue, internal);
}
else
{
- *sb_bp = target_sp->CreateBreakpoint (NULL, NULL, symbol_name, eFunctionNameTypeAuto, false);
+ *sb_bp = target_sp->CreateBreakpoint (NULL, NULL, symbol_name, eFunctionNameTypeAuto, skip_prologue, internal);
}
}
@@ -1242,12 +1249,15 @@
TargetSP target_sp(GetSP());
if (target_sp && symbol_name && symbol_name[0])
{
+ const bool internal = false;
+ const LazyBool skip_prologue = eLazyBoolCalculate;
Mutex::Locker api_locker (target_sp->GetAPIMutex());
*sb_bp = target_sp->CreateBreakpoint (module_list.get(),
comp_unit_list.get(),
symbol_name,
name_type_mask,
- false);
+ skip_prologue,
+ internal);
}
if (log)
@@ -1273,12 +1283,15 @@
if (target_sp && num_names > 0)
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
+ const bool internal = false;
+ const LazyBool skip_prologue = eLazyBoolCalculate;
*sb_bp = target_sp->CreateBreakpoint (module_list.get(),
comp_unit_list.get(),
symbol_names,
num_names,
name_type_mask,
- false);
+ skip_prologue,
+ internal);
}
if (log)
@@ -1314,17 +1327,19 @@
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
RegularExpression regexp(symbol_name_regex);
+ const bool internal = false;
+ const LazyBool skip_prologue = eLazyBoolCalculate;
if (module_name && module_name[0])
{
FileSpecList module_spec_list;
module_spec_list.Append (FileSpec (module_name, false));
- *sb_bp = target_sp->CreateFuncRegexBreakpoint (&module_spec_list, NULL, regexp, false);
+ *sb_bp = target_sp->CreateFuncRegexBreakpoint (&module_spec_list, NULL, regexp, skip_prologue, internal);
}
else
{
- *sb_bp = target_sp->CreateFuncRegexBreakpoint (NULL, NULL, regexp, false);
+ *sb_bp = target_sp->CreateFuncRegexBreakpoint (NULL, NULL, regexp, skip_prologue, internal);
}
}
@@ -1350,8 +1365,10 @@
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
RegularExpression regexp(symbol_name_regex);
+ const bool internal = false;
+ const LazyBool skip_prologue = eLazyBoolCalculate;
- *sb_bp = target_sp->CreateFuncRegexBreakpoint (module_list.get(), comp_unit_list.get(), regexp, false);
+ *sb_bp = target_sp->CreateFuncRegexBreakpoint (module_list.get(), comp_unit_list.get(), regexp, skip_prologue, internal);
}
if (log)
Modified: lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointResolverFileLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointResolverFileLine.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Breakpoint/BreakpointResolverFileLine.cpp Tue May 22 14:47:58 2012
@@ -16,6 +16,7 @@
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/StreamString.h"
+#include "lldb/Target/Target.h"
#include "lldb/lldb-private-log.h"
using namespace lldb;
@@ -29,12 +30,14 @@
Breakpoint *bkpt,
const FileSpec &file_spec,
uint32_t line_no,
- bool check_inlines
+ bool check_inlines,
+ bool skip_prologue
) :
BreakpointResolver (bkpt, BreakpointResolver::FileLineResolver),
m_file_spec (file_spec),
m_line_number (line_no),
- m_inlines (check_inlines)
+ m_inlines (check_inlines),
+ m_skip_prologue(skip_prologue)
{
}
@@ -135,12 +138,36 @@
{
if (filter.AddressPasses(line_start))
{
+ // If the line number is before the prologue end, move it there...
+ bool skipped_prologue = false;
+ if (m_skip_prologue)
+ {
+ if (sc.function)
+ {
+ Address prologue_addr(sc.function->GetAddressRange().GetBaseAddress());
+ if (prologue_addr.IsValid() && (line_start == prologue_addr))
+ {
+ const uint32_t prologue_byte_size = sc.function->GetPrologueByteSize();
+ if (prologue_byte_size)
+ {
+ prologue_addr.Slide(prologue_byte_size);
+
+ if (filter.AddressPasses(prologue_addr))
+ {
+ skipped_prologue = true;
+ line_start = prologue_addr;
+ }
+ }
+ }
+ }
+ }
+
BreakpointLocationSP bp_loc_sp (m_breakpoint->AddLocation(line_start));
if (log && bp_loc_sp && !m_breakpoint->IsInternal())
{
StreamString s;
bp_loc_sp->GetDescription (&s, lldb::eDescriptionLevelVerbose);
- log->Printf ("Added location: %s\n", s.GetData());
+ log->Printf ("Added location (skipped prologue: %s): %s \n", skipped_prologue ? "yes" : "no", s.GetData());
}
}
else if (log)
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp Tue May 22 14:47:58 2012
@@ -66,7 +66,8 @@
m_queue_name(),
m_catch_bp (false),
m_throw_bp (false),
- m_language (eLanguageTypeUnknown)
+ m_language (eLanguageTypeUnknown),
+ m_skip_prologue (eLazyBoolCalculate)
{
}
@@ -78,6 +79,7 @@
// update the numbers passed to LLDB_OPT_SET_FROM_TO(...) appropriately.
#define LLDB_OPT_FILE ( LLDB_OPT_SET_FROM_TO(1, 9) & ~LLDB_OPT_SET_2 )
#define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM_TO(1, 10) & ~LLDB_OPT_SET_10 )
+#define LLDB_OPT_SKIP_PROLOGUE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_FROM_TO(3,8) )
OptionDefinition
CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
@@ -148,6 +150,9 @@
{ LLDB_OPT_SET_10, false, "on-catch", 'h', required_argument, NULL, 0, eArgTypeBoolean,
"Set the breakpoint on exception catcH." },
+ { LLDB_OPT_SKIP_PROLOGUE, false, "skip-prologue", 'K', required_argument, NULL, 0, eArgTypeBoolean,
+ "sKip the prologue if the breakpoint is at the beginning of a function. If not set the target.skip-prologue setting is used." },
+
{ 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
};
@@ -295,6 +300,19 @@
if (!success)
error.SetErrorStringWithFormat ("Invalid boolean value for on-catch option: '%s'", option_arg);
}
+ case 'K':
+ {
+ bool success;
+ bool value;
+ value = Args::StringToBoolean (option_arg, true, &success);
+ if (value)
+ m_skip_prologue = eLazyBoolYes;
+ else
+ m_skip_prologue = eLazyBoolNo;
+
+ if (!success)
+ error.SetErrorStringWithFormat ("Invalid boolean value for skip prologue option: '%s'", option_arg);
+ }
break;
default:
error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);
@@ -323,6 +341,7 @@
m_language = eLanguageTypeUnknown;
m_catch_bp = false;
m_throw_bp = true;
+ m_skip_prologue = eLazyBoolCalculate;
}
//-------------------------------------------------------------------------
@@ -430,6 +449,8 @@
FileSpec module_spec;
bool use_module = false;
int num_modules = m_options.m_modules.GetSize();
+
+ const bool internal = false;
if ((num_modules > 0) && (break_type != eSetTypeAddress))
use_module = true;
@@ -461,7 +482,9 @@
bp = target->CreateBreakpoint (&(m_options.m_modules),
file,
m_options.m_line_num,
- m_options.m_check_inlines).get();
+ m_options.m_check_inlines,
+ m_options.m_skip_prologue,
+ internal).get();
}
break;
@@ -480,7 +503,8 @@
&(m_options.m_filenames),
m_options.m_func_names,
name_type_mask,
- Breakpoint::Exact).get();
+ m_options.m_skip_prologue,
+ internal).get();
}
break;
@@ -497,7 +521,11 @@
return false;
}
- bp = target->CreateFuncRegexBreakpoint (&(m_options.m_modules), &(m_options.m_filenames), regexp).get();
+ bp = target->CreateFuncRegexBreakpoint (&(m_options.m_modules),
+ &(m_options.m_filenames),
+ regexp,
+ m_options.m_skip_prologue,
+ internal).get();
}
break;
case eSetTypeSourceRegexp: // Breakpoint by regexp on source text.
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.h (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.h Tue May 22 14:47:58 2012
@@ -116,6 +116,7 @@
bool m_catch_bp;
bool m_throw_bp;
lldb::LanguageType m_language;
+ LazyBool m_skip_prologue;
};
Modified: lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp Tue May 22 14:47:58 2012
@@ -1766,15 +1766,14 @@
}
bool
-ValueObject::IsPossibleCPlusPlusDynamicType ()
-{
- return ClangASTContext::IsPossibleCPlusPlusDynamicType (GetClangAST (), GetClangType());
-}
-
-bool
ValueObject::IsPossibleDynamicType ()
{
- return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType());
+ ExecutionContext exe_ctx (GetExecutionContextRef());
+ Process *process = exe_ctx.GetProcessPtr();
+ if (process)
+ return process->IsPossibleDynamicValue(*this);
+ else
+ return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType());
}
ValueObjectSP
@@ -2058,37 +2057,8 @@
{
ExecutionContext exe_ctx (GetExecutionContextRef());
Process *process = exe_ctx.GetProcessPtr();
- if (process)
- {
- bool worth_having_dynamic_value = false;
-
-
- // FIXME: Process should have some kind of "map over Runtimes" so we don't have to
- // hard code this everywhere.
- LanguageType known_type = GetObjectRuntimeLanguage();
- if (known_type != eLanguageTypeUnknown && known_type != eLanguageTypeC)
- {
- LanguageRuntime *runtime = process->GetLanguageRuntime (known_type);
- if (runtime)
- worth_having_dynamic_value = runtime->CouldHaveDynamicValue(*this);
- }
- else
- {
- LanguageRuntime *cpp_runtime = process->GetLanguageRuntime (eLanguageTypeC_plus_plus);
- if (cpp_runtime)
- worth_having_dynamic_value = cpp_runtime->CouldHaveDynamicValue(*this);
-
- if (!worth_having_dynamic_value)
- {
- LanguageRuntime *objc_runtime = process->GetLanguageRuntime (eLanguageTypeObjC);
- if (objc_runtime)
- worth_having_dynamic_value = objc_runtime->CouldHaveDynamicValue(*this);
- }
- }
-
- if (worth_having_dynamic_value)
- m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic);
- }
+ if (process && process->IsPossibleDynamicValue(*this))
+ m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic);
}
}
Modified: lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp Tue May 22 14:47:58 2012
@@ -1221,12 +1221,12 @@
return false;
}
- const bool ignore_const = true;
+ const bool object_pointer = true;
VariableSP object_ptr_var = FindVariableInScope (*frame,
object_name,
(suppress_type_check ? NULL : &m_struct_vars->m_object_pointer_type),
- ignore_const);
+ object_pointer);
if (!object_ptr_var)
{
@@ -2175,7 +2175,7 @@
StackFrame &frame,
const ConstString &name,
TypeFromUser *type,
- bool ignore_const
+ bool object_pointer
)
{
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -2196,25 +2196,64 @@
!var_sp->LocationIsValidForFrame (&frame))
return lldb::VariableSP();
- if (var_sp && type)
+ if (var_sp)
{
- if (type->GetASTContext() == var_sp->GetType()->GetClangAST())
- {
- if (!ClangASTContext::AreTypesSame(type->GetASTContext(),
- type->GetOpaqueQualType(),
- var_sp->GetType()->GetClangFullType(),
- ignore_const))
- return lldb::VariableSP();
- }
- else
+ if (!type)
+ return var_sp;
+
+ TypeFromUser candidate_type(var_sp->GetType()->GetClangFullType(),
+ var_sp->GetType()->GetClangAST());
+
+ if (candidate_type.GetASTContext() != type->GetASTContext())
{
if (log)
log->PutCString("Skipping a candidate variable because of different AST contexts");
return lldb::VariableSP();
}
+
+ if (object_pointer)
+ {
+ clang::QualType desired_qual_type = clang::QualType::getFromOpaquePtr(type->GetOpaqueQualType());
+ clang::QualType candidate_qual_type = clang::QualType::getFromOpaquePtr(candidate_type.GetOpaqueQualType());
+
+ const clang::ObjCObjectPointerType *desired_objc_ptr_type = desired_qual_type->getAs<clang::ObjCObjectPointerType>();
+ const clang::ObjCObjectPointerType *candidate_objc_ptr_type = desired_qual_type->getAs<clang::ObjCObjectPointerType>();
+
+ if (desired_objc_ptr_type && candidate_objc_ptr_type) {
+ clang::QualType desired_target_type = desired_objc_ptr_type->getPointeeType().getUnqualifiedType();
+ clang::QualType candidate_target_type = candidate_objc_ptr_type->getPointeeType().getUnqualifiedType();
+
+ if (ClangASTContext::AreTypesSame(type->GetASTContext(),
+ desired_target_type.getAsOpaquePtr(),
+ candidate_target_type.getAsOpaquePtr()))
+ return var_sp;
+ }
+
+ const clang::PointerType *desired_ptr_type = desired_qual_type->getAs<clang::PointerType>();
+ const clang::PointerType *candidate_ptr_type = candidate_qual_type->getAs<clang::PointerType>();
+
+ if (desired_ptr_type && candidate_ptr_type) {
+ clang::QualType desired_target_type = desired_ptr_type->getPointeeType().getUnqualifiedType();
+ clang::QualType candidate_target_type = candidate_ptr_type->getPointeeType().getUnqualifiedType();
+
+ if (ClangASTContext::AreTypesSame(type->GetASTContext(),
+ desired_target_type.getAsOpaquePtr(),
+ candidate_target_type.getAsOpaquePtr()))
+ return var_sp;
+ }
+
+ return lldb::VariableSP();
+ }
+ else
+ {
+ if (ClangASTContext::AreTypesSame(type->GetASTContext(),
+ type->GetOpaqueQualType(),
+ var_sp->GetType()->GetClangFullType()))
+ return var_sp;
+ }
}
- return var_sp;
+ return lldb::VariableSP();
}
Symbol *
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=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp Tue May 22 14:47:58 2012
@@ -256,6 +256,15 @@
{
AddAlias ("add-dsym", cmd_obj_sp);
}
+
+ cmd_obj_sp = GetCommandSPExact ("breakpoint set", false);
+ if (cmd_obj_sp)
+ {
+ alias_arguments_vector_sp.reset (new OptionArgVector);
+ ProcessAliasOptionsArgs (cmd_obj_sp, "--func-regex %1", alias_arguments_vector_sp);
+ AddAlias ("rb", cmd_obj_sp);
+ AddOrReplaceAliasOptions("rb", alias_arguments_vector_sp);
+ }
}
const char *
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=157279&r1=157278&r2=157279&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 May 22 14:47:58 2012
@@ -710,7 +710,7 @@
DEBUG_PRINTF("DynamicLoaderDarwinKernel::%s() process state = %s\n", __FUNCTION__, StateAsCString(m_process->GetState()));
- const bool internal_bp = false;
+ const bool internal_bp = true;
const LazyBool skip_prologue = eLazyBoolNo;
FileSpecList module_spec_list;
module_spec_list.Append (m_kernel.module_sp->GetFileSpec());
@@ -718,8 +718,8 @@
NULL,
"OSKextLoadedKextSummariesUpdated",
eFunctionNameTypeFull,
- internal_bp,
- skip_prologue).get();
+ skip_prologue,
+ internal_bp).get();
bp->SetCallback (DynamicLoaderDarwinKernel::BreakpointHitCallback, this, true);
m_break_id = bp->GetID();
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=157279&r1=157278&r2=157279&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 May 22 14:47:58 2012
@@ -38,7 +38,9 @@
bool
ItaniumABILanguageRuntime::CouldHaveDynamicValue (ValueObject &in_value)
{
- return in_value.IsPossibleCPlusPlusDynamicType();
+ return ClangASTContext::IsPossibleDynamicType(in_value.GetClangAST(), in_value.GetClangType(), NULL,
+ true, // check for C++
+ false); // do not check for ObjC
}
bool
Modified: lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Tue May 22 14:47:58 2012
@@ -46,13 +46,13 @@
// result in an address, and we should try that to see if the address is an ObjC object.
if (!(valobj.IsPointerType() || valobj.IsIntegerType(is_signed)))
- return NULL;
+ return false;
// Make the argument list: we pass one arg, the address of our pointer, to the print function.
Value val;
if (!valobj.ResolveValue(val.GetScalar()))
- return NULL;
+ return false;
ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
return GetObjectDescription(str, val, exe_ctx.GetBestExecutionContextScope());
@@ -193,11 +193,10 @@
bool
AppleObjCRuntime::CouldHaveDynamicValue (ValueObject &in_value)
{
- lldb::LanguageType known_type = in_value.GetObjectRuntimeLanguage();
- if (known_type == lldb::eLanguageTypeObjC)
- return in_value.IsPossibleDynamicType ();
- else
- return in_value.IsPointerType();
+ return ClangASTContext::IsPossibleDynamicType(in_value.GetClangAST(), in_value.GetClangType(),
+ NULL,
+ false, // do not check C++
+ true); // check ObjC
}
bool
Modified: lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue May 22 14:47:58 2012
@@ -848,12 +848,15 @@
bp_modules.Append(FileSpec(bp_module, false));
}
+ bool internal = true;
+ LazyBool skip_prologue = eLazyBoolNo;
bp_sp = target.CreateBreakpoint (&bp_modules,
NULL,
g_bp_names,
sizeof(g_bp_names)/sizeof(const char *),
eFunctionNameTypeFull,
- true);
+ skip_prologue,
+ internal);
return bp_sp;
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue May 22 14:47:58 2012
@@ -929,3 +929,76 @@
}
}
+void
+GDBRemoteDynamicRegisterInfo::Addx86_64ConvenienceRegisters()
+{
+ // For eax, ebx, ecx, edx, esi, edi, ebp, esp register mapping.
+ static const char* g_mapped_names[] = {
+ "rax",
+ "rbx",
+ "rcx",
+ "rdx",
+ "rdi",
+ "rsi",
+ "rbp",
+ "rsp"
+ };
+
+ // These value regs are to be populated with the corresponding primordial register index.
+ // For example,
+ static uint32_t g_eax_regs[] = { 0, LLDB_INVALID_REGNUM }; // 0 is to be replaced with rax's index.
+ static uint32_t g_ebx_regs[] = { 0, LLDB_INVALID_REGNUM };
+ static uint32_t g_ecx_regs[] = { 0, LLDB_INVALID_REGNUM };
+ static uint32_t g_edx_regs[] = { 0, LLDB_INVALID_REGNUM };
+ static uint32_t g_edi_regs[] = { 0, LLDB_INVALID_REGNUM };
+ static uint32_t g_esi_regs[] = { 0, LLDB_INVALID_REGNUM };
+ static uint32_t g_ebp_regs[] = { 0, LLDB_INVALID_REGNUM };
+ static uint32_t g_esp_regs[] = { 0, LLDB_INVALID_REGNUM };
+
+ static RegisterInfo g_conv_register_infos[] =
+ {
+// NAME ALT SZ OFF ENCODING FORMAT COMPILER DWARF GENERIC GDB LLDB NATIVE VALUE REGS INVALIDATE REGS
+// ====== ======= == === ============= ============ ===================== ===================== ============================ ==================== ====================== ========== ===============
+ { "eax", NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_eax_regs, NULL},
+ { "ebx" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_ebx_regs, NULL},
+ { "ecx" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_ecx_regs, NULL},
+ { "edx" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_edx_regs, NULL},
+ { "edi" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_edi_regs, NULL},
+ { "esi" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_esi_regs, NULL},
+ { "ebp" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_ebp_regs, NULL},
+ { "esp" , NULL, 4, 0, eEncodingUint , eFormatHex , { LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM , LLDB_INVALID_REGNUM }, g_esp_regs, NULL}
+ };
+
+ static const uint32_t num_conv_regs = llvm::array_lengthof(g_mapped_names);
+ static ConstString gpr_reg_set ("General Purpose Registers");
+
+ // Add convenience registers to our primordial registers.
+ const uint32_t num_primordials = GetNumRegisters();
+ uint32_t reg_kind = num_primordials;
+ for (uint32_t i=0; i<num_conv_regs; ++i)
+ {
+ ConstString name;
+ ConstString alt_name;
+ const char *prim_reg_name = g_mapped_names[i];
+ if (prim_reg_name && prim_reg_name[0])
+ {
+ for (uint32_t j = 0; j < num_primordials; ++j)
+ {
+ const RegisterInfo *reg_info = GetRegisterInfoAtIndex(j);
+ // Find a matching primordial register info entry.
+ if (reg_info && reg_info->name && ::strcasecmp(reg_info->name, prim_reg_name) == 0)
+ {
+ // The name matches the existing primordial entry.
+ // Find and assign the offset, and then add this composite register entry.
+ g_conv_register_infos[i].byte_offset = reg_info->byte_offset + g_conv_register_infos[i].byte_offset;
+ // Update the value_regs and the kinds fields in order to delegate to the primordial register.
+ g_conv_register_infos[i].value_regs[0] = j;
+ g_conv_register_infos[i].kinds[eRegisterKindLLDB] = ++reg_kind;
+ name.SetCString(g_conv_register_infos[i].name);
+ AddRegister(g_conv_register_infos[i], name, alt_name, gpr_reg_set);
+ }
+ }
+ }
+ }
+}
+
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Tue May 22 14:47:58 2012
@@ -156,6 +156,9 @@
void
HardcodeARMRegisters(bool from_scratch);
+ void
+ Addx86_64ConvenienceRegisters();
+
protected:
//------------------------------------------------------------------
// Classes that inherit from GDBRemoteRegisterContext can see and modify these
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=157279&r1=157278&r2=157279&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 May 22 14:47:58 2012
@@ -400,6 +400,10 @@
m_register_info.HardcodeARMRegisters(from_scratch);
}
+ // Add some convenience registers (eax, ebx, ecx, edx, esi, edi, ebp, esp) to x86_64.
+ if (target_arch.IsValid() && target_arch.GetMachine() == llvm::Triple::x86_64)
+ m_register_info.Addx86_64ConvenienceRegisters();
+
// At this point, we can finalize our register info.
m_register_info.Finalize ();
}
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=157279&r1=157278&r2=157279&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 May 22 14:47:58 2012
@@ -5091,6 +5091,7 @@
case DW_TAG_base_type:
case DW_TAG_pointer_type:
case DW_TAG_reference_type:
+ case DW_TAG_rvalue_reference_type:
case DW_TAG_typedef:
case DW_TAG_const_type:
case DW_TAG_restrict_type:
@@ -5165,12 +5166,13 @@
byte_size * 8);
break;
- case DW_TAG_pointer_type: encoding_data_type = Type::eEncodingIsPointerUID; break;
- case DW_TAG_reference_type: encoding_data_type = Type::eEncodingIsLValueReferenceUID; break;
- case DW_TAG_typedef: encoding_data_type = Type::eEncodingIsTypedefUID; break;
- case DW_TAG_const_type: encoding_data_type = Type::eEncodingIsConstUID; break;
- case DW_TAG_restrict_type: encoding_data_type = Type::eEncodingIsRestrictUID; break;
- case DW_TAG_volatile_type: encoding_data_type = Type::eEncodingIsVolatileUID; break;
+ case DW_TAG_pointer_type: encoding_data_type = Type::eEncodingIsPointerUID; break;
+ case DW_TAG_reference_type: encoding_data_type = Type::eEncodingIsLValueReferenceUID; break;
+ case DW_TAG_rvalue_reference_type: encoding_data_type = Type::eEncodingIsRValueReferenceUID; break;
+ case DW_TAG_typedef: encoding_data_type = Type::eEncodingIsTypedefUID; break;
+ case DW_TAG_const_type: encoding_data_type = Type::eEncodingIsConstUID; break;
+ case DW_TAG_restrict_type: encoding_data_type = Type::eEncodingIsRestrictUID; break;
+ case DW_TAG_volatile_type: encoding_data_type = Type::eEncodingIsVolatileUID; break;
}
if (clang_type == NULL && (encoding_data_type == Type::eEncodingIsPointerUID || encoding_data_type == Type::eEncodingIsTypedefUID))
Modified: lldb/branches/apple/python-GIL/source/Symbol/CompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/CompileUnit.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/CompileUnit.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/CompileUnit.cpp Tue May 22 14:47:58 2012
@@ -336,18 +336,30 @@
// We only have a single support file that matches, so use
// the line table function that searches for a line entries
// that match a single support file index
- line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes.front(), line, exact, &sc.line_entry);
+ LineEntry line_entry;
+ line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes.front(), line, exact, &line_entry);
// If "exact == true", then "found_line" will be the same
// as "line". If "exact == false", the "found_line" will be the
// closest line entry with a line number greater than "line" and
// we will use this for our subsequent line exact matches below.
- found_line = sc.line_entry.line;
+ found_line = line_entry.line;
while (line_idx != UINT32_MAX)
{
+ // If they only asked for the line entry, then we're done, we can just copy that over.
+ // But if they wanted more than just the line number, fill it in.
+ if (resolve_scope == eSymbolContextLineEntry)
+ {
+ sc.line_entry = line_entry;
+ }
+ else
+ {
+ line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);
+ }
+
sc_list.Append(sc);
- line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes.front(), found_line, true, &sc.line_entry);
+ line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes.front(), found_line, true, &line_entry);
}
}
else
@@ -355,18 +367,28 @@
// We found multiple support files that match "file_spec" so use
// the line table function that searches for a line entries
// that match a multiple support file indexes.
- line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes, line, exact, &sc.line_entry);
+ LineEntry line_entry;
+ line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_indexes, line, exact, &line_entry);
// If "exact == true", then "found_line" will be the same
// as "line". If "exact == false", the "found_line" will be the
// closest line entry with a line number greater than "line" and
// we will use this for our subsequent line exact matches below.
- found_line = sc.line_entry.line;
+ found_line = line_entry.line;
while (line_idx != UINT32_MAX)
{
+ if (resolve_scope == eSymbolContextLineEntry)
+ {
+ sc.line_entry = line_entry;
+ }
+ else
+ {
+ line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);
+ }
+
sc_list.Append(sc);
- line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes, found_line, true, &sc.line_entry);
+ line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_indexes, found_line, true, &line_entry);
}
}
}
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=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Tue May 22 14:47:58 2012
@@ -1573,6 +1573,27 @@
return NULL;
}
+bool
+Process::IsPossibleDynamicValue (ValueObject& in_value)
+{
+ if (in_value.IsDynamic())
+ return false;
+ LanguageType known_type = in_value.GetObjectRuntimeLanguage();
+
+ if (known_type != eLanguageTypeUnknown && known_type != eLanguageTypeC)
+ {
+ LanguageRuntime *runtime = GetLanguageRuntime (known_type);
+ return runtime ? runtime->CouldHaveDynamicValue(in_value) : false;
+ }
+
+ LanguageRuntime *cpp_runtime = GetLanguageRuntime (eLanguageTypeC_plus_plus);
+ if (cpp_runtime && cpp_runtime->CouldHaveDynamicValue(in_value))
+ return true;
+
+ LanguageRuntime *objc_runtime = GetLanguageRuntime (eLanguageTypeObjC);
+ return objc_runtime ? objc_runtime->CouldHaveDynamicValue(in_value) : false;
+}
+
BreakpointSiteList &
Process::GetBreakpointSiteList()
{
Modified: lldb/branches/apple/python-GIL/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Target.cpp?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Target.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Target.cpp Tue May 22 14:47:58 2012
@@ -234,10 +234,17 @@
BreakpointSP
-Target::CreateBreakpoint (const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, bool check_inlines, bool internal)
+Target::CreateBreakpoint (const FileSpecList *containingModules,
+ const FileSpec &file,
+ uint32_t line_no,
+ bool check_inlines,
+ LazyBool skip_prologue,
+ bool internal)
{
SearchFilterSP filter_sp(GetSearchFilterForModuleList (containingModules));
- BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine (NULL, file, line_no, check_inlines));
+
+ BreakpointResolverSP resolver_sp(new BreakpointResolverFileLine (NULL, file, line_no, check_inlines,
+ skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));
return CreateBreakpoint (filter_sp, resolver_sp, internal);
}
@@ -273,8 +280,8 @@
const FileSpecList *containingSourceFiles,
const char *func_name,
uint32_t func_name_type_mask,
- bool internal,
- LazyBool skip_prologue)
+ LazyBool skip_prologue,
+ bool internal)
{
BreakpointSP bp_sp;
if (func_name)
@@ -296,8 +303,8 @@
const FileSpecList *containingSourceFiles,
const std::vector<std::string> &func_names,
uint32_t func_name_type_mask,
- bool internal,
- LazyBool skip_prologue)
+ LazyBool skip_prologue,
+ bool internal)
{
BreakpointSP bp_sp;
size_t num_names = func_names.size();
@@ -320,8 +327,8 @@
const char *func_names[],
size_t num_names,
uint32_t func_name_type_mask,
- bool internal,
- LazyBool skip_prologue)
+ LazyBool skip_prologue,
+ bool internal)
{
BreakpointSP bp_sp;
if (num_names > 0)
@@ -377,7 +384,8 @@
}
SearchFilterSP
-Target::GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles)
+Target::GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules,
+ const FileSpecList *containingSourceFiles)
{
if (containingSourceFiles == NULL || containingSourceFiles->GetSize() == 0)
return GetSearchFilterForModuleList(containingModules);
@@ -399,10 +407,10 @@
BreakpointSP
Target::CreateFuncRegexBreakpoint (const FileSpecList *containingModules,
- const FileSpecList *containingSourceFiles,
- RegularExpression &func_regex,
- bool internal,
- LazyBool skip_prologue)
+ const FileSpecList *containingSourceFiles,
+ RegularExpression &func_regex,
+ LazyBool skip_prologue,
+ bool internal)
{
SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
BreakpointResolverSP resolver_sp(new BreakpointResolverName (NULL,
Modified: lldb/branches/apple/python-GIL/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/dotest.py?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/dotest.py (original)
+++ lldb/branches/apple/python-GIL/test/dotest.py Tue May 22 14:47:58 2012
@@ -398,9 +398,6 @@
do_help = False
- if len(sys.argv) == 1:
- return
-
# Process possible trace and/or verbose flag, among other things.
index = 1
while index < len(sys.argv):
Modified: lldb/branches/apple/python-GIL/test/lang/cpp/this/TestCPPThis.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/cpp/this/TestCPPThis.py?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/cpp/this/TestCPPThis.py (original)
+++ lldb/branches/apple/python-GIL/test/lang/cpp/this/TestCPPThis.py Tue May 22 14:47:58 2012
@@ -53,7 +53,7 @@
self.expect("expression -- m_a = 2",
startstr = "(int) $1 = 2")
- self.expect("expression -- m_a",
+ self.expect("expression -- (int)getpid(); m_a",
startstr = "(int) $2 = 2")
self.runCmd("process continue")
Modified: lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)
+++ lldb/branches/apple/python-GIL/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Tue May 22 14:47:58 2012
@@ -34,7 +34,7 @@
def applies(self):
if platform.system() != "Darwin":
return False
- if StrictVersion('12.0.0') > platform.release():
+ if StrictVersion('11.0.0') > platform.release():
return False
return True
@@ -120,7 +120,7 @@
self.expect("expr -o -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["NSNumber", "4"])
self.expect("expr -o -- @(\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,
- substrs = ["NSString", "@\"world\""])
+ substrs = ["NSString", "world"])
if __name__ == '__main__':
Modified: lldb/branches/apple/python-GIL/www/lldb-gdb.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/www/lldb-gdb.html?rev=157279&r1=157278&r2=157279&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/www/lldb-gdb.html (original)
+++ lldb/branches/apple/python-GIL/www/lldb-gdb.html Tue May 22 14:47:58 2012
@@ -694,7 +694,11 @@
<b>(lldb)</b> me r -o /tmp/mem.bin -b 0x1000 0x1200<br>
</td>
</tr>
-
+ <tr>
+ <td class="content" colspan="2">
+ <b>(gdb)</b> dump memory /tmp/mem.bin 0x1000 0x2000
+ </td>
+ </tr>
<tr><td class="header" colspan="2">Disassemble the current function for the current frame.</td></tr>
<tr>
<td class="content">
More information about the lldb-commits
mailing list