[Lldb-commits] [lldb] r160513 - in /lldb/branches/apple/python-GIL: ./ examples/python/ examples/summaries/ examples/summaries/cocoa/ include/lldb/API/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Interpreter/ include/lldb/Symbol/ include/lldb/Target/ lldb.xcodeproj/ lldb.xcodeproj/xcshareddata/xcschemes/ resources/ scripts/ scripts/Python/interface/ source/API/ source/Commands/ source/Core/ source/Expression/ source/Host/common/ source/Host/macosx/ source/Host/macosx/launcherXPCService/ source/Interpreter/...
Filipe Cabecinhas
me at filcab.net
Thu Jul 19 09:39:59 PDT 2012
Author: filcab
Date: Thu Jul 19 11:39:59 2012
New Revision: 160513
URL: http://llvm.org/viewvc/llvm-project?rev=160513&view=rev
Log:
Merge changes from ToT trunk.
Added:
lldb/branches/apple/python-GIL/test/functionalities/data-formatter/rdar-11628688/
- copied from r160392, lldb/trunk/test/functionalities/data-formatter/rdar-11628688/
lldb/branches/apple/python-GIL/test/functionalities/data-formatter/rdar-11773899/
- copied from r160392, lldb/trunk/test/functionalities/data-formatter/rdar-11773899/
Modified:
lldb/branches/apple/python-GIL/ (props changed)
lldb/branches/apple/python-GIL/examples/python/crashlog.py
lldb/branches/apple/python-GIL/examples/summaries/cocoa/NSNumber.py
lldb/branches/apple/python-GIL/examples/summaries/objc.py
lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h
lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h
lldb/branches/apple/python-GIL/include/lldb/Core/Module.h
lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h
lldb/branches/apple/python-GIL/include/lldb/Expression/ClangUserExpression.h
lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h
lldb/branches/apple/python-GIL/include/lldb/Symbol/Block.h
lldb/branches/apple/python-GIL/include/lldb/Symbol/ClangASTContext.h
lldb/branches/apple/python-GIL/include/lldb/Symbol/SymbolContext.h
lldb/branches/apple/python-GIL/include/lldb/Symbol/UnwindPlan.h
lldb/branches/apple/python-GIL/include/lldb/Symbol/VariableList.h
lldb/branches/apple/python-GIL/include/lldb/Target/Process.h
lldb/branches/apple/python-GIL/include/lldb/Target/StackFrame.h
lldb/branches/apple/python-GIL/include/lldb/Target/StopInfo.h
lldb/branches/apple/python-GIL/include/lldb/Target/Target.h
lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme
lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme
lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme
lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme
lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
lldb/branches/apple/python-GIL/llvm.zip
lldb/branches/apple/python-GIL/resources/LLDB-Info.plist
lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i
lldb/branches/apple/python-GIL/scripts/Python/interface/SBThread.i
lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff
lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp
lldb/branches/apple/python-GIL/source/API/SBFrame.cpp
lldb/branches/apple/python-GIL/source/API/SBProcess.cpp
lldb/branches/apple/python-GIL/source/API/SBTarget.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp
lldb/branches/apple/python-GIL/source/Core/Address.cpp
lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp
lldb/branches/apple/python-GIL/source/Core/Debugger.cpp
lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp
lldb/branches/apple/python-GIL/source/Core/InputReader.cpp
lldb/branches/apple/python-GIL/source/Core/Module.cpp
lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp
lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp
lldb/branches/apple/python-GIL/source/Core/Section.cpp
lldb/branches/apple/python-GIL/source/Core/UserSettingsController.cpp
lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp
lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp
lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp
lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp
lldb/branches/apple/python-GIL/source/Host/common/Terminal.cpp
lldb/branches/apple/python-GIL/source/Host/macosx/Host.mm
lldb/branches/apple/python-GIL/source/Host/macosx/Symbols.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/ABI/SysV-x86_64/ABISysV_x86_64.cpp
lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/branches/apple/python-GIL/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/branches/apple/python-GIL/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/ARMUtils.h
lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.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/DWARFCompileUnit.cpp
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
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/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
lldb/branches/apple/python-GIL/source/Symbol/Block.cpp
lldb/branches/apple/python-GIL/source/Symbol/ClangASTContext.cpp
lldb/branches/apple/python-GIL/source/Symbol/ClangASTImporter.cpp
lldb/branches/apple/python-GIL/source/Symbol/DWARFCallFrameInfo.cpp
lldb/branches/apple/python-GIL/source/Symbol/SymbolContext.cpp
lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp
lldb/branches/apple/python-GIL/source/Symbol/VariableList.cpp
lldb/branches/apple/python-GIL/source/Target/Process.cpp
lldb/branches/apple/python-GIL/source/Target/StackFrame.cpp
lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp
lldb/branches/apple/python-GIL/source/Target/Target.cpp
lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepInRange.cpp
lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m
lldb/branches/apple/python-GIL/test/functionalities/process_launch/TestProcessLaunch.py
lldb/branches/apple/python-GIL/tools/darwin-debug/darwin-debug.cpp
lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/project.pbxproj
lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme
lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp
lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachException.cpp
lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp
lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachThreadList.cpp
lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp
lldb/branches/apple/python-GIL/tools/debugserver/source/debugserver.cpp
lldb/branches/apple/python-GIL/tools/driver/Driver.cpp
Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 19 11:39:59 2012
@@ -1 +1 @@
-/lldb/trunk:156467-160100
+/lldb/trunk:156467-160392
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/python/crashlog.py (original)
+++ lldb/branches/apple/python-GIL/examples/python/crashlog.py Thu Jul 19 11:39:59 2012
@@ -64,6 +64,7 @@
def __init__(self, index):
self.index = index
self.frames = list()
+ self.idents = list()
self.registers = dict()
self.reason = None
self.queue = None
@@ -79,6 +80,10 @@
for reg in self.registers.keys():
print "%s %-5s = %#16.16x" % (prefix, reg, self.registers[reg])
+ def add_ident(self, ident):
+ if not ident in self.idents:
+ self.idents.append(ident)
+
def did_crash(self):
return self.reason != None
@@ -280,6 +285,7 @@
frame_match = self.frame_regex.search(line)
if frame_match:
ident = frame_match.group(2)
+ thread.add_ident(ident)
if not ident in self.idents:
self.idents.append(ident)
thread.frames.append (CrashLog.Frame(int(frame_match.group(1)), int(frame_match.group(3), 0), frame_match.group(4)))
@@ -399,12 +405,18 @@
except:
return
- for idx_str in args:
- idx = int(idx_str)
- if idx < len(self.crash_logs):
- SymbolicateCrashLog (self.crash_logs[idx], options)
- else:
- print 'error: crash log index %u is out of range' % (idx)
+ if args:
+ # We have arguments, they must valid be crash log file indexes
+ for idx_str in args:
+ idx = int(idx_str)
+ if idx < len(self.crash_logs):
+ SymbolicateCrashLog (self.crash_logs[idx], options)
+ else:
+ print 'error: crash log index %u is out of range' % (idx)
+ else:
+ # No arguments, symbolicate all crash logs using the options provided
+ for idx in range(len(self.crash_logs)):
+ SymbolicateCrashLog (self.crash_logs[idx], options)
def do_list(self, line=None):
'''Dump a list of all crash logs that are currently loaded.
@@ -415,12 +427,9 @@
print '[%u] = %s' % (crash_log_idx, crash_log.path)
def do_image(self, line):
- '''Dump information about an image in the crash log given an image basename.
-
- USAGE: image <basename>'''
+ '''Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided.'''
usage = "usage: %prog [options] <PATH> [PATH ...]"
- description='''Dump information about one or more images in all crash logs. The <PATH>
- can be a full path or a image basename.'''
+ description='''Dump information about one or more images in all crash logs. The <PATH> can be a full path, image basename, or partial path. Searches are done in this order.'''
command_args = shlex.split(line)
if not self.image_option_parser:
self.image_option_parser = optparse.OptionParser(description=description, prog='image',usage=usage)
@@ -433,23 +442,23 @@
if args:
for image_path in args:
fullpath_search = image_path[0] == '/'
- for crash_log in self.crash_logs:
+ for (crash_log_idx, crash_log) in enumerate(self.crash_logs):
matches_found = 0
for (image_idx, image) in enumerate(crash_log.images):
if fullpath_search:
if image.get_resolved_path() == image_path:
matches_found += 1
- print image
+ print '[%u] ' % (crash_log_idx), image
else:
image_basename = image.get_resolved_path_basename()
if image_basename == image_path:
matches_found += 1
- print image
+ print '[%u] ' % (crash_log_idx), image
if matches_found == 0:
for (image_idx, image) in enumerate(crash_log.images):
resolved_image_path = image.get_resolved_path()
if resolved_image_path and string.find(image.get_resolved_path(), image_path) >= 0:
- print image
+ print '[%u] ' % (crash_log_idx), image
else:
for crash_log in self.crash_logs:
for (image_idx, image) in enumerate(crash_log.images):
@@ -589,13 +598,24 @@
images_to_load.append(image)
else:
# Only load the images found in stack frames for the crashed threads
- for ident in crash_log.idents:
- images = crash_log.find_images_with_identifier (ident)
- if images:
- for image in images:
- images_to_load.append(image)
- else:
- print 'error: can\'t find image for identifier "%s"' % ident
+ if options.crashed_only:
+ for thread in crash_log.threads:
+ if thread.did_crash():
+ for ident in thread.idents:
+ images = crash_log.find_images_with_identifier (ident)
+ if images:
+ for image in images:
+ images_to_load.append(image)
+ else:
+ print 'error: can\'t find image for identifier "%s"' % ident
+ else:
+ for ident in crash_log.idents:
+ images = crash_log.find_images_with_identifier (ident)
+ if images:
+ for image in images:
+ images_to_load.append(image)
+ else:
+ print 'error: can\'t find image for identifier "%s"' % ident
for image in images_to_load:
if image in loaded_images:
@@ -614,6 +634,7 @@
continue
print "%s" % thread
#prev_frame_index = -1
+ display_frame_idx = -1
for frame_idx, frame in enumerate(thread.frames):
disassemble = (this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth;
if frame_idx == 0:
@@ -625,8 +646,21 @@
if symbolicated_frame_addresses:
symbolicated_frame_address_idx = 0
for symbolicated_frame_address in symbolicated_frame_addresses:
+ display_frame_idx += 1
print '[%3u] %s' % (frame_idx, symbolicated_frame_address)
-
+ if (options.source_all or thread.did_crash()) and display_frame_idx < options.source_frames and options.source_context:
+ source_context = options.source_context
+ line_entry = symbolicated_frame_address.get_symbol_context().line_entry
+ if line_entry.IsValid():
+ strm = lldb.SBStream()
+ if line_entry:
+ lldb.debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers(line_entry.file, line_entry.line, source_context, source_context, "->", strm)
+ source_text = strm.GetData()
+ if source_text:
+ # Indent the source a bit
+ indent_str = ' '
+ join_str = '\n' + indent_str
+ print '%s%s' % (indent_str, join_str.join(source_text.split('\n')))
if symbolicated_frame_address_idx == 0:
if disassemble:
instructions = symbolicated_frame_address.get_instructions()
@@ -651,16 +685,19 @@
def CreateSymbolicateCrashLogOptions(command_name, description, add_interactive_options):
usage = "usage: %prog [options] <FILE> [FILE ...]"
option_parser = optparse.OptionParser(description=description, prog='crashlog',usage=usage)
- option_parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
- option_parser.add_option('-g', '--debug', action='store_true', dest='debug', help='display verbose debug logging', default=False)
- option_parser.add_option('-a', '--load-all', action='store_true', dest='load_all_images', help='load all executable images, not just the images found in the crashed stack frames', default=False)
- option_parser.add_option('--images', action='store_true', dest='dump_image_list', help='show image list', default=False)
- option_parser.add_option('--debug-delay', type='int', dest='debug_delay', metavar='NSEC', help='pause for NSEC seconds for debugger', default=0)
- option_parser.add_option('-c', '--crashed-only', action='store_true', dest='crashed_only', help='only symbolicate the crashed thread', default=False)
- option_parser.add_option('-d', '--disasm-depth', type='int', dest='disassemble_depth', help='set the depth in stack frames that should be disassembled (default is 1)', default=1)
- option_parser.add_option('-D', '--disasm-all', action='store_true', dest='disassemble_all_threads', help='enabled disassembly of frames on all threads (not just the crashed thread)', default=False)
- option_parser.add_option('-B', '--disasm-before', type='int', dest='disassemble_before', help='the number of instructions to disassemble before the frame PC', default=4)
- option_parser.add_option('-A', '--disasm-after', type='int', dest='disassemble_after', help='the number of instructions to disassemble after the frame PC', default=4)
+ option_parser.add_option('--verbose' , '-v', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+ option_parser.add_option('--debug' , '-g', action='store_true', dest='debug', help='display verbose debug logging', default=False)
+ option_parser.add_option('--load-all' , '-a', action='store_true', dest='load_all_images', help='load all executable images, not just the images found in the crashed stack frames', default=False)
+ option_parser.add_option('--images' , action='store_true', dest='dump_image_list', help='show image list', default=False)
+ option_parser.add_option('--debug-delay' , type='int', dest='debug_delay', metavar='NSEC', help='pause for NSEC seconds for debugger', default=0)
+ option_parser.add_option('--crashed-only' , '-c', action='store_true', dest='crashed_only', help='only symbolicate the crashed thread', default=False)
+ option_parser.add_option('--disasm-depth' , '-d', type='int', dest='disassemble_depth', help='set the depth in stack frames that should be disassembled (default is 1)', default=1)
+ option_parser.add_option('--disasm-all' , '-D', action='store_true', dest='disassemble_all_threads', help='enabled disassembly of frames on all threads (not just the crashed thread)', default=False)
+ option_parser.add_option('--disasm-before' , '-B', type='int', dest='disassemble_before', help='the number of instructions to disassemble before the frame PC', default=4)
+ option_parser.add_option('--disasm-after' , '-A', type='int', dest='disassemble_after', help='the number of instructions to disassemble after the frame PC', default=4)
+ option_parser.add_option('--source-context', '-C', type='int', metavar='NLINES', dest='source_context', help='show NLINES source lines of source context (default = 4)', default=4)
+ option_parser.add_option('--source-frames' , type='int', metavar='NFRAMES', dest='source_frames', help='show source for NFRAMES (default = 4)', default=4)
+ option_parser.add_option('--source-all' , action='store_true', dest='source_all', help='show source for all threads, not just the crashed thread', default=False)
if add_interactive_options:
option_parser.add_option('-i', '--interactive', action='store_true', help='parse all crash logs and enter interactive mode', default=False)
return option_parser
Modified: lldb/branches/apple/python-GIL/examples/summaries/cocoa/NSNumber.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/summaries/cocoa/NSNumber.py?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/summaries/cocoa/NSNumber.py (original)
+++ lldb/branches/apple/python-GIL/examples/summaries/cocoa/NSNumber.py Thu Jul 19 11:39:59 2012
@@ -45,13 +45,13 @@
# unfortunately, the original type information appears to be lost
# so we try to at least recover the proper magnitude of the data
if self.info_bits == 0:
- return '(char)' + str(self.data % 256)
+ return '(char)' + str(ord(ctypes.c_char(chr(self.data % 256)).value))
if self.info_bits == 4:
- return '(short)' + str(self.data % (256*256))
+ return '(short)' + str(ctypes.c_short(self.data % (256*256)).value)
if self.info_bits == 8:
- return '(int)' + str(self.data % (256*256*256*256))
+ return '(int)' + str(ctypes.c_int(self.data % (256*256*256*256)).value)
if self.info_bits == 12:
- return '(long)' + str(self.data)
+ return '(long)' + str(ctypes.c_long(self.data).value)
else:
return 'absurd value:(info=' + str(self.info_bits) + ", value = " + str(self.data) + ')'
@@ -106,13 +106,13 @@
data_offset,
self.sys_params.types_cache.char)
statistics.metric_hit('code_notrun',self.valobj)
- return '(char)' + str(data_vo.GetValueAsUnsigned(0))
+ return '(char)' + str(ord(ctypes.c_char(chr(data_vo.GetValueAsUnsigned(0))).value))
elif data_type == 0B0010:
data_vo = self.valobj.CreateChildAtOffset("data",
data_offset,
self.sys_params.types_cache.short)
statistics.metric_hit('code_notrun',self.valobj)
- return '(short)' + str(data_vo.GetValueAsUnsigned(0) % (256*256))
+ return '(short)' + str(ctypes.c_short(data_vo.GetValueAsUnsigned(0) % (256*256)).value)
# IF tagged pointers are possible on 32bit+v2 runtime
# (of which the only existing instance should be iOS)
# then values of this type might be tagged
@@ -121,7 +121,7 @@
data_offset,
self.sys_params.types_cache.int)
statistics.metric_hit('code_notrun',self.valobj)
- return '(int)' + str(data_vo.GetValueAsUnsigned(0) % (256*256*256*256))
+ return '(int)' + str(ctypes.c_int(data_vo.GetValueAsUnsigned(0)% (256*256*256*256)).value)
# apparently, on is_64_bit architectures, these are the only values that will ever
# be represented by a non tagged pointers
elif data_type == 0B10001:
@@ -130,7 +130,7 @@
data_offset,
self.sys_params.types_cache.longlong)
statistics.metric_hit('code_notrun',self.valobj)
- return '(long)' + str(data_vo.GetValueAsUnsigned(0))
+ return '(long)' + str(ctypes.c_long(data_vo.GetValueAsUnsigned(0)).value)
elif data_type == 0B0100:
if self.sys_params.is_64_bit:
data_offset = data_offset + self.sys_params.pointer_size
@@ -138,7 +138,7 @@
data_offset,
self.sys_params.types_cache.longlong)
statistics.metric_hit('code_notrun',self.valobj)
- return '(long)' + str(data_vo.GetValueAsUnsigned(0))
+ return '(long)' + str(ctypes.c_long(data_vo.GetValueAsUnsigned(0)).value)
elif data_type == 0B0101:
data_vo = self.valobj.CreateChildAtOffset("data",
data_offset,
@@ -216,7 +216,9 @@
return provider.message()
try:
summary = provider.value();
- except:
+ except Exception as foo:
+ print foo
+# except:
summary = None
logger >> "got summary " + str(summary)
if summary == None:
Modified: lldb/branches/apple/python-GIL/examples/summaries/objc.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/summaries/objc.py?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/summaries/objc.py (original)
+++ lldb/branches/apple/python-GIL/examples/summaries/objc.py Thu Jul 19 11:39:59 2012
@@ -2,8 +2,15 @@
# to be generated fit into this file
def BOOL_SummaryProvider (valobj,dict):
+ if not (valobj.IsValid()):
+ return "<invalid>"
if valobj.GetValueAsUnsigned() == 0:
return "NO"
else:
return "YES"
-
+
+def BOOLRef_SummaryProvider (valobj, dict):
+ return BOOL_SummaryProvider (valobj.GetChildAtIndex(0),dict)
+
+def BOOLPtr_SummaryProvider (valobj,dict):
+ return BOOL_SummaryProvider (valobj.Dereference(),dict)
Modified: lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/API/SBProcess.h Thu Jul 19 11:39:59 2012
@@ -105,6 +105,9 @@
GetThreadByID (lldb::tid_t sb_thread_id);
lldb::SBThread
+ GetThreadByIndexID (uint32_t index_id);
+
+ lldb::SBThread
GetSelectedThread () const;
bool
@@ -112,6 +115,9 @@
bool
SetSelectedThreadByID (uint32_t tid);
+
+ bool
+ SetSelectedThreadByIndexID (uint32_t index_id);
//------------------------------------------------------------------
// Stepping related functions
@@ -216,7 +222,7 @@
void
SetSP (const lldb::ProcessSP &process_sp);
- lldb::ProcessSP m_opaque_sp;
+ lldb::ProcessWP m_opaque_wp;
};
} // namespace lldb
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h Thu Jul 19 11:39:59 2012
@@ -112,9 +112,11 @@
SocketAddress m_udp_send_sockaddr;
bool m_should_close_fd; // True if this class should close the file descriptor when it goes away.
uint32_t m_socket_timeout_usec;
- int m_command_fd_send; // A pipe that we select on the reading end of along with
- int m_command_fd_receive; // m_fd_recv so we can force ourselves out of the select.
- Mutex m_mutex;
+ int m_command_fd_send; // A pipe that we select on the reading end of along with
+ int m_command_fd_receive; // m_fd_recv so we can force ourselves out of the select.
+ Mutex m_mutex;
+ bool m_shutting_down; // This marks that we are shutting down so if we get woken up from BytesAvailable
+ // to disconnect, we won't try to read again.
static in_port_t
GetSocketPort (int fd);
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/Module.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/Module.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/Module.h Thu Jul 19 11:39:59 2012
@@ -1030,11 +1030,13 @@
void
ReportErrorIfModifyDetected (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+ //------------------------------------------------------------------
+ // Return true if the file backing this module has changed since the
+ // module was originally created since we saved the intial file
+ // modification time when the module first gets created.
+ //------------------------------------------------------------------
bool
- GetModified (bool use_cached_only);
-
- bool
- SetModified (bool b);
+ FileHasChanged () const;
//------------------------------------------------------------------
// SymbolVendor, SymbolFile and ObjectFile member objects should
@@ -1124,8 +1126,9 @@
m_did_load_symbol_vendor:1,
m_did_parse_uuid:1,
m_did_init_ast:1,
- m_is_dynamic_loader_module:1,
- m_was_modified:1; /// See if the module was modified after it was initially opened.
+ m_is_dynamic_loader_module:1;
+ mutable bool m_file_has_changed:1,
+ m_first_file_changed_log:1; /// See if the module was modified after it was initially opened.
//------------------------------------------------------------------
/// Resolve a file or load virtual address.
Modified: lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ModuleList.h Thu Jul 19 11:39:59 2012
@@ -75,6 +75,19 @@
void
Append (const lldb::ModuleSP &module_sp);
+ //------------------------------------------------------------------
+ /// Append a module to the module list and remove any equivalent
+ /// modules. Equivalent modules are ones whose file, platform file
+ /// and architecture matches.
+ ///
+ /// Replaces the module to the collection.
+ ///
+ /// @param[in] module_sp
+ /// A shared pointer to a module to replace in this collection.
+ //------------------------------------------------------------------
+ void
+ ReplaceEquivalent (const lldb::ModuleSP &module_sp);
+
bool
AppendIfNeeded (const lldb::ModuleSP &module_sp);
Modified: lldb/branches/apple/python-GIL/include/lldb/Expression/ClangUserExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Expression/ClangUserExpression.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Expression/ClangUserExpression.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Expression/ClangUserExpression.h Thu Jul 19 11:39:59 2012
@@ -132,6 +132,10 @@
/// A pointer to direct at the persistent variable in which the
/// expression's result is stored.
///
+ /// @param[in] single_thread_timeout_usec
+ /// The amount of time (in usec) that we are willing to wait for this
+ /// expression to complete, before assuming that we are blocked and giving up
+ ///
/// @return
/// A Process::Execution results value.
//------------------------------------------------------------------
@@ -140,7 +144,8 @@
ExecutionContext &exe_ctx,
bool discard_on_error,
ClangUserExpressionSP &shared_ptr_to_me,
- lldb::ClangExpressionVariableSP &result);
+ lldb::ClangExpressionVariableSP &result,
+ uint32_t single_thread_timeout_usec = 500000);
ThreadPlan *
GetThreadPlanToExecuteJITExpression (Stream &error_stream,
@@ -309,6 +314,10 @@
/// @param[in/out] result_valobj_sp
/// If execution is successful, the result valobj is placed here.
///
+ /// @param[in] single_thread_timeout_usec
+ /// The amount of time (in usec) that we are willing to wait for this
+ /// expression to complete, before assuming that we are blocked and giving up
+ ///
/// @result
/// A Process::ExecutionResults value. eExecutionCompleted for success.
//------------------------------------------------------------------
@@ -320,7 +329,8 @@
bool discard_on_error,
const char *expr_cstr,
const char *expr_prefix,
- lldb::ValueObjectSP &result_valobj_sp);
+ lldb::ValueObjectSP &result_valobj_sp,
+ uint32_t single_thread_timeout_usec = 500000);
static ExecutionResults
EvaluateWithError (ExecutionContext &exe_ctx,
@@ -331,7 +341,8 @@
const char *expr_cstr,
const char *expr_prefix,
lldb::ValueObjectSP &result_valobj_sp,
- Error &error);
+ Error &error,
+ uint32_t single_thread_timeout_usec = 500000);
static const Error::ValueType kNoResult = 0x1001; ///< ValueObject::GetError() returns this if there is no result from the expression.
private:
Modified: lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h Thu Jul 19 11:39:59 2012
@@ -296,10 +296,10 @@
return m_debugger;
}
- ExecutionContext &
+ ExecutionContext
GetExecutionContext()
{
- return m_exe_ctx;
+ return m_exe_ctx_ref.Lock();
}
void
@@ -464,7 +464,7 @@
PreprocessCommand (std::string &command);
Debugger &m_debugger; // The debugger session that this interpreter is associated with
- ExecutionContext m_exe_ctx; // The current execution context to use when handling commands
+ ExecutionContextRef m_exe_ctx_ref; // The current execution context to use when handling commands
bool m_synchronous_execution;
bool m_skip_lldbinit_files;
bool m_skip_app_init_files;
Modified: lldb/branches/apple/python-GIL/include/lldb/Symbol/Block.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Symbol/Block.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Symbol/Block.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Symbol/Block.h Thu Jul 19 11:39:59 2012
@@ -263,6 +263,22 @@
}
//------------------------------------------------------------------
+ /// Get the variable list for this block only.
+ ///
+ /// @param[in] can_create
+ /// If \b true, the variables can be parsed if they already
+ /// haven't been, else the current state of the block will be
+ /// returned.
+ ///
+ /// @return
+ /// A variable list shared pointer that contains all variables
+ /// for this block.
+ //------------------------------------------------------------------
+ lldb::VariableListSP
+ GetBlockVariableList (bool can_create);
+
+
+ //------------------------------------------------------------------
/// Get the variable list for this block and optionally all child
/// blocks if \a get_child_variables is \b true.
///
@@ -278,7 +294,7 @@
/// point.
///
/// @param[in] add_inline_child_block_variables
- /// If this is \b false, no child variables of child blocks
+ /// If this is \b false, no child variables of child blocks
/// that are inlined functions will be gotten. If \b true then
/// all child variables will be added regardless of whether they
/// come from inlined functions or not.
@@ -287,10 +303,6 @@
/// A variable list shared pointer that contains all variables
/// for this block.
//------------------------------------------------------------------
- lldb::VariableListSP
- GetBlockVariableList (bool can_create);
-
-
uint32_t
AppendBlockVariables (bool can_create,
bool get_child_block_variables,
@@ -345,7 +357,7 @@
}
clang::DeclContext *
- GetClangDeclContextForInlinedFunction();
+ GetClangDeclContext();
//------------------------------------------------------------------
/// Get the memory cost of this object.
Modified: lldb/branches/apple/python-GIL/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Symbol/ClangASTContext.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Symbol/ClangASTContext.h Thu Jul 19 11:39:59 2012
@@ -237,6 +237,12 @@
return GetTranslationUnitDecl (getASTContext());
}
+ static bool
+ GetClassMethodInfoForDeclContext (clang::DeclContext *decl_ctx,
+ lldb::LanguageType &language,
+ bool &is_instance_method,
+ ConstString &language_object_name);
+
static lldb::clang_type_t
CopyType(clang::ASTContext *dest_context,
clang::ASTContext *source_context,
Modified: lldb/branches/apple/python-GIL/include/lldb/Symbol/SymbolContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Symbol/SymbolContext.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Symbol/SymbolContext.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Symbol/SymbolContext.h Thu Jul 19 11:39:59 2012
@@ -220,6 +220,56 @@
uint32_t
GetResolvedMask () const;
+
+ //------------------------------------------------------------------
+ /// Find a block that defines the function represented by this
+ /// symbol context.
+ ///
+ /// If this symbol context points to a block that is an inlined
+ /// function, or is contained within an inlined function, the block
+ /// that defines the inlined function is returned.
+ ///
+ /// If this symbol context has no block in it, or the block is not
+ /// itself an inlined function block or contained within one, we
+ /// return the top level function block.
+ ///
+ /// This is a handy function to call when you want to get the block
+ /// whose variable list will include the arguments for the function
+ /// that is represented by this symbol context (whether the function
+ /// is an inline function or not).
+ ///
+ /// @return
+ /// The block object pointer that defines the function that is
+ /// represented by this symbol context object, NULL otherwise.
+ //------------------------------------------------------------------
+ Block *
+ GetFunctionBlock ();
+
+
+ //------------------------------------------------------------------
+ /// If this symbol context represents a function that is a method,
+ /// return true and provide information about the method.
+ ///
+ /// @param[out] language
+ /// If \b true is returned, the language for the method.
+ ///
+ /// @param[out] is_instance_method
+ /// If \b true is returned, \b true if this is a instance method,
+ /// \b false if this is a static/class function.
+ ///
+ /// @param[out] language_object_name
+ /// If \b true is returned, the name of the artificial variable
+ /// for the language ("this" for C++, "self" for ObjC).
+ ///
+ /// @return
+ /// \b True if this symbol context represents a function that
+ /// is a method of a class, \b false otherwise.
+ //------------------------------------------------------------------
+ bool
+ GetFunctionMethodInfo (lldb::LanguageType &language,
+ bool &is_instance_method,
+ ConstString &language_object_name);
+
//------------------------------------------------------------------
/// Find a name of the innermost function for the symbol context.
///
Modified: lldb/branches/apple/python-GIL/include/lldb/Symbol/UnwindPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Symbol/UnwindPlan.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Symbol/UnwindPlan.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Symbol/UnwindPlan.h Thu Jul 19 11:39:59 2012
@@ -240,6 +240,18 @@
public:
Row ();
+ Row (const UnwindPlan::Row& rhs) :
+ m_offset(rhs.m_offset), m_cfa_reg_num(rhs.m_cfa_reg_num), m_cfa_offset(rhs.m_cfa_offset)
+ {
+ for (collection::const_iterator idx = rhs.m_register_locations.begin(); idx != rhs.m_register_locations.end(); ++idx)
+ {
+ m_register_locations[idx->first] = idx->second;
+ }
+ }
+
+ bool
+ operator == (const Row &rhs) const;
+
bool
GetRegisterInfo (uint32_t reg_num, RegisterLocation& register_location) const;
@@ -328,38 +340,18 @@
void
Dump (Stream& s, const UnwindPlan* unwind_plan, Thread* thread, lldb::addr_t base_addr) const;
- bool
- operator == (const Row &rhs) const
- {
- if (m_offset == rhs.m_offset &&
- m_cfa_reg_num != rhs.m_cfa_reg_num &&
- m_cfa_offset != rhs.m_cfa_offset)
- return m_register_locations == rhs.m_register_locations;
- return false;
- }
-
- bool
- operator != (const Row &rhs) const
- {
- if (m_offset != rhs.m_offset ||
- m_cfa_reg_num != rhs.m_cfa_reg_num ||
- m_cfa_offset != rhs.m_cfa_offset)
- return true;
-
- return m_register_locations != rhs.m_register_locations;
- }
-
protected:
typedef std::map<uint32_t, RegisterLocation> collection;
lldb::addr_t m_offset; // Offset into the function for this row
uint32_t m_cfa_reg_num; // The Call Frame Address register number
int32_t m_cfa_offset; // The offset from the CFA for this row
collection m_register_locations;
-
}; // class Row
public:
+ typedef STD_SHARED_PTR(Row) RowSP;
+
UnwindPlan (lldb::RegisterKind reg_kind) :
m_row_list (),
m_plan_valid_address_range (),
@@ -376,13 +368,13 @@
Dump (Stream& s, Thread* thread, lldb::addr_t base_addr) const;
void
- AppendRow (const Row& row);
+ AppendRow (RowSP row);
// Returns a pointer to the best row for the given offset into the function's instructions.
// If offset is -1 it indicates that the function start is unknown - the final row in the UnwindPlan is returned.
// In practice, the UnwindPlan for a function with no known start address will be the architectural default
// UnwindPlan which will only have one row.
- const Row*
+ UnwindPlan::RowSP
GetRowForFunctionOffset (int offset) const;
lldb::RegisterKind
@@ -402,7 +394,7 @@
{
if (m_row_list.empty())
return LLDB_INVALID_REGNUM;
- return m_row_list.front().GetCFARegister();
+ return m_row_list.front()->GetCFARegister();
}
// This UnwindPlan may not be valid at every address of the function span.
@@ -423,10 +415,10 @@
bool
IsValidRowIndex (uint32_t idx) const;
- const UnwindPlan::Row&
+ const UnwindPlan::RowSP
GetRowAtIndex (uint32_t idx) const;
- const UnwindPlan::Row&
+ const UnwindPlan::RowSP
GetLastRow () const;
lldb_private::ConstString
@@ -453,7 +445,7 @@
private:
- typedef std::vector<Row> collection;
+ typedef std::vector<RowSP> collection;
collection m_row_list;
AddressRange m_plan_valid_address_range;
lldb::RegisterKind m_register_kind; // The RegisterKind these register numbers are in terms of - will need to be
Modified: lldb/branches/apple/python-GIL/include/lldb/Symbol/VariableList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Symbol/VariableList.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Symbol/VariableList.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Symbol/VariableList.h Thu Jul 19 11:39:59 2012
@@ -50,6 +50,11 @@
lldb::VariableSP
FindVariable (const ConstString& name);
+ // Find the argument variable that represents the language specific
+ // object pointer ("this" in C++, or "self" in Objective C).
+ lldb::VariableSP
+ FindArtificialObjectVariable (lldb::LanguageType language) const;
+
uint32_t
FindVariableIndex (const lldb::VariableSP &var_sp);
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Process.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Process.h Thu Jul 19 11:39:59 2012
@@ -2786,6 +2786,14 @@
return error;
}
+ virtual Error
+ GetWatchpointSupportInfo (uint32_t &num, bool& after)
+ {
+ Error error;
+ error.SetErrorString ("Process::GetWatchpointSupportInfo() not supported");
+ return error;
+ }
+
lldb::ModuleSP
ReadModuleFromMemory (const FileSpec& file_spec,
lldb::addr_t header_addr,
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/StackFrame.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/StackFrame.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/StackFrame.h Thu Jul 19 11:39:59 2012
@@ -36,7 +36,8 @@
eExpressionPathOptionCheckPtrVsMember = (1u << 0),
eExpressionPathOptionsNoFragileObjcIvar = (1u << 1),
eExpressionPathOptionsNoSyntheticChildren = (1u << 2),
- eExpressionPathOptionsNoSyntheticArrayRange = (1u << 3)
+ eExpressionPathOptionsNoSyntheticArrayRange = (1u << 3),
+ eExpressionPathOptionsAllowDirectIVarAccess = (1u << 4)
};
//------------------------------------------------------------------
// Constructors and Destructors
Modified: lldb/branches/apple/python-GIL/include/lldb/Target/StopInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/StopInfo.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/StopInfo.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/StopInfo.h Thu Jul 19 11:39:59 2012
@@ -161,14 +161,15 @@
// N.B. running to evaluate a user expression does not count.
bool HasTargetRunSinceMe ();
-private:
- friend class Thread;
-
- // MakeStopInfoValid is necessary to allow saved stop infos to resurrect themselves as valid. It should
- // only need to be called by Thread::RestoreThreadStateFromCheckpoint.
+ // MakeStopInfoValid is necessary to allow saved stop infos to resurrect themselves as valid.
+ // It should only be used by Thread::RestoreThreadStateFromCheckpoint and to make sure the one-step
+ // needed for before-the-fact watchpoints does not prevent us from stopping
void
MakeStopInfoValid ();
+private:
+ friend class Thread;
+
DISALLOW_COPY_AND_ASSIGN (StopInfo);
};
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/Target.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/Target.h Thu Jul 19 11:39:59 2012
@@ -898,7 +898,8 @@
bool unwind_on_error,
bool keep_in_memory,
lldb::DynamicValueType use_dynamic,
- lldb::ValueObjectSP &result_valobj_sp);
+ lldb::ValueObjectSP &result_valobj_sp,
+ uint32_t single_thread_timeout_usec = 500000);
ClangPersistentVariables &
GetPersistentVariables()
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj Thu Jul 19 11:39:59 2012
@@ -452,6 +452,7 @@
49DA65031485C92A005FF180 /* AppleObjCSymbolVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* AppleObjCSymbolVendor.cpp */; };
4C6649A014EEE7F100B0316F /* StreamCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C66499F14EEE7F100B0316F /* StreamCallback.h */; };
4C6649A314EEE81000B0316F /* StreamCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6649A214EEE81000B0316F /* StreamCallback.cpp */; };
+ 4C701C1E15ABB70C00B50001 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */; };
4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; };
4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */; };
@@ -461,6 +462,7 @@
4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */; };
4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; };
4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; };
+ 4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CF52AF41428291E0051E832 /* SBFileSpecList.h */; settings = {ATTRIBUTES = (Public, ); }; };
4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
94031A9E13CF486700DCFF3C /* InputReaderEZ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94031A9D13CF486600DCFF3C /* InputReaderEZ.cpp */; };
@@ -517,7 +519,6 @@
B299580B14F2FA1400050A04 /* DisassemblerLLVMC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */; };
B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
- ED236E0814F84F6800153F6F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
ED88244E15114A9200BC98B9 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
ED88245015114CA200BC98B9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; };
ED88245115114CA200BC98B9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; };
@@ -1582,7 +1583,7 @@
268901161335BBC300698AC0 /* liblldb-core.a in Frameworks */,
2668022F115FD19D008E1FE4 /* CoreFoundation.framework in Frameworks */,
26680233115FD1A7008E1FE4 /* libobjc.dylib in Frameworks */,
- ED236E0814F84F6800153F6F /* Security.framework in Frameworks */,
+ 4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1597,6 +1598,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 4C701C1E15ABB70C00B50001 /* libxml2.dylib in Frameworks */,
26DC6A171337FE8000FF7998 /* liblldb-core.a in Frameworks */,
26B1FCB813381071002886E2 /* CoreFoundation.framework in Frameworks */,
26B1FCBC13381071002886E2 /* libobjc.dylib in Frameworks */,
@@ -3310,7 +3312,6 @@
buildPhases = (
26DC6A0D1337FE6900FF7998 /* Sources */,
26DC6A0E1337FE6900FF7998 /* Frameworks */,
- 261CE9C014D327DE006D8EFE /* Codesign */,
);
buildRules = (
);
@@ -3379,7 +3380,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0430;
+ LastUpgradeCheck = 0450;
};
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.2";
@@ -3464,20 +3465,6 @@
shellPath = /bin/sh;
shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\t/usr/bin/sed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n\t/usr/bin/sed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\n\tTRUNCATED_VERSION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+)(\\.[0-9]+)?$/\\1/g'`\n\t/usr/bin/sed -i '' \"s|//#define LLDB_VERSION|#define LLDB_VERSION $TRUNCATED_VERSION |\" \"$file\"\ndone\n";
};
- 261CE9C014D327DE006D8EFE /* Codesign */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = Codesign;
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = "/bin/sh -x";
- shellScript = "if [ $CONFIGURATION != BuildAndIntegration -a $PLATFORM_NAME = macosx ]; then /usr/bin/codesign -s lldb_codesign -f \"$TARGET_BUILD_DIR/$TARGET_NAME\"; fi";
- };
261EECA21337D399001D193C /* Build llvm and clang */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -4097,7 +4084,7 @@
"-flimit-debug-info",
"-Wparentheses",
);
- SDKROOT = macosx;
+ SDKROOT = "";
STRIP_INSTALLED_PRODUCT = NO;
STRIP_STYLE = debugging;
VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4148,10 +4135,12 @@
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
LLVM_CONFIGURATION = Release;
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
+ ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-flimit-debug-info",
"-Wparentheses",
);
+ SDKROOT = "";
STRIP_INSTALLED_PRODUCT = NO;
STRIP_STYLE = debugging;
VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4204,9 +4193,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
- CURRENT_PROJECT_VERSION = 161;
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 162;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 161;
+ DYLIB_CURRENT_VERSION = 162;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4238,8 +4228,6 @@
"-lllvmclang",
"-framework",
Foundation,
- "-framework",
- AppKit,
"-v",
"-t",
"-Wl,-v",
@@ -4250,8 +4238,6 @@
"-t",
"-Wl,-v",
"-framework",
- UIKit,
- "-framework",
Foundation,
);
PRODUCT_NAME = LLDB;
@@ -4266,10 +4252,11 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
- CURRENT_PROJECT_VERSION = 161;
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 162;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 161;
+ DYLIB_CURRENT_VERSION = 162;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4312,8 +4299,6 @@
"-t",
"-Wl,-v",
"-framework",
- UIKit,
- "-framework",
Foundation,
);
PRODUCT_NAME = LLDB;
@@ -4327,7 +4312,8 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CURRENT_PROJECT_VERSION = 161;
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 162;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4352,8 +4338,9 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 161;
+ CURRENT_PROJECT_VERSION = 162;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4369,8 +4356,9 @@
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 161;
+ CURRENT_PROJECT_VERSION = 162;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4384,8 +4372,9 @@
2689FFD513353D7A00698AC0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 161;
- DYLIB_CURRENT_VERSION = 161;
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 162;
+ DYLIB_CURRENT_VERSION = 162;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4414,8 +4403,9 @@
2689FFD613353D7A00698AC0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 161;
- DYLIB_CURRENT_VERSION = 161;
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 162;
+ DYLIB_CURRENT_VERSION = 162;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4444,8 +4434,9 @@
2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 161;
- DYLIB_CURRENT_VERSION = 161;
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 162;
+ DYLIB_CURRENT_VERSION = 162;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4523,6 +4514,7 @@
"-flimit-debug-info",
"-Wparentheses",
);
+ SDKROOT = "";
STRIP_INSTALLED_PRODUCT = NO;
STRIP_STYLE = debugging;
VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4534,7 +4526,7 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 161;
+ CURRENT_PROJECT_VERSION = 162;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4573,11 +4565,12 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 161;
+ CURRENT_PROJECT_VERSION = 162;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 161;
+ DYLIB_CURRENT_VERSION = 162;
EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4620,8 +4613,6 @@
"-t",
"-Wl,-v",
"-framework",
- UIKit,
- "-framework",
Foundation,
);
PRODUCT_NAME = LLDB;
@@ -4634,6 +4625,7 @@
26CEF3AA14FD58BF007286B2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -4641,6 +4633,7 @@
26CEF3AB14FD58BF007286B2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -4648,6 +4641,7 @@
26CEF3AC14FD58BF007286B2 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = BuildAndIntegration;
@@ -4655,6 +4649,7 @@
26CEF3B314FD592B007286B2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -4662,6 +4657,7 @@
26CEF3B414FD592B007286B2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -4669,6 +4665,7 @@
26CEF3B514FD592B007286B2 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = BuildAndIntegration;
@@ -4676,6 +4673,7 @@
26CEF3BE14FD596A007286B2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -4683,6 +4681,7 @@
26CEF3BF14FD596A007286B2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -4690,6 +4689,7 @@
26CEF3C014FD596A007286B2 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = BuildAndIntegration;
@@ -4697,6 +4697,8 @@
26DC6A121337FE6A00FF7998 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4750,6 +4752,8 @@
UIKit,
);
PRODUCT_NAME = "lldb-platform";
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+ "PROVISIONING_PROFILE[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
};
@@ -4758,6 +4762,8 @@
26DC6A131337FE6A00FF7998 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4809,6 +4815,8 @@
UIKit,
);
PRODUCT_NAME = "lldb-platform";
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+ "PROVISIONING_PROFILE[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
};
@@ -4878,7 +4886,7 @@
26F5C26C10F3D9A5009D5894 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 161;
+ CURRENT_PROJECT_VERSION = 162;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4908,7 +4916,7 @@
26F5C26D10F3D9A5009D5894 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- CURRENT_PROJECT_VERSION = 161;
+ CURRENT_PROJECT_VERSION = 162;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4938,6 +4946,7 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
CODE_SIGN_IDENTITY = "-";
+ COMBINE_HIDPI_IMAGES = YES;
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SYMROOT)";
GCC_DYNAMIC_NO_PIC = NO;
@@ -4972,6 +4981,7 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
CODE_SIGN_IDENTITY = "-";
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SYMROOT)";
@@ -5001,6 +5011,7 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
CODE_SIGN_IDENTITY = "-";
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -5029,6 +5040,7 @@
CLANG_OBJC_RUNTIME = NO;
CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
CODE_SIGN_IDENTITY = "-";
+ COMBINE_HIDPI_IMAGES = YES;
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SYMROOT)";
GCC_DYNAMIC_NO_PIC = NO;
@@ -5064,6 +5076,7 @@
CLANG_OBJC_RUNTIME = NO;
CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
CODE_SIGN_IDENTITY = "-";
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEPLOYMENT_LOCATION = YES;
DSTROOT = "$(SYMROOT)";
@@ -5094,6 +5107,7 @@
CLANG_OBJC_RUNTIME = NO;
CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
CODE_SIGN_IDENTITY = "-";
+ COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme Thu Jul 19 11:39:59 2012
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0430"
+ LastUpgradeVersion = "0450"
version = "1.8">
<BuildAction
parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
@@ -56,6 +56,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme Thu Jul 19 11:39:59 2012
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0430"
+ LastUpgradeVersion = "0450"
version = "1.8">
<BuildAction
parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
@@ -47,6 +47,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme Thu Jul 19 11:39:59 2012
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
+ LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -37,6 +38,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme Thu Jul 19 11:39:59 2012
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0440"
+ LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -38,6 +38,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<PathRunnable
FilePath = "/Users/moi/Library/Developer/Xcode/DerivedData/Xcode-ezhudafllefyhcfivqaeslnymjsj/Build/Products/Debug/LLDB.framework/XPCServices/com.apple.lldb.launcherXPCService.xpc/Contents/MacOS/com.apple.lldb.launcherXPCService">
Modified: lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme Thu Jul 19 11:39:59 2012
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0430"
+ LastUpgradeVersion = "0450"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
@@ -90,6 +90,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "YES"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
Modified: lldb/branches/apple/python-GIL/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/llvm.zip?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
Binary files - no diff available.
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/resources/LLDB-Info.plist (original)
+++ lldb/branches/apple/python-GIL/resources/LLDB-Info.plist Thu Jul 19 11:39:59 2012
@@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>161</string>
+ <string>162</string>
<key>CFBundleName</key>
<string>${EXECUTABLE_NAME}</string>
</dict>
Modified: lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i (original)
+++ lldb/branches/apple/python-GIL/scripts/Python/interface/SBProcess.i Thu Jul 19 11:39:59 2012
@@ -127,12 +127,30 @@
uint32_t
GetNumThreads ();
+ %feature("autodoc", "
+ Returns the INDEX'th thread from the list of current threads. The index
+ of a thread is only valid for the current stop. For a persistent thread
+ identifier use either the thread ID or the IndexID. See help on SBThread
+ for more details.
+ ") GetThreadAtIndex;
lldb::SBThread
GetThreadAtIndex (size_t index);
+ %feature("autodoc", "
+ Returns the thread with the given thread ID.
+ ") GetThreadByID;
lldb::SBThread
GetThreadByID (lldb::tid_t sb_thread_id);
+
+ %feature("autodoc", "
+ Returns the thread with the given thread IndexID.
+ ") GetThreadByIndexID;
+ lldb::SBThread
+ GetThreadByIndexID (uint32_t index_id);
+ %feature("autodoc", "
+ Returns the currently selected thread.
+ ") GetSelectedThread;
lldb::SBThread
GetSelectedThread () const;
@@ -142,6 +160,9 @@
bool
SetSelectedThreadByID (uint32_t tid);
+ bool
+ SetSelectedThreadByIndexID (uint32_t index_id);
+
//------------------------------------------------------------------
// Stepping related functions
//------------------------------------------------------------------
Modified: lldb/branches/apple/python-GIL/scripts/Python/interface/SBThread.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/Python/interface/SBThread.i?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/Python/interface/SBThread.i (original)
+++ lldb/branches/apple/python-GIL/scripts/Python/interface/SBThread.i Thu Jul 19 11:39:59 2012
@@ -12,6 +12,12 @@
%feature("docstring",
"Represents a thread of execution. SBProcess contains SBThread(s).
+SBThreads can be referred to by their ID, which maps to the system specific thread
+identifier, or by IndexID. The ID may or may not be unique depending on whether the
+system reuses its thread identifiers. The IndexID is a monotonically increasing identifier
+that will always uniquely reference a particular thread, and when that thread goes
+away it will not be reused.
+
SBThread supports frame iteration. For example (from test/python_api/
lldbutil/iter/TestLLDBIterator.py),
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff (original)
+++ lldb/branches/apple/python-GIL/scripts/clang.amalgamated.diff Thu Jul 19 11:39:59 2012
@@ -77,6 +77,20 @@
ExprResult BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr,
Expr *IndexExpr,
ObjCMethodDecl *getterMethod,
+Index: include/clang/AST/ASTImporter.h
+===================================================================
+--- include/clang/AST/ASTImporter.h (revision 152265)
++++ include/clang/AST/ASTImporter.h (working copy)
+@@ -271,7 +271,8 @@
+
+ /// \brief Determine whether the given types are structurally
+ /// equivalent.
+- bool IsStructurallyEquivalent(QualType From, QualType To);
++ bool IsStructurallyEquivalent(QualType From, QualType To,
++ bool Complain = true);
+ };
+ }
+
Index: include/clang/AST/Type.h
===================================================================
--- include/clang/AST/Type.h (revision 152265)
@@ -1261,6 +1275,166 @@
if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance)))
return MethodDecl;
+Index: lib/AST/ASTImporter.cpp
+===================================================================
+--- lib/AST/ASTImporter.cpp (revision 152265)
++++ lib/AST/ASTImporter.cpp (working copy)
+@@ -119,7 +119,8 @@
+ bool ImportTemplateArguments(const TemplateArgument *FromArgs,
+ unsigned NumFromArgs,
+ SmallVectorImpl<TemplateArgument> &ToArgs);
+- bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord);
++ bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord,
++ bool Complain = true);
+ bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord);
+ bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To);
+ Decl *VisitDecl(Decl *D);
+@@ -201,12 +202,16 @@
+ /// \brief Whether we're being strict about the spelling of types when
+ /// unifying two types.
+ bool StrictTypeSpelling;
+-
++
++ /// \brief Whether to complain about failures.
++ bool Complain;
++
+ StructuralEquivalenceContext(ASTContext &C1, ASTContext &C2,
+ llvm::DenseSet<std::pair<Decl *, Decl *> > &NonEquivalentDecls,
+- bool StrictTypeSpelling = false)
++ bool StrictTypeSpelling = false,
++ bool Complain = true)
+ : C1(C1), C2(C2), NonEquivalentDecls(NonEquivalentDecls),
+- StrictTypeSpelling(StrictTypeSpelling) { }
++ StrictTypeSpelling(StrictTypeSpelling), Complain(Complain) { }
+
+ /// \brief Determine whether the two declarations are structurally
+ /// equivalent.
+@@ -223,10 +228,16 @@
+
+ public:
+ DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID) {
++ if (!Complain)
++ return DiagnosticBuilder(DiagnosticBuilder::Suppress);
++
+ return C1.getDiagnostics().Report(Loc, DiagID);
+ }
+
+ DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID) {
++ if (!Complain)
++ return DiagnosticBuilder(DiagnosticBuilder::Suppress);
++
+ return C2.getDiagnostics().Report(Loc, DiagID);
+ }
+ };
+@@ -2050,10 +2061,12 @@
+ }
+
+ bool ASTNodeImporter::IsStructuralMatch(RecordDecl *FromRecord,
+- RecordDecl *ToRecord) {
++ RecordDecl *ToRecord,
++ bool Complain) {
+ StructuralEquivalenceContext Ctx(Importer.getFromContext(),
+ Importer.getToContext(),
+- Importer.getNonEquivalentDecls());
++ Importer.getNonEquivalentDecls(),
++ false, Complain);
+ return Ctx.IsStructurallyEquivalent(FromRecord, ToRecord);
+ }
+
+@@ -2333,7 +2346,7 @@
+
+ // We may already have a record of the same name; try to find and match it.
+ RecordDecl *AdoptDecl = 0;
+- if (!DC->isFunctionOrMethod() && SearchName) {
++ if (!DC->isFunctionOrMethod()) {
+ SmallVector<NamedDecl *, 4> ConflictingDecls;
+ llvm::SmallVector<NamedDecl *, 2> FoundDecls;
+ DC->localUncachedLookup(SearchName, FoundDecls);
+@@ -2349,26 +2362,32 @@
+
+ if (RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
+ if (RecordDecl *FoundDef = FoundRecord->getDefinition()) {
+- if (!D->isCompleteDefinition() || IsStructuralMatch(D, FoundDef)) {
++ if ((SearchName && !D->isCompleteDefinition()) ||
++ (D->isCompleteDefinition() &&
++ D->isAnonymousStructOrUnion()
++ == FoundDef->isAnonymousStructOrUnion() &&
++ IsStructuralMatch(D, FoundDef, SearchName))) {
+ // The record types structurally match, or the "from" translation
+ // unit only had a forward declaration anyway; call it the same
+ // function.
+ // FIXME: For C++, we should also merge methods here.
+ return Importer.Imported(D, FoundDef);
+ }
+- } else {
++ } else if (!D->isCompleteDefinition()) {
+ // We have a forward declaration of this type, so adopt that forward
+ // declaration rather than building a new one.
+ AdoptDecl = FoundRecord;
+ continue;
+- }
++ } else if (!SearchName) {
++ continue;
++ }
+ }
+
+ ConflictingDecls.push_back(FoundDecls[I]);
+ }
+
+- if (!ConflictingDecls.empty()) {
+- Name = Importer.HandleNameConflict(Name, DC, IDNS,
++ if (!ConflictingDecls.empty() && SearchName) {
++ Name = Importer.HandleNameConflict(SearchName, DC, IDNS,
+ ConflictingDecls.data(),
+ ConflictingDecls.size());
+ }
+@@ -2393,6 +2412,8 @@
+ D2->setQualifierInfo(Importer.Import(D->getQualifierLoc()));
+ D2->setLexicalDeclContext(LexicalDC);
+ LexicalDC->addDeclInternal(D2);
++ if (D->isAnonymousStructOrUnion())
++ D2->setAnonymousStructOrUnion(true);
+ }
+
+ Importer.Imported(D, D2);
+@@ -2631,12 +2652,17 @@
+ DC->localUncachedLookup(Name, FoundDecls);
+ for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
+ if (FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[I])) {
+- if (Importer.IsStructurallyEquivalent(D->getType(),
+- FoundField->getType())) {
++ if (Importer.IsStructurallyEquivalent(D->getType(),
++ FoundField->getType(),
++ Name)) {
+ Importer.Imported(D, FoundField);
+ return FoundField;
+ }
+-
++
++ // If there are more anonymous fields to check, continue.
++ if (!Name && I < N-1)
++ continue;
++
+ Importer.ToDiag(Loc, diag::err_odr_field_type_inconsistent)
+ << Name << D->getType() << FoundField->getType();
+ Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
+@@ -4662,12 +4688,14 @@
+ return To;
+ }
+
+-bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To) {
++bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To,
++ bool Complain) {
+ llvm::DenseMap<const Type *, const Type *>::iterator Pos
+ = ImportedTypes.find(From.getTypePtr());
+ if (Pos != ImportedTypes.end() && ToContext.hasSameType(Import(From), To))
+ return true;
+
+- StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls);
++ StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls,
++ false, Complain);
+ return Ctx.IsStructurallyEquivalent(From, To);
+ }
Index: lib/AST/NSAPI.cpp
===================================================================
--- lib/AST/NSAPI.cpp (revision 152265)
@@ -1454,6 +1628,27 @@
}
void StmtPrinter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
+Index: lib/AST/DeclBase.cpp
+===================================================================
+--- lib/AST/DeclBase.cpp (revision 152265)
++++ lib/AST/DeclBase.cpp (working copy)
+@@ -1153,14 +1153,14 @@
+
+ // If there's no external storage, just perform a normal lookup and copy
+ // the results.
+- if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage()) {
++ if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage() && Name) {
+ lookup_result LookupResults = lookup(Name);
+ Results.insert(Results.end(), LookupResults.first, LookupResults.second);
+ return;
+ }
+
+ // If we have a lookup table, check there first. Maybe we'll get lucky.
+- if (LookupPtr) {
++ if (LookupPtr && Name) {
+ StoredDeclsMap::iterator Pos = LookupPtr->find(Name);
+ if (Pos != LookupPtr->end()) {
+ Results.insert(Results.end(),
Index: lib/AST/StmtProfile.cpp
===================================================================
--- lib/AST/StmtProfile.cpp (revision 152265)
Modified: lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp Thu Jul 19 11:39:59 2012
@@ -139,8 +139,8 @@
return 0;
if (log)
- log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %ld, last char at: %ld, match_start_point: %d, max_return_elements: %d)",
- m_opaque_ptr, current_line, cursor - current_line, last_char - current_line, match_start_point, max_return_elements);
+ log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %lld, last char at: %lld, match_start_point: %d, max_return_elements: %d)",
+ m_opaque_ptr, current_line, (uint64_t) (cursor - current_line), (uint64_t) (last_char - current_line), match_start_point, max_return_elements);
if (m_opaque_ptr)
{
Modified: lldb/branches/apple/python-GIL/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBFrame.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBFrame.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBFrame.cpp Thu Jul 19 11:39:59 2012
@@ -534,7 +534,7 @@
Error error;
ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
use_dynamic,
- StackFrame::eExpressionPathOptionCheckPtrVsMember,
+ StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
var_sp,
error));
sb_value.SetSP(value_sp);
@@ -1038,7 +1038,7 @@
LogSP expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
- ExecutionResults exe_results;
+ ExecutionResults exe_results = eExecutionSetupError;
SBValue expr_result;
ValueObjectSP expr_value_sp;
Modified: lldb/branches/apple/python-GIL/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBProcess.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBProcess.cpp Thu Jul 19 11:39:59 2012
@@ -39,7 +39,7 @@
SBProcess::SBProcess () :
- m_opaque_sp()
+ m_opaque_wp()
{
}
@@ -49,13 +49,13 @@
//----------------------------------------------------------------------
SBProcess::SBProcess (const SBProcess& rhs) :
- m_opaque_sp (rhs.m_opaque_sp)
+ m_opaque_wp (rhs.m_opaque_wp)
{
}
SBProcess::SBProcess (const lldb::ProcessSP &process_sp) :
- m_opaque_sp (process_sp)
+ m_opaque_wp (process_sp)
{
}
@@ -63,7 +63,7 @@
SBProcess::operator = (const SBProcess& rhs)
{
if (this != &rhs)
- m_opaque_sp = rhs.m_opaque_sp;
+ m_opaque_wp = rhs.m_opaque_wp;
return *this;
}
@@ -83,26 +83,26 @@
lldb::ProcessSP
SBProcess::GetSP() const
{
- return m_opaque_sp;
+ return m_opaque_wp.lock();
}
void
SBProcess::SetSP (const ProcessSP &process_sp)
{
- m_opaque_sp = process_sp;
+ m_opaque_wp = process_sp;
}
void
SBProcess::Clear ()
{
- m_opaque_sp.reset();
+ m_opaque_wp.reset();
}
bool
SBProcess::IsValid() const
{
- return m_opaque_sp.get() != NULL;
+ return m_opaque_wp.lock().get() != NULL;
}
bool
@@ -119,7 +119,7 @@
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log) {
log->Printf ("SBProcess(%p)::RemoteLaunch (argv=%p, envp=%p, stdin=%s, stdout=%s, stderr=%s, working-dir=%s, launch_flags=0x%x, stop_at_entry=%i, &error (%p))...",
- m_opaque_sp.get(),
+ m_opaque_wp.lock().get(),
argv,
envp,
stdin_path ? stdin_path : "NULL",
@@ -405,6 +405,26 @@
return ret_val;
}
+bool
+SBProcess::SetSelectedThreadByIndexID (uint32_t index_id)
+{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ bool ret_val = false;
+ ProcessSP process_sp(GetSP());
+ if (process_sp)
+ {
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+ ret_val = process_sp->GetThreadList().SetSelectedThreadByIndexID (index_id);
+ }
+
+ if (log)
+ log->Printf ("SBProcess(%p)::SetSelectedThreadByID (tid=0x%x) => %s",
+ process_sp.get(), index_id, (ret_val ? "true" : "false"));
+
+ return ret_val;
+}
+
SBThread
SBProcess::GetThreadAtIndex (size_t index)
{
@@ -725,6 +745,33 @@
return sb_thread;
}
+SBThread
+SBProcess::GetThreadByIndexID (uint32_t index_id)
+{
+ SBThread sb_thread;
+ ThreadSP thread_sp;
+ ProcessSP process_sp(GetSP());
+ if (process_sp)
+ {
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+ Process::StopLocker stop_locker;
+ const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
+ thread_sp = process_sp->GetThreadList().FindThreadByIndexID (index_id, can_update);
+ sb_thread.SetThread (thread_sp);
+ }
+
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ {
+ log->Printf ("SBProcess(%p)::GetThreadByID (tid=0x%x) => SBThread (%p)",
+ process_sp.get(),
+ index_id,
+ thread_sp.get());
+ }
+
+ return sb_thread;
+}
+
StateType
SBProcess::GetStateFromEvent (const SBEvent &event)
{
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBTarget.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBTarget.cpp Thu Jul 19 11:39:59 2012
@@ -754,20 +754,19 @@
const bool synchronous_execution = target_sp->GetDebugger().GetAsyncExecution () == false;
if (error.Success())
{
- StateType state = eStateInvalid;
if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
{
// If we are doing synchronous mode, then wait for the initial
// stop to happen, else, return and let the caller watch for
// the stop
if (synchronous_execution)
- state = process_sp->WaitForProcessToStop (NULL);
+ process_sp->WaitForProcessToStop (NULL);
// We we are stopping at the entry point, we can return now!
return sb_process;
}
// Make sure we are stopped at the entry
- state = process_sp->WaitForProcessToStop (NULL);
+ StateType state = process_sp->WaitForProcessToStop (NULL);
if (state == eStateStopped)
{
// resume the process to skip the entry point
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpoint.cpp Thu Jul 19 11:39:59 2012
@@ -373,14 +373,8 @@
Breakpoint *bp = NULL;
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;
-
switch (break_type)
{
case eSetTypeFileAndLine: // Breakpoint by source position
@@ -1673,8 +1667,6 @@
"A set of commands for operating on breakpoints. Also see _regexp-break.",
"breakpoint <command> [<command-options>]")
{
- bool status;
-
CommandObjectSP list_command_object (new CommandObjectBreakpointList (interpreter));
CommandObjectSP enable_command_object (new CommandObjectBreakpointEnable (interpreter));
CommandObjectSP disable_command_object (new CommandObjectBreakpointDisable (interpreter));
@@ -1693,14 +1685,14 @@
command_command_object->SetCommandName ("breakpoint command");
modify_command_object->SetCommandName ("breakpoint modify");
- status = LoadSubCommand ("list", list_command_object);
- status = LoadSubCommand ("enable", enable_command_object);
- status = LoadSubCommand ("disable", disable_command_object);
- status = LoadSubCommand ("clear", clear_command_object);
- status = LoadSubCommand ("delete", delete_command_object);
- status = LoadSubCommand ("set", set_command_object);
- status = LoadSubCommand ("command", command_command_object);
- status = LoadSubCommand ("modify", modify_command_object);
+ LoadSubCommand ("list", list_command_object);
+ LoadSubCommand ("enable", enable_command_object);
+ LoadSubCommand ("disable", disable_command_object);
+ LoadSubCommand ("clear", clear_command_object);
+ LoadSubCommand ("delete", delete_command_object);
+ LoadSubCommand ("set", set_command_object);
+ LoadSubCommand ("command", command_command_object);
+ LoadSubCommand ("modify", modify_command_object);
}
CommandObjectMultiwordBreakpoint::~CommandObjectMultiwordBreakpoint ()
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp Thu Jul 19 11:39:59 2012
@@ -864,7 +864,6 @@
"A set of commands for adding, removing and examining bits of code to be executed when the breakpoint is hit (breakpoint 'commmands').",
"command <sub-command> [<sub-command-options>] <breakpoint-id>")
{
- bool status;
CommandObjectSP add_command_object (new CommandObjectBreakpointCommandAdd (interpreter));
CommandObjectSP delete_command_object (new CommandObjectBreakpointCommandDelete (interpreter));
CommandObjectSP list_command_object (new CommandObjectBreakpointCommandList (interpreter));
@@ -873,9 +872,9 @@
delete_command_object->SetCommandName ("breakpoint command delete");
list_command_object->SetCommandName ("breakpoint command list");
- status = LoadSubCommand ("add", add_command_object);
- status = LoadSubCommand ("delete", delete_command_object);
- status = LoadSubCommand ("list", list_command_object);
+ LoadSubCommand ("add", add_command_object);
+ LoadSubCommand ("delete", delete_command_object);
+ LoadSubCommand ("list", list_command_object);
}
CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand ()
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp Thu Jul 19 11:39:59 2012
@@ -305,7 +305,8 @@
m_command_options.unwind_on_error,
keep_in_memory,
use_dynamic,
- result_valobj_sp);
+ result_valobj_sp,
+ 0 /* no timeout */);
if (exe_results == eExecutionInterrupted && !m_command_options.unwind_on_error)
{
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp Thu Jul 19 11:39:59 2012
@@ -483,7 +483,8 @@
else // No regex, either exact variable names or variable expressions.
{
Error error;
- uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember;
+ uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember |
+ StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
lldb::VariableSP var_sp;
valobj_sp = frame->GetValueForVariableExpressionPath (name_cstr,
m_varobj_options.use_dynamic,
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp Thu Jul 19 11:39:59 2012
@@ -1015,7 +1015,8 @@
// Things have checked out ok...
Error error;
- uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember;
+ uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember |
+ StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
valobj_sp = frame->GetValueForVariableExpressionPath (command.GetArgumentAtIndex(0),
eNoDynamicValues,
expr_path_options,
@@ -1205,7 +1206,8 @@
unwind_on_error,
keep_in_memory,
eNoDynamicValues,
- valobj_sp);
+ valobj_sp,
+ 0 /* no timeout */);
if (expr_result != eExecutionCompleted) {
result.GetErrorStream().Printf("error: expression evaluation of address to watch failed\n");
result.GetErrorStream().Printf("expression evaluated: %s\n", expr_str.c_str());
@@ -1293,8 +1295,6 @@
"A set of commands for operating on watchpoints.",
"watchpoint <command> [<command-options>]")
{
- bool status;
-
CommandObjectSP list_command_object (new CommandObjectWatchpointList (interpreter));
CommandObjectSP enable_command_object (new CommandObjectWatchpointEnable (interpreter));
CommandObjectSP disable_command_object (new CommandObjectWatchpointDisable (interpreter));
@@ -1311,13 +1311,13 @@
modify_command_object->SetCommandName("watchpoint modify");
set_command_object->SetCommandName("watchpoint set");
- status = LoadSubCommand ("list", list_command_object);
- status = LoadSubCommand ("enable", enable_command_object);
- status = LoadSubCommand ("disable", disable_command_object);
- status = LoadSubCommand ("delete", delete_command_object);
- status = LoadSubCommand ("ignore", ignore_command_object);
- status = LoadSubCommand ("modify", modify_command_object);
- status = LoadSubCommand ("set", set_command_object);
+ LoadSubCommand ("list", list_command_object);
+ LoadSubCommand ("enable", enable_command_object);
+ LoadSubCommand ("disable", disable_command_object);
+ LoadSubCommand ("delete", delete_command_object);
+ LoadSubCommand ("ignore", ignore_command_object);
+ LoadSubCommand ("modify", modify_command_object);
+ LoadSubCommand ("set", set_command_object);
}
CommandObjectMultiwordWatchpoint::~CommandObjectMultiwordWatchpoint()
Modified: lldb/branches/apple/python-GIL/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/Address.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Address.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Address.cpp Thu Jul 19 11:39:59 2012
@@ -431,14 +431,6 @@
case DumpStyleResolvedDescriptionNoModule:
if (IsSectionOffset())
{
- AddressType addr_type = eAddressTypeLoad;
- addr_t addr = GetLoadAddress (target);
- if (addr == LLDB_INVALID_ADDRESS)
- {
- addr = GetFileAddress();
- addr_type = eAddressTypeFile;
- }
-
uint32_t pointer_size = 4;
ModuleSP module_sp (GetModule());
if (target)
Modified: lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp Thu Jul 19 11:39:59 2012
@@ -77,7 +77,8 @@
m_socket_timeout_usec(0),
m_command_fd_send(-1),
m_command_fd_receive(-1),
- m_mutex (Mutex::eMutexTypeRecursive)
+ m_mutex (Mutex::eMutexTypeRecursive),
+ m_shutting_down (false)
{
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT));
if (log)
@@ -95,7 +96,8 @@
m_socket_timeout_usec(0),
m_command_fd_send(-1),
m_command_fd_receive(-1),
- m_mutex (Mutex::eMutexTypeRecursive)
+ m_mutex (Mutex::eMutexTypeRecursive),
+ m_shutting_down (false)
{
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT));
if (log)
@@ -282,50 +284,72 @@
ConnectionStatus
ConnectionFileDescriptor::Disconnect (Error *error_ptr)
{
- Mutex::Locker locker (m_mutex);
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
if (log)
log->Printf ("%p ConnectionFileDescriptor::Disconnect ()", this);
ConnectionStatus status = eConnectionStatusSuccess;
- if (m_fd_send >= 0 || m_fd_recv >= 0)
+ if (m_fd_send < 0 && m_fd_recv < 0)
{
- if (m_should_close_fd == false)
+ if (log)
+ log->Printf ("%p ConnectionFileDescriptor::Disconnect(): Nothing to disconnect", this);
+ return eConnectionStatusSuccess;
+ }
+
+ // Try to get the ConnectionFileDescriptor's mutex. If we fail, that is quite likely
+ // because somebody is doing a blocking read on our file descriptor. If that's the case,
+ // then send the "q" char to the command file channel so the read will wake up and the connection
+ // will then know to shut down.
+
+ m_shutting_down = true;
+
+ Mutex::Locker locker;
+ bool got_lock= locker.TryLock (m_mutex);
+
+ if (!got_lock)
+ {
+ if (m_command_fd_send != -1 )
{
- m_fd_send = m_fd_recv = -1;
+ write (m_command_fd_send, "q", 1);
+ close (m_command_fd_send);
+ m_command_fd_send = -1;
+ }
+ locker.Lock (m_mutex);
+ }
+
+ if (m_should_close_fd == true)
+ {
+ if (m_fd_send == m_fd_recv)
+ {
+ status = Close (m_fd_send, error_ptr);
}
else
{
- if (m_fd_send == m_fd_recv)
- {
- // Both file descriptors are the same, only close one
- m_fd_recv = -1;
+ // File descriptors are the different, close both if needed
+ if (m_fd_send >= 0)
status = Close (m_fd_send, error_ptr);
- }
- else
+ if (m_fd_recv >= 0)
{
- // File descriptors are the different, close both if needed
- if (m_fd_send >= 0)
- status = Close (m_fd_send, error_ptr);
- if (m_fd_recv >= 0)
- {
- ConnectionStatus recv_status = Close (m_fd_recv, error_ptr);
- if (status == eConnectionStatusSuccess)
- status = recv_status;
- }
+ ConnectionStatus recv_status = Close (m_fd_recv, error_ptr);
+ if (status == eConnectionStatusSuccess)
+ status = recv_status;
}
}
+ }
+
+ // Now set all our descriptors to invalid values.
+
+ m_fd_send = m_fd_recv = -1;
+
+ if (status != eConnectionStatusSuccess)
+ {
- // Now write a byte to the command pipe to wake our Reader if it is stuck in read.
- if (m_command_fd_send != -1 )
- {
- write (m_command_fd_send, "q", 1);
- close (m_command_fd_send);
- m_command_fd_send = -1;
- }
+ return status;
}
- return status;
+
+ m_shutting_down = false;
+ return eConnectionStatusSuccess;
}
size_t
@@ -340,6 +364,22 @@
log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %zu)...",
this, m_fd_recv, dst, dst_len);
+ Mutex::Locker locker;
+ bool got_lock = locker.TryLock (m_mutex);
+ if (!got_lock)
+ {
+ if (log)
+ log->Printf ("%p ConnectionFileDescriptor::Read () failed to get the connection lock.",
+ this);
+ if (error_ptr)
+ error_ptr->SetErrorString ("failed to get the connection lock for read.");
+
+ status = eConnectionStatusTimedOut;
+ return 0;
+ }
+ else if (m_shutting_down)
+ return eConnectionStatusError;
+
ssize_t bytes_read = 0;
status = BytesAvailable (timeout_usec, error_ptr);
@@ -542,7 +582,6 @@
break; // Break to close....
}
- //Disconnect (NULL);
return 0;
}
@@ -553,6 +592,9 @@
ConnectionStatus
ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_ptr)
{
+ // Don't need to take the mutex here separately since we are only called from Read. If we
+ // ever get used more generally we will need to lock here as well.
+
LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
if (log)
log->Printf("%p ConnectionFileDescriptor::BytesAvailable (timeout_usec = %u)", this, timeout_usec);
@@ -641,7 +683,7 @@
if (log)
log->Printf("%p ConnectionFileDescriptor::BytesAvailable() got data: %*s from the command channel.",
this, (int) bytes_read, buffer);
-
+
return eConnectionStatusEndOfFile;
}
else
Modified: lldb/branches/apple/python-GIL/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/Debugger.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Debugger.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Debugger.cpp Thu Jul 19 11:39:59 2012
@@ -987,48 +987,6 @@
return true;
}
-
-static ValueObjectSP
-ExpandExpressionPath (ValueObject* valobj,
- StackFrame* frame,
- bool* do_deref_pointer,
- const char* var_name_begin,
- const char* var_name_final,
- Error& error)
-{
- LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
- StreamString sstring;
- VariableSP var_sp;
-
- if (*do_deref_pointer)
- {
- if (log)
- log->Printf("been told to deref_pointer by caller");
- sstring.PutChar('*');
- }
- else if (valobj->IsDereferenceOfParent() && ClangASTContext::IsPointerType(valobj->GetParent()->GetClangType()) && !valobj->IsArrayItemForPointer())
- {
- if (log)
- log->Printf("decided to deref_pointer myself");
- sstring.PutChar('*');
- *do_deref_pointer = true;
- }
-
- valobj->GetExpressionPath(sstring, true, ValueObject::eGetExpressionPathFormatHonorPointers);
- if (log)
- log->Printf("expression path to expand in phase 0: %s",sstring.GetData());
- sstring.PutRawBytes(var_name_begin+3, var_name_final-var_name_begin-3);
- if (log)
- log->Printf("expression path to expand in phase 1: %s",sstring.GetData());
- std::string name = std::string(sstring.GetData());
- ValueObjectSP target = frame->GetValueForVariableExpressionPath (name.c_str(),
- eNoDynamicValues,
- 0,
- var_sp,
- error);
- return target;
-}
-
static ValueObjectSP
ExpandIndexedExpression (ValueObject* valobj,
uint32_t index,
@@ -1378,10 +1336,10 @@
}
else if (is_pointer) // if pointer, value is the address stored
{
- var_success = target->DumpPrintableRepresentation(s,
- val_obj_display,
- custom_format,
- ValueObject::ePrintableRepresentationSpecialCasesDisable);
+ target->DumpPrintableRepresentation (s,
+ val_obj_display,
+ custom_format,
+ ValueObject::ePrintableRepresentationSpecialCasesDisable);
}
else
{
Modified: lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp Thu Jul 19 11:39:59 2012
@@ -834,6 +834,17 @@
sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);
sys_category_sp->GetSummaryNavigator()->Add(ConstString("const char *"), string_format);
sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);
+
+ lldb::TypeSummaryImplSP ostype_summary(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
+ .SetSkipPointers(true)
+ .SetSkipReferences(true)
+ .SetDontShowChildren(true)
+ .SetDontShowValue(false)
+ .SetShowMembersOneLiner(false)
+ .SetHideItemNames(false),
+ "${var%O}"));
+
+ sys_category_sp->GetSummaryNavigator()->Add(ConstString("OSType"), ostype_summary);
}
static void
@@ -873,8 +884,8 @@
{
TypeSummaryImpl::Flags objc_flags;
objc_flags.SetCascades(false)
- .SetSkipPointers(false)
- .SetSkipReferences(false)
+ .SetSkipPointers(true)
+ .SetSkipReferences(true)
.SetDontShowChildren(true)
.SetDontShowValue(true)
.SetShowMembersOneLiner(false)
@@ -886,6 +897,18 @@
TypeCategoryImpl::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),
ObjC_BOOL_summary);
+
+ lldb::TypeSummaryImplSP ObjC_BOOLRef_summary(new ScriptSummaryFormat(objc_flags,
+ "lldb.formatters.objc.objc.BOOLRef_SummaryProvider",
+ ""));
+ objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL &"),
+ ObjC_BOOLRef_summary);
+ lldb::TypeSummaryImplSP ObjC_BOOLPtr_summary(new ScriptSummaryFormat(objc_flags,
+ "lldb.formatters.objc.objc.BOOLPtr_SummaryProvider",
+ ""));
+ objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"),
+ ObjC_BOOLPtr_summary);
+
// we need to skip pointers here since we are special casing a SEL* when retrieving its value
objc_flags.SetSkipPointers(true);
Modified: lldb/branches/apple/python-GIL/source/Core/InputReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/InputReader.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/InputReader.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/InputReader.cpp Thu Jul 19 11:39:59 2012
@@ -151,7 +151,7 @@
{
if (end_token && end_token == p)
{
- p += m_end_token.size();
+ m_end_token.size();
SetIsDone(true);
break;
}
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Module.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Module.cpp Thu Jul 19 11:39:59 2012
@@ -134,7 +134,8 @@
m_did_parse_uuid (false),
m_did_init_ast (false),
m_is_dynamic_loader_module (false),
- m_was_modified (false)
+ m_file_has_changed (false),
+ m_first_file_changed_log (false)
{
// Scope for locker below...
{
@@ -176,7 +177,8 @@
m_did_parse_uuid (false),
m_did_init_ast (false),
m_is_dynamic_loader_module (false),
- m_was_modified (false)
+ m_file_has_changed (false),
+ m_first_file_changed_log (false)
{
// Scope for locker below...
{
@@ -803,32 +805,44 @@
}
}
+bool
+Module::FileHasChanged () const
+{
+ if (m_file_has_changed == false)
+ m_file_has_changed = (m_file.GetModificationTime() != m_mod_time);
+ return m_file_has_changed;
+}
+
void
Module::ReportErrorIfModifyDetected (const char *format, ...)
{
- if (!GetModified(true) && GetModified(false))
+ if (m_first_file_changed_log == false)
{
- if (format)
+ if (FileHasChanged ())
{
- StreamString strm;
- strm.PutCString("error: the object file ");
- GetDescription(&strm, lldb::eDescriptionLevelFull);
- strm.PutCString (" has been modified\n");
-
- va_list args;
- va_start (args, format);
- strm.PrintfVarArg(format, args);
- va_end (args);
-
- const int format_len = strlen(format);
- if (format_len > 0)
+ m_first_file_changed_log = true;
+ if (format)
{
- const char last_char = format[format_len-1];
- if (last_char != '\n' || last_char != '\r')
- strm.EOL();
+ StreamString strm;
+ strm.PutCString("error: the object file ");
+ GetDescription(&strm, lldb::eDescriptionLevelFull);
+ strm.PutCString (" has been modified\n");
+
+ va_list args;
+ va_start (args, format);
+ strm.PrintfVarArg(format, args);
+ va_end (args);
+
+ const int format_len = strlen(format);
+ if (format_len > 0)
+ {
+ const char last_char = format[format_len-1];
+ if (last_char != '\n' || last_char != '\r')
+ strm.EOL();
+ }
+ strm.PutCString("The debug session should be aborted as the original debug information has been overwritten.\n");
+ Host::SystemLog (Host::eSystemLogError, "%s", strm.GetString().c_str());
}
- strm.PutCString("The debug session should be aborted as the original debug information has been overwritten.\n");
- Host::SystemLog (Host::eSystemLogError, "%s", strm.GetString().c_str());
}
}
}
@@ -893,26 +907,6 @@
}
}
-bool
-Module::GetModified (bool use_cached_only)
-{
- if (m_was_modified == false && use_cached_only == false)
- {
- TimeValue curr_mod_time (m_file.GetModificationTime());
- m_was_modified = curr_mod_time != m_mod_time;
- }
- return m_was_modified;
-}
-
-bool
-Module::SetModified (bool b)
-{
- const bool prev_value = m_was_modified;
- m_was_modified = b;
- return prev_value;
-}
-
-
void
Module::Dump(Stream *s)
{
Modified: lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ModuleList.cpp Thu Jul 19 11:39:59 2012
@@ -77,6 +77,32 @@
}
}
+void
+ModuleList::ReplaceEquivalent (const ModuleSP &module_sp)
+{
+ if (module_sp)
+ {
+ Mutex::Locker locker(m_modules_mutex);
+
+ // First remove any equivalent modules. Equivalent modules are modules
+ // whose path, platform path and architecture match.
+ ModuleSpec equivalent_module_spec (module_sp->GetFileSpec(), module_sp->GetArchitecture());
+ equivalent_module_spec.GetPlatformFileSpec() = module_sp->GetPlatformFileSpec();
+
+ size_t idx = 0;
+ while (idx < m_modules.size())
+ {
+ ModuleSP module_sp (m_modules[idx]);
+ if (module_sp->MatchesModuleSpec (equivalent_module_spec))
+ m_modules.erase(m_modules.begin() + idx);
+ else
+ ++idx;
+ }
+ // Now add the new module to the list
+ m_modules.push_back(module_sp);
+ }
+}
+
bool
ModuleList::AppendIfNeeded (const ModuleSP &module_sp)
{
@@ -323,7 +349,7 @@
return sc_list.GetSize() - initial_size;
}
- size_t
+size_t
ModuleList::FindSymbolsMatchingRegExAndType (const RegularExpression ®ex,
lldb::SymbolType symbol_type,
SymbolContextList &sc_list,
@@ -684,24 +710,21 @@
for (uint32_t module_idx = 0; module_idx < num_matching_modules; ++module_idx)
{
module_sp = matching_module_list.GetModuleAtIndex(module_idx);
- // If we had a UUID and we found a match, then that is good enough for a match
- if (uuid_ptr)
- break;
- if (module_file_spec)
+
+ // Make sure the file for the module hasn't been modified
+ if (module_sp->FileHasChanged())
{
- // If we didn't have a UUID in mind when looking for the object file,
- // then we should make sure the modification time hasn't changed!
- TimeValue file_spec_mod_time(module_file_spec.GetModificationTime());
- if (file_spec_mod_time.IsValid())
- {
- if (file_spec_mod_time == module_sp->GetModificationTime())
- return error;
- }
+ if (old_module_sp_ptr && !old_module_sp_ptr->get())
+ *old_module_sp_ptr = module_sp;
+ shared_module_list.Remove (module_sp);
+ module_sp.reset();
+ }
+ else
+ {
+ // The module matches and the module was not modified from
+ // when it was last loaded.
+ return error;
}
- if (old_module_sp_ptr && !old_module_sp_ptr->get())
- *old_module_sp_ptr = module_sp;
- shared_module_list.Remove (module_sp);
- module_sp.reset();
}
}
}
@@ -727,7 +750,7 @@
if (did_create_ptr)
*did_create_ptr = true;
- shared_module_list.Append(module_sp);
+ shared_module_list.ReplaceEquivalent(module_sp);
return error;
}
}
@@ -819,7 +842,7 @@
if (did_create_ptr)
*did_create_ptr = true;
- shared_module_list.Append(module_sp);
+ shared_module_list.ReplaceEquivalent(module_sp);
}
else
{
Modified: lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/SearchFilter.cpp Thu Jul 19 11:39:59 2012
@@ -186,11 +186,21 @@
Searcher::CallbackReturn
SearchFilter::DoModuleIteration (const SymbolContext &context, Searcher &searcher)
{
- Searcher::CallbackReturn shouldContinue;
-
if (searcher.GetDepth () >= Searcher::eDepthModule)
{
- if (!context.module_sp)
+ if (context.module_sp)
+ {
+ if (searcher.GetDepth () == Searcher::eDepthModule)
+ {
+ SymbolContext matchingContext(context.module_sp.get());
+ searcher.SearchCallback (*this, matchingContext, NULL, false);
+ }
+ else
+ {
+ return DoCUIteration(context.module_sp, context, searcher);
+ }
+ }
+ else
{
ModuleList &target_images = m_target_sp->GetImages();
Mutex::Locker modules_locker(target_images.GetMutex());
@@ -208,14 +218,14 @@
{
SymbolContext matchingContext(m_target_sp, module_sp);
- shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
+ Searcher::CallbackReturn shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
if (shouldContinue == Searcher::eCallbackReturnStop
|| shouldContinue == Searcher::eCallbackReturnPop)
return shouldContinue;
}
else
{
- shouldContinue = DoCUIteration(module_sp, context, searcher);
+ Searcher::CallbackReturn shouldContinue = DoCUIteration(module_sp, context, searcher);
if (shouldContinue == Searcher::eCallbackReturnStop)
return shouldContinue;
else if (shouldContinue == Searcher::eCallbackReturnPop)
@@ -223,20 +233,6 @@
}
}
}
- else
- {
- if (searcher.GetDepth () == Searcher::eDepthModule)
- {
- SymbolContext matchingContext(context.module_sp.get());
-
- shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
- }
- else
- {
- return DoCUIteration(context.module_sp, context, searcher);
- }
- }
-
}
return Searcher::eCallbackReturnContinue;
}
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Section.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Section.cpp Thu Jul 19 11:39:59 2012
@@ -184,6 +184,11 @@
{
so_addr.SetOffset(offset);
so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
+
+#ifdef LLDB_CONFIGURATION_DEBUG
+ // For debug builds, ensure that there are no orphaned (i.e., moduleless) sections.
+ assert(GetModule().get());
+#endif
}
return true;
}
Modified: lldb/branches/apple/python-GIL/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/UserSettingsController.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/UserSettingsController.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/UserSettingsController.cpp Thu Jul 19 11:39:59 2012
@@ -173,16 +173,13 @@
// Verify child is not already in m_children.
size_t num_children = m_children.size();
- bool found = false;
for (size_t i = 0; i < num_children; ++i)
- {
- if (m_children[i].get() == child.get())
- found = true;
- }
-
+ {
+ if (m_children[i].get() == child.get())
+ return;
+ }
// Add child to m_children.
- if (! found)
- m_children.push_back (child);
+ m_children.push_back (child);
}
const ConstString &
@@ -494,14 +491,12 @@
UserSettingsControllerSP child;
ConstString child_prefix (names.GetArgumentAtIndex (0));
int num_children = GetNumChildren();
- bool found = false;
- for (int i = 0; i < num_children && !found; ++i)
+ for (int i = 0; i < num_children; ++i)
{
child = GetChildAtIndex (i);
ConstString current_prefix = child->GetLevelName();
if (current_prefix == child_prefix)
{
- found = true;
std::string new_name;
for (int j = 0; j < names.GetArgumentCount(); ++j)
{
@@ -513,12 +508,9 @@
index_value);
}
}
- if (!found)
- {
- err.SetErrorStringWithFormat ("unable to find variable '%s', cannot assign value",
- full_dot_name);
- return err;
- }
+ err.SetErrorStringWithFormat ("unable to find variable '%s', cannot assign value",
+ full_dot_name);
+ return err;
}
}
}
@@ -576,12 +568,10 @@
if (names.GetArgumentCount() > 1)
{
ConstString child_prefix (names.GetArgumentAtIndex (0));
- bool found = false;
- for (int i = 0; i < m_children.size() && !found; ++i)
+ for (int i = 0; i < m_children.size(); ++i)
{
if (child_prefix == m_children[i]->GetLevelName())
{
- found = true;
child = m_children[i];
std::string new_name;
for (int j = 0; j < names.GetArgumentCount(); ++j)
@@ -594,60 +584,57 @@
}
}
- if (!found)
+ // Cannot be handled by a child, because name did not match any child prefixes.
+ // Cannot be a class-wide variable because there are too many name pieces.
+
+ if (instance_entry != NULL)
{
- // Cannot be handled by a child, because name did not match any child prefixes.
- // Cannot be a class-wide variable because there are too many name pieces.
+ var_type = instance_entry->var_type;
+ ConstString instance_name (names.GetArgumentAtIndex (0));
+ InstanceSettings *current_settings = FindSettingsForInstance (instance_name);
- if (instance_entry != NULL)
+ if (current_settings != NULL)
{
- var_type = instance_entry->var_type;
- ConstString instance_name (names.GetArgumentAtIndex (0));
- InstanceSettings *current_settings = FindSettingsForInstance (instance_name);
+ current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
+ }
+ else
+ {
+ // Look for instance name setting in pending settings.
- if (current_settings != NULL)
+ std::string inst_name_str = instance_name.GetCString();
+ std::map<std::string, InstanceSettingsSP>::iterator pos;
+
+ pos = m_pending_settings.find (inst_name_str);
+ if (pos != m_pending_settings.end())
{
- current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
+ InstanceSettingsSP settings_sp = pos->second;
+ settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
- else
+ else
{
- // Look for instance name setting in pending settings.
-
- std::string inst_name_str = instance_name.GetCString();
- std::map<std::string, InstanceSettingsSP>::iterator pos;
-
- pos = m_pending_settings.find (inst_name_str);
- if (pos != m_pending_settings.end())
+ if (m_settings.level_name.GetLength() > 0)
{
- InstanceSettingsSP settings_sp = pos->second;
- settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
+ // No valid instance name; assume they want the default settings.
+ m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
- else
+ else
{
- if (m_settings.level_name.GetLength() > 0)
- {
- // No valid instance name; assume they want the default settings.
- m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
- }
+ // We're at the Debugger level; use the debugger's instance settings.
+ StreamString tmp_name;
+ if (debugger_instance_name[0] != '[')
+ tmp_name.Printf ("[%s]", debugger_instance_name);
else
- {
- // We're at the Debugger level; use the debugger's instance settings.
- StreamString tmp_name;
- if (debugger_instance_name[0] != '[')
- tmp_name.Printf ("[%s]", debugger_instance_name);
- else
- tmp_name.Printf ("%s", debugger_instance_name);
- ConstString dbg_name (debugger_instance_name);
- InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
- if (dbg_settings)
- dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
- }
+ tmp_name.Printf ("%s", debugger_instance_name);
+ ConstString dbg_name (debugger_instance_name);
+ InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
+ if (dbg_settings)
+ dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
}
}
- else
- err.SetErrorString ("invalid variable name");
}
+ else
+ err.SetErrorString ("invalid variable name");
}
else
{
@@ -1194,14 +1181,11 @@
else if (num_pieces == 1)
{
ConstString var_name (names.GetArgumentAtIndex (0));
- bool is_global = false;
const SettingEntry *setting_entry = usc_sp->GetGlobalEntry (var_name);
if (setting_entry == NULL)
setting_entry = usc_sp->GetInstanceEntry (var_name);
- else
- is_global = true;
// Check to see if it is a global or instance variable name.
if (setting_entry != NULL)
@@ -1773,21 +1757,18 @@
else
{
// 'next_name' must be a child name. Find the correct child and pass the remaining piece to be resolved.
- bool found = false;
int num_children = my_usc_sp->GetNumChildren();
ConstString child_level (next_name.c_str());
for (int i = 0; i < num_children; ++i)
{
if (my_usc_sp->GetChildAtIndex (i)->GetLevelName() == child_level)
{
- found = true;
return UserSettingsController::CompleteSettingsNames (my_usc_sp->GetChildAtIndex (i),
partial_setting_name_pieces,
word_complete, matches);
}
}
- if (!found)
- return 0;
+ return 0;
}
}
else if (num_name_pieces == 1)
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp Thu Jul 19 11:39:59 2012
@@ -2344,8 +2344,10 @@
ValueObjectSP final_value = ret_val->Dereference(error);
if (error.Fail() || !final_value.get())
{
- *reason_to_stop = ValueObject::eExpressionPathScanEndReasonDereferencingFailed;
- *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
+ if (reason_to_stop)
+ *reason_to_stop = ValueObject::eExpressionPathScanEndReasonDereferencingFailed;
+ if (final_value_type)
+ *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
return 0;
}
else
@@ -2361,8 +2363,10 @@
ValueObjectSP final_value = ret_val->AddressOf(error);
if (error.Fail() || !final_value.get())
{
- *reason_to_stop = ValueObject::eExpressionPathScanEndReasonTakingAddressFailed;
- *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
+ if (reason_to_stop)
+ *reason_to_stop = ValueObject::eExpressionPathScanEndReasonTakingAddressFailed;
+ if (final_value_type)
+ *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
return 0;
}
else
@@ -3770,9 +3774,9 @@
if (current_mod_id.GetStopID() == 0)
return false;
- bool changed;
-
- if (m_mod_id.IsValid())
+ bool changed = false;
+ const bool was_valid = m_mod_id.IsValid();
+ if (was_valid)
{
if (m_mod_id == current_mod_id)
{
@@ -3804,6 +3808,7 @@
{
// We used to have a frame, but now it is gone
SetInvalid();
+ changed = was_valid;
}
}
}
@@ -3811,6 +3816,7 @@
{
// We used to have a thread, but now it is gone
SetInvalid();
+ changed = was_valid;
}
}
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp Thu Jul 19 11:39:59 2012
@@ -2443,12 +2443,13 @@
if (!sym_ctx.function)
return;
- clang::DeclContext *decl_context;
-
- if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
- decl_context = sym_ctx.block->GetClangDeclContextForInlinedFunction();
- else
- decl_context = sym_ctx.function->GetClangDeclContext();
+ // Get the block that defines the function
+ Block *function_block = sym_ctx.GetFunctionBlock();
+
+ if (!function_block)
+ return;
+
+ clang::DeclContext *decl_context = function_block->GetClangDeclContext();
if (!decl_context)
return;
@@ -2501,12 +2502,13 @@
if (!sym_ctx.function)
return;
- clang::DeclContext *decl_context;
+ // Get the block that defines the function
+ Block *function_block = sym_ctx.GetFunctionBlock();
- if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
- decl_context = sym_ctx.block->GetClangDeclContextForInlinedFunction();
- else
- decl_context = sym_ctx.function->GetClangDeclContext();
+ if (!function_block)
+ return;
+
+ clang::DeclContext *decl_context = function_block->GetClangDeclContext();
if (!decl_context)
return;
Modified: lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp Thu Jul 19 11:39:59 2012
@@ -110,18 +110,19 @@
if (frame == NULL)
return;
- SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction);
+ SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction | lldb::eSymbolContextBlock);
if (!sym_ctx.function)
return;
- clang::DeclContext *decl_context;
+ // Find the block that defines the function represented by "sym_ctx"
+ Block *function_block = sym_ctx.GetFunctionBlock();
- if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
- decl_context = sym_ctx.block->GetClangDeclContextForInlinedFunction();
- else
- decl_context = sym_ctx.function->GetClangDeclContext();
-
+ if (!function_block)
+ return;
+
+ clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+
if (!decl_context)
return;
@@ -131,24 +132,22 @@
{
if (m_enforce_valid_object)
{
- VariableList *vars = frame->GetVariableList(false);
+ lldb::VariableListSP variable_list_sp (function_block->GetBlockVariableList (true));
const char *thisErrorString = "Stopped in a C++ method, but 'this' isn't available; pretending we are in a generic context";
- if (!vars)
+ if (!variable_list_sp)
{
- err.SetErrorToGenericError();
err.SetErrorString(thisErrorString);
return;
}
- lldb::VariableSP this_var = vars->FindVariable(ConstString("this"));
+ lldb::VariableSP this_var_sp (variable_list_sp->FindVariable(ConstString("this")));
- if (!this_var ||
- !this_var->IsInScope(frame) ||
- !this_var->LocationIsValidForFrame (frame))
+ if (!this_var_sp ||
+ !this_var_sp->IsInScope(frame) ||
+ !this_var_sp->LocationIsValidForFrame (frame))
{
- err.SetErrorToGenericError();
err.SetErrorString(thisErrorString);
return;
}
@@ -164,24 +163,22 @@
{
if (m_enforce_valid_object)
{
- VariableList *vars = frame->GetVariableList(false);
+ lldb::VariableListSP variable_list_sp (function_block->GetBlockVariableList (true));
const char *selfErrorString = "Stopped in an Objective-C method, but 'self' isn't available; pretending we are in a generic context";
- if (!vars)
+ if (!variable_list_sp)
{
- err.SetErrorToGenericError();
err.SetErrorString(selfErrorString);
return;
}
- lldb::VariableSP self_var = vars->FindVariable(ConstString("self"));
+ lldb::VariableSP self_variable_sp = variable_list_sp->FindVariable(ConstString("self"));
- if (!self_var ||
- !self_var->IsInScope(frame) ||
- !self_var->LocationIsValidForFrame (frame))
+ if (!self_variable_sp ||
+ !self_variable_sp->IsInScope(frame) ||
+ !self_variable_sp->LocationIsValidForFrame (frame))
{
- err.SetErrorToGenericError();
err.SetErrorString(selfErrorString);
return;
}
@@ -545,7 +542,8 @@
ExecutionContext &exe_ctx,
bool discard_on_error,
ClangUserExpression::ClangUserExpressionSP &shared_ptr_to_me,
- lldb::ClangExpressionVariableSP &result)
+ lldb::ClangExpressionVariableSP &result,
+ uint32_t single_thread_timeout_usec)
{
// The expression log is quite verbose, and if you're just tracking the execution of the
// expression, it's quite convenient to have these logs come out with the STEP log as well.
@@ -581,8 +579,6 @@
call_plan_sp->SetPrivate(true);
- uint32_t single_thread_timeout_usec = 500000;
-
if (log)
log->Printf("-- [ClangUserExpression::Execute] Execution of expression begins --");
@@ -651,10 +647,11 @@
bool discard_on_error,
const char *expr_cstr,
const char *expr_prefix,
- lldb::ValueObjectSP &result_valobj_sp)
+ lldb::ValueObjectSP &result_valobj_sp,
+ uint32_t single_thread_timeout_usec)
{
Error error;
- return EvaluateWithError (exe_ctx, execution_policy, language, desired_type, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error);
+ return EvaluateWithError (exe_ctx, execution_policy, language, desired_type, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error, single_thread_timeout_usec);
}
ExecutionResults
@@ -666,7 +663,8 @@
const char *expr_cstr,
const char *expr_prefix,
lldb::ValueObjectSP &result_valobj_sp,
- Error &error)
+ Error &error,
+ uint32_t single_thread_timeout_usec)
{
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
@@ -741,7 +739,8 @@
exe_ctx,
discard_on_error,
user_expression_sp,
- expr_result);
+ expr_result,
+ single_thread_timeout_usec);
if (execution_results != eExecutionCompleted)
{
Modified: lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/IRDynamicChecks.cpp Thu Jul 19 11:39:59 2012
@@ -461,11 +461,16 @@
case eMsgSend_stret:
target_object = call_inst->getArgOperand(1);
selector = call_inst->getArgOperand(2);
+ break;
case eMsgSendSuper:
case eMsgSendSuper_stret:
return true;
}
-
+
+ // These objects should always be valid according to Sean Calannan
+ assert (target_object);
+ assert (selector);
+
// Insert an instruction to cast the receiver id to int8_t*
BitCastInst *bit_cast = new BitCastInst(target_object,
Modified: lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp Thu Jul 19 11:39:59 2012
@@ -634,7 +634,7 @@
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
lldb_private::Value resolved_value;
- lldb_private::ClangExpressionVariable::FlagType flags;
+ lldb_private::ClangExpressionVariable::FlagType flags = 0;
if (global_value)
{
Modified: lldb/branches/apple/python-GIL/source/Host/common/Terminal.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/common/Terminal.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/common/Terminal.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Host/common/Terminal.cpp Thu Jul 19 11:39:59 2012
@@ -161,16 +161,15 @@
bool
TerminalState::Restore () const
{
- int result = 0;
if (IsValid())
{
const int fd = m_tty.GetFileDescriptor();
if (TFlagsIsValid())
- result = fcntl (fd, F_SETFL, m_tflags);
+ fcntl (fd, F_SETFL, m_tflags);
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
if (TTYStateIsValid())
- result = tcsetattr (fd, TCSANOW, m_termios_ap.get());
+ tcsetattr (fd, TCSANOW, m_termios_ap.get());
#endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
if (ProcessGroupIsValid())
@@ -179,7 +178,7 @@
void (*saved_sigttou_callback) (int) = NULL;
saved_sigttou_callback = (void (*)(int)) signal (SIGTTOU, SIG_IGN);
// Set the process group
- result = tcsetpgrp (fd, m_process_group);
+ tcsetpgrp (fd, m_process_group);
// Restore the original signal handler.
signal (SIGTTOU, saved_sigttou_callback);
}
Modified: lldb/branches/apple/python-GIL/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/Host.mm?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/Host.mm (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/Host.mm Thu Jul 19 11:39:59 2012
@@ -60,12 +60,11 @@
#include <objc/objc-auto.h>
-#if defined(__arm__)
-#include <UIKit/UIKit.h>
-#else
-#include <ApplicationServices/ApplicationServices.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <Foundation/Foundation.h>
+
+#if !defined(__arm__)
#include <Carbon/Carbon.h>
-#include <Security/Security.h>
#endif
#ifndef _POSIX_SPAWN_DISABLE_ASLR
@@ -115,7 +114,7 @@
{
if (m_pool)
{
- [m_pool release];
+ [m_pool drain];
m_pool = nil;
}
}
@@ -233,6 +232,8 @@
::pid_t pid = LLDB_INVALID_PROCESS_ID;
error = ::GetProcessPID(&psn, &pid);
+ if (error != noErr)
+ return LLDB_INVALID_PROCESS_ID;
return pid;
#endif
}
@@ -293,164 +294,164 @@
}
#if !defined(__arm__)
-static lldb::pid_t
-LaunchInNewTerminalWithCommandFile
-(
- const char **argv,
- const char **envp,
- const char *working_dir,
- const ArchSpec *arch_spec,
- bool stop_at_entry,
- bool disable_aslr
-)
-{
- if (!argv || !argv[0])
- return LLDB_INVALID_PROCESS_ID;
-
- OSStatus error = 0;
-
- FileSpec program (argv[0], false);
-
-
- std::string unix_socket_name;
-
- char temp_file_path[PATH_MAX];
- const char *tmpdir = ::getenv ("TMPDIR");
- if (tmpdir == NULL)
- tmpdir = "/tmp/";
- ::snprintf (temp_file_path, sizeof(temp_file_path), "%s%s-XXXXXX", tmpdir, program.GetFilename().AsCString());
-
- if (::mktemp (temp_file_path) == NULL)
- return LLDB_INVALID_PROCESS_ID;
-
- unix_socket_name.assign (temp_file_path);
-
- ::strlcat (temp_file_path, ".command", sizeof (temp_file_path));
-
- StreamFile command_file;
- command_file.GetFile().Open (temp_file_path,
- File::eOpenOptionWrite | File::eOpenOptionCanCreate,
- File::ePermissionsDefault);
-
- if (!command_file.GetFile().IsValid())
- return LLDB_INVALID_PROCESS_ID;
-
- FileSpec darwin_debug_file_spec;
- if (!Host::GetLLDBPath (ePathTypeSupportExecutableDir, darwin_debug_file_spec))
- return LLDB_INVALID_PROCESS_ID;
- darwin_debug_file_spec.GetFilename().SetCString("darwin-debug");
-
- if (!darwin_debug_file_spec.Exists())
- return LLDB_INVALID_PROCESS_ID;
-
- char launcher_path[PATH_MAX];
- darwin_debug_file_spec.GetPath(launcher_path, sizeof(launcher_path));
- command_file.Printf("\"%s\" ", launcher_path);
-
- command_file.Printf("--unix-socket=%s ", unix_socket_name.c_str());
-
- if (arch_spec && arch_spec->IsValid())
- {
- command_file.Printf("--arch=%s ", arch_spec->GetArchitectureName());
- }
-
- if (disable_aslr)
- {
- command_file.PutCString("--disable-aslr ");
- }
-
- command_file.PutCString("-- ");
-
- if (argv)
- {
- for (size_t i=0; argv[i] != NULL; ++i)
- {
- command_file.Printf("\"%s\" ", argv[i]);
- }
- }
- command_file.PutCString("\necho Process exited with status $?\n");
- command_file.GetFile().Close();
- if (::chmod (temp_file_path, S_IRWXU | S_IRWXG) != 0)
- return LLDB_INVALID_PROCESS_ID;
-
- CFCMutableDictionary cf_env_dict;
-
- const bool can_create = true;
- if (envp)
- {
- for (size_t i=0; envp[i] != NULL; ++i)
- {
- const char *env_entry = envp[i];
- const char *equal_pos = strchr(env_entry, '=');
- if (equal_pos)
- {
- std::string env_key (env_entry, equal_pos);
- std::string env_val (equal_pos + 1);
- CFCString cf_env_key (env_key.c_str(), kCFStringEncodingUTF8);
- CFCString cf_env_val (env_val.c_str(), kCFStringEncodingUTF8);
- cf_env_dict.AddValue (cf_env_key.get(), cf_env_val.get(), can_create);
- }
- }
- }
-
- LSApplicationParameters app_params;
- ::memset (&app_params, 0, sizeof (app_params));
- app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
- app_params.argv = NULL;
- app_params.environment = (CFDictionaryRef)cf_env_dict.get();
-
- CFCReleaser<CFURLRef> command_file_url (::CFURLCreateFromFileSystemRepresentation (NULL,
- (const UInt8 *)temp_file_path,
- strlen(temp_file_path),
- false));
-
- CFCMutableArray urls;
-
- // Terminal.app will open the ".command" file we have created
- // and run our process inside it which will wait at the entry point
- // for us to attach.
- urls.AppendValue(command_file_url.get());
-
-
- lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
-
- Error lldb_error;
- // Sleep and wait a bit for debugserver to start to listen...
- char connect_url[128];
- ::snprintf (connect_url, sizeof(connect_url), "unix-accept://%s", unix_socket_name.c_str());
-
- // Spawn a new thread to accept incoming connection on the connect_url
- // so we can grab the pid from the inferior
- lldb::thread_t accept_thread = Host::ThreadCreate (unix_socket_name.c_str(),
- AcceptPIDFromInferior,
- connect_url,
- &lldb_error);
-
- ProcessSerialNumber psn;
- error = LSOpenURLsWithRole(urls.get(), kLSRolesShell, NULL, &app_params, &psn, 1);
- if (error == noErr)
- {
- thread_result_t accept_thread_result = NULL;
- if (Host::ThreadJoin (accept_thread, &accept_thread_result, &lldb_error))
- {
- if (accept_thread_result)
- {
- pid = (intptr_t)accept_thread_result;
-
- // Wait for process to be stopped the the entry point by watching
- // for the process status to be set to SSTOP which indicates it it
- // SIGSTOP'ed at the entry point
- WaitForProcessToSIGSTOP (pid, 5);
- }
- }
- }
- else
- {
- Host::ThreadCancel (accept_thread, &lldb_error);
- }
-
- return pid;
-}
+//static lldb::pid_t
+//LaunchInNewTerminalWithCommandFile
+//(
+// const char **argv,
+// const char **envp,
+// const char *working_dir,
+// const ArchSpec *arch_spec,
+// bool stop_at_entry,
+// bool disable_aslr
+//)
+//{
+// if (!argv || !argv[0])
+// return LLDB_INVALID_PROCESS_ID;
+//
+// OSStatus error = 0;
+//
+// FileSpec program (argv[0], false);
+//
+//
+// std::string unix_socket_name;
+//
+// char temp_file_path[PATH_MAX];
+// const char *tmpdir = ::getenv ("TMPDIR");
+// if (tmpdir == NULL)
+// tmpdir = "/tmp/";
+// ::snprintf (temp_file_path, sizeof(temp_file_path), "%s%s-XXXXXX", tmpdir, program.GetFilename().AsCString());
+//
+// if (::mktemp (temp_file_path) == NULL)
+// return LLDB_INVALID_PROCESS_ID;
+//
+// unix_socket_name.assign (temp_file_path);
+//
+// ::strlcat (temp_file_path, ".command", sizeof (temp_file_path));
+//
+// StreamFile command_file;
+// command_file.GetFile().Open (temp_file_path,
+// File::eOpenOptionWrite | File::eOpenOptionCanCreate,
+// File::ePermissionsDefault);
+//
+// if (!command_file.GetFile().IsValid())
+// return LLDB_INVALID_PROCESS_ID;
+//
+// FileSpec darwin_debug_file_spec;
+// if (!Host::GetLLDBPath (ePathTypeSupportExecutableDir, darwin_debug_file_spec))
+// return LLDB_INVALID_PROCESS_ID;
+// darwin_debug_file_spec.GetFilename().SetCString("darwin-debug");
+//
+// if (!darwin_debug_file_spec.Exists())
+// return LLDB_INVALID_PROCESS_ID;
+//
+// char launcher_path[PATH_MAX];
+// darwin_debug_file_spec.GetPath(launcher_path, sizeof(launcher_path));
+// command_file.Printf("\"%s\" ", launcher_path);
+//
+// command_file.Printf("--unix-socket=%s ", unix_socket_name.c_str());
+//
+// if (arch_spec && arch_spec->IsValid())
+// {
+// command_file.Printf("--arch=%s ", arch_spec->GetArchitectureName());
+// }
+//
+// if (disable_aslr)
+// {
+// command_file.PutCString("--disable-aslr ");
+// }
+//
+// command_file.PutCString("-- ");
+//
+// if (argv)
+// {
+// for (size_t i=0; argv[i] != NULL; ++i)
+// {
+// command_file.Printf("\"%s\" ", argv[i]);
+// }
+// }
+// command_file.PutCString("\necho Process exited with status $?\n");
+// command_file.GetFile().Close();
+// if (::chmod (temp_file_path, S_IRWXU | S_IRWXG) != 0)
+// return LLDB_INVALID_PROCESS_ID;
+//
+// CFCMutableDictionary cf_env_dict;
+//
+// const bool can_create = true;
+// if (envp)
+// {
+// for (size_t i=0; envp[i] != NULL; ++i)
+// {
+// const char *env_entry = envp[i];
+// const char *equal_pos = strchr(env_entry, '=');
+// if (equal_pos)
+// {
+// std::string env_key (env_entry, equal_pos);
+// std::string env_val (equal_pos + 1);
+// CFCString cf_env_key (env_key.c_str(), kCFStringEncodingUTF8);
+// CFCString cf_env_val (env_val.c_str(), kCFStringEncodingUTF8);
+// cf_env_dict.AddValue (cf_env_key.get(), cf_env_val.get(), can_create);
+// }
+// }
+// }
+//
+// LSApplicationParameters app_params;
+// ::memset (&app_params, 0, sizeof (app_params));
+// app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
+// app_params.argv = NULL;
+// app_params.environment = (CFDictionaryRef)cf_env_dict.get();
+//
+// CFCReleaser<CFURLRef> command_file_url (::CFURLCreateFromFileSystemRepresentation (NULL,
+// (const UInt8 *)temp_file_path,
+// strlen(temp_file_path),
+// false));
+//
+// CFCMutableArray urls;
+//
+// // Terminal.app will open the ".command" file we have created
+// // and run our process inside it which will wait at the entry point
+// // for us to attach.
+// urls.AppendValue(command_file_url.get());
+//
+//
+// lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
+//
+// Error lldb_error;
+// // Sleep and wait a bit for debugserver to start to listen...
+// char connect_url[128];
+// ::snprintf (connect_url, sizeof(connect_url), "unix-accept://%s", unix_socket_name.c_str());
+//
+// // Spawn a new thread to accept incoming connection on the connect_url
+// // so we can grab the pid from the inferior
+// lldb::thread_t accept_thread = Host::ThreadCreate (unix_socket_name.c_str(),
+// AcceptPIDFromInferior,
+// connect_url,
+// &lldb_error);
+//
+// ProcessSerialNumber psn;
+// error = LSOpenURLsWithRole(urls.get(), kLSRolesShell, NULL, &app_params, &psn, 1);
+// if (error == noErr)
+// {
+// thread_result_t accept_thread_result = NULL;
+// if (Host::ThreadJoin (accept_thread, &accept_thread_result, &lldb_error))
+// {
+// if (accept_thread_result)
+// {
+// pid = (intptr_t)accept_thread_result;
+//
+// // Wait for process to be stopped the the entry point by watching
+// // for the process status to be set to SSTOP which indicates it it
+// // SIGSTOP'ed at the entry point
+// WaitForProcessToSIGSTOP (pid, 5);
+// }
+// }
+// }
+// else
+// {
+// Host::ThreadCancel (accept_thread, &lldb_error);
+// }
+//
+// return pid;
+//}
const char *applscript_in_new_tty =
"tell application \"Terminal\"\n"
@@ -931,6 +932,9 @@
return false;
}
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
bool
Host::GetOSVersion
(
@@ -939,51 +943,61 @@
uint32_t &update
)
{
-
-#if defined (__arm__)
- major = UINT32_MAX;
- minor = UINT32_MAX;
- update = UINT32_MAX;
-
- NSString *system_version_nstr = [[UIDevice currentDevice] systemVersion];
- if (system_version_nstr)
- {
- const char *system_version_cstr = system_version_nstr.UTF8String;
- Args::StringToVersion(system_version_cstr, major, minor, update);
+ static const char *version_plist_file = "/System/Library/CoreServices/SystemVersion.plist";
+ char buffer[256];
+ const char *product_version_str = NULL;
+
+ CFCReleaser<CFURLRef> plist_url(CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+ (UInt8 *) version_plist_file,
+ strlen (version_plist_file), NO));
+ if (plist_url.get())
+ {
+ CFCReleaser<CFPropertyListRef> property_list;
+ CFCReleaser<CFStringRef> error_string;
+ CFCReleaser<CFDataRef> resource_data;
+ SInt32 error_code;
+
+ // Read the XML file.
+ if (CFURLCreateDataAndPropertiesFromResource (kCFAllocatorDefault,
+ plist_url.get(),
+ resource_data.ptr_address(),
+ NULL,
+ NULL,
+ &error_code))
+ {
+ // Reconstitute the dictionary using the XML data.
+ property_list = CFPropertyListCreateFromXMLData (kCFAllocatorDefault,
+ resource_data.get(),
+ kCFPropertyListImmutable,
+ error_string.ptr_address());
+ if (CFGetTypeID(property_list.get()) == CFDictionaryGetTypeID())
+ {
+ CFDictionaryRef property_dict = (CFDictionaryRef) property_list.get();
+ CFStringRef product_version_key = CFSTR("ProductVersion");
+ CFPropertyListRef product_version_value;
+ product_version_value = CFDictionaryGetValue(property_dict, product_version_key);
+ if (product_version_value && CFGetTypeID(product_version_value) == CFStringGetTypeID())
+ {
+ CFStringRef product_version_cfstr = (CFStringRef) product_version_value;
+ product_version_str = CFStringGetCStringPtr(product_version_cfstr, kCFStringEncodingUTF8);
+ if (product_version_str == NULL) {
+ if (CFStringGetCString(product_version_cfstr, buffer, 256, kCFStringEncodingUTF8))
+ product_version_str = buffer;
+ }
+ }
+ }
+ }
}
- return major != UINT32_MAX;
-#else
- SInt32 version;
- OSErr err = ::Gestalt (gestaltSystemVersion, &version);
- if (err != noErr)
- return false;
- if (version < 0x1040)
+ if (product_version_str)
{
- major = ((version & 0xF000) >> 12) * 10 + ((version & 0x0F00) >> 8);
- minor = (version & 0x00F0) >> 4;
- update = (version & 0x000F);
+ Args::StringToVersion(product_version_str, major, minor, update);
+ return true;
}
else
- {
- if (::Gestalt (gestaltSystemVersionMajor, &version) != noErr)
- return false;
- major = version;
-
- if (::Gestalt (gestaltSystemVersionMinor, &version) == noErr)
- minor = version;
- else
- minor = 0;
+ return false;
- if (::Gestalt (gestaltSystemVersionBugFix, &version) == noErr)
- update = version;
- else
- update = 0;
- }
-
- return true;
-#endif
}
static bool
@@ -1056,7 +1070,6 @@
{
DataExtractor data (arg_data, arg_data_size, lldb::endian::InlHostByteOrder(), sizeof(void *));
uint32_t offset = 0;
- uint32_t start_offset;
uint32_t argc = data.GetU32 (&offset);
const char *cstr;
@@ -1082,7 +1095,6 @@
Args &proc_args = process_info.GetArguments();
for (int i=0; i<argc; ++i)
{
- start_offset = offset;
cstr = data.GetCStr(&offset);
if (cstr)
proc_args.AppendArgument(cstr);
@@ -1457,6 +1469,9 @@
}
return error;
+#else
+ Error error;
+ return error;
#endif
}
@@ -1532,7 +1547,16 @@
if (working_dir)
{
// No more thread specific current working directory
- __pthread_chdir (working_dir);
+ if (__pthread_chdir (working_dir) < 0) {
+ if (errno == ENOENT) {
+ error.SetErrorStringWithFormat("No such file or directory: %s", working_dir);
+ } else if (errno == ENOTDIR) {
+ error.SetErrorStringWithFormat("Path doesn't name a directory: %s", working_dir);
+ } else {
+ error.SetErrorStringWithFormat("An unknown error occurred when changing directory for process execution.");
+ }
+ return error;
+ }
}
const size_t num_file_actions = launch_info.GetNumFileActions ();
@@ -1802,7 +1826,7 @@
if (callback)
cancel = callback (callback_baton, pid, exited, signal, exit_status);
- if (exited)
+ if (exited || cancel)
{
::dispatch_source_cancel(source);
}
Modified: lldb/branches/apple/python-GIL/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Host/macosx/Symbols.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Host/macosx/Symbols.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Host/macosx/Symbols.cpp Thu Jul 19 11:39:59 2012
@@ -388,6 +388,11 @@
char build_src_path[PATH_MAX];
::CFStringGetFileSystemRepresentation (actual_src_cfpath, actual_src_path, sizeof(actual_src_path));
::CFStringGetFileSystemRepresentation (build_src_cfpath, build_src_path, sizeof(build_src_path));
+ if (actual_src_path[0] == '~')
+ {
+ FileSpec resolved_source_path(actual_src_path, true);
+ resolved_source_path.GetPath(actual_src_path, sizeof(actual_src_path));
+ }
module_spec.GetSourceMappingList().Append (ConstString(build_src_path), ConstString(actual_src_path), true);
}
}
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>161</string>
+ <string>162</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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -25,7 +25,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>161</string>
+ <string>162</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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp Thu Jul 19 11:39:59 2012
@@ -1143,7 +1143,8 @@
{
std::string expr_str (command, expr_content_start, end_backtick - expr_content_start);
- Target *target = m_exe_ctx.GetTargetPtr();
+ ExecutionContext exe_ctx(GetExecutionContext());
+ Target *target = exe_ctx.GetTargetPtr();
// Get a dummy target to allow for calculator mode while processing backticks.
// This also helps break the infinite loop caused when target is null.
if (!target)
@@ -1155,13 +1156,14 @@
const bool keep_in_memory = false;
ValueObjectSP expr_result_valobj_sp;
ExecutionResults expr_result = target->EvaluateExpression (expr_str.c_str(),
- m_exe_ctx.GetFramePtr(),
+ exe_ctx.GetFramePtr(),
eExecutionPolicyOnlyWhenNeeded,
coerce_to_id,
unwind_on_error,
keep_in_memory,
eNoDynamicValues,
- expr_result_valobj_sp);
+ expr_result_valobj_sp,
+ 0 /* no timeout */);
if (expr_result == eExecutionCompleted)
{
Scalar scalar;
@@ -2228,7 +2230,8 @@
PlatformSP platform_sp;
if (prefer_target_platform)
{
- Target *target = m_exe_ctx.GetTargetPtr();
+ ExecutionContext exe_ctx(GetExecutionContext());
+ Target *target = exe_ctx.GetTargetPtr();
if (target)
platform_sp = target->GetPlatform();
}
@@ -2534,7 +2537,6 @@
text_strm.Printf ("%-*s %s %s", max_word_len, word_text, separator, help_text);
const uint32_t max_columns = m_debugger.GetTerminalWidth();
- bool first_line = true;
size_t len = text_strm.GetSize();
const char *text = text_strm.GetData();
@@ -2545,7 +2547,6 @@
{
if ((text[i] == ' ' && ::strchr((text+i+1), ' ') && chars_left < ::strchr((text+i+1), ' ')-(text+i)) || text[i] == '\n')
{
- first_line = false;
chars_left = max_columns - indent_size;
strm.EOL();
strm.Indent();
@@ -2618,39 +2619,14 @@
void
CommandInterpreter::UpdateExecutionContext (ExecutionContext *override_context)
{
- m_exe_ctx.Clear();
-
if (override_context != NULL)
{
- m_exe_ctx = *override_context;
+ m_exe_ctx_ref = *override_context;
}
else
{
- TargetSP target_sp (m_debugger.GetSelectedTarget());
- if (target_sp)
- {
- m_exe_ctx.SetTargetSP (target_sp);
- ProcessSP process_sp (target_sp->GetProcessSP());
- m_exe_ctx.SetProcessSP (process_sp);
- if (process_sp && process_sp->IsAlive() && !process_sp->IsRunning())
- {
- ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread());
- if (thread_sp)
- {
- m_exe_ctx.SetThreadSP (thread_sp);
- StackFrameSP frame_sp (thread_sp->GetSelectedFrame());
- if (!frame_sp)
- {
- frame_sp = thread_sp->GetStackFrameAtIndex (0);
- // If we didn't have a selected frame select one here.
- if (frame_sp)
- thread_sp->SetSelectedFrame(frame_sp.get());
- }
- if (frame_sp)
- m_exe_ctx.SetFrameSP (frame_sp);
- }
- }
- }
+ const bool adopt_selected = true;
+ m_exe_ctx_ref.SetTargetPtr (m_debugger.GetSelectedTarget().get(), adopt_selected);
}
}
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -536,13 +536,13 @@
pc_reg_num == LLDB_INVALID_REGNUM)
return false;
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
// Our Call Frame Address is the stack pointer value
- row.SetCFARegister (sp_reg_num);
+ row->SetCFARegister (sp_reg_num);
// The previous PC is in the LR
- row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
+ row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
unwind_plan.AppendRow (row);
// All other registers are the same.
@@ -557,17 +557,17 @@
uint32_t fp_reg_num = dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11;
uint32_t pc_reg_num = dwarf_pc;
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
const int32_t ptr_size = 4;
unwind_plan.Clear ();
unwind_plan.SetRegisterKind (eRegisterKindDWARF);
- row.SetCFARegister (fp_reg_num);
- row.SetCFAOffset (2 * ptr_size);
- row.SetOffset (0);
+ row->SetCFARegister (fp_reg_num);
+ row->SetCFAOffset (2 * ptr_size);
+ row->SetOffset (0);
- row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
- row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
unwind_plan.AppendRow (row);
unwind_plan.SetSourceName ("arm-apple-ios default unwind plan");
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -808,10 +808,10 @@
pc_reg_num == LLDB_INVALID_REGNUM)
return false;
- UnwindPlan::Row row;
- row.SetCFARegister (sp_reg_num);
- row.SetCFAOffset (4);
- row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
+ row->SetCFARegister (sp_reg_num);
+ row->SetCFAOffset (4);
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);
unwind_plan.AppendRow (row);
unwind_plan.SetSourceName ("i386 at-func-entry default");
return true;
@@ -824,18 +824,18 @@
uint32_t sp_reg_num = dwarf_esp;
uint32_t pc_reg_num = dwarf_eip;
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
const int32_t ptr_size = 4;
unwind_plan.Clear ();
unwind_plan.SetRegisterKind (eRegisterKindDWARF);
- row.SetCFARegister (fp_reg_num);
- row.SetCFAOffset (2 * ptr_size);
- row.SetOffset (0);
+ row->SetCFARegister (fp_reg_num);
+ row->SetCFAOffset (2 * ptr_size);
+ row->SetOffset (0);
- row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
- row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
- row.SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size * 0, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size * 0, true);
unwind_plan.AppendRow (row);
unwind_plan.SetSourceName ("i386 default unwind plan");
Modified: lldb/branches/apple/python-GIL/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Thu Jul 19 11:39:59 2012
@@ -985,10 +985,10 @@
pc_reg_num == LLDB_INVALID_REGNUM)
return false;
- UnwindPlan::Row row;
- row.SetCFARegister (sp_reg_num);
- row.SetCFAOffset (8);
- row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
+ row->SetCFARegister (sp_reg_num);
+ row->SetCFAOffset (8);
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);
unwind_plan.AppendRow (row);
unwind_plan.SetSourceName ("x86_64 at-func-entry default");
return true;
@@ -1029,16 +1029,16 @@
pc_reg_num == LLDB_INVALID_REGNUM)
return false;
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
const int32_t ptr_size = 8;
- row.SetCFARegister (LLDB_REGNUM_GENERIC_FP);
- row.SetCFAOffset (2 * ptr_size);
- row.SetOffset (0);
+ row->SetCFARegister (LLDB_REGNUM_GENERIC_FP);
+ row->SetCFAOffset (2 * ptr_size);
+ row->SetOffset (0);
- row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
- row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
- row.SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size * 0, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size * 0, true);
unwind_plan.AppendRow (row);
unwind_plan.SetSourceName ("x86_64 default unwind plan");
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -208,7 +208,6 @@
if (!module_sp)
{
- bool uuid_is_valid = uuid.IsValid();
if (uuid_is_valid)
{
ModuleList &target_images = target.GetImages();
Modified: lldb/branches/apple/python-GIL/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Thu Jul 19 11:39:59 2012
@@ -564,7 +564,7 @@
// In ARMv5T and above, this is an interworking branch.
if (!LoadWritePC(context, data))
return false;
- addr += addr_byte_size;
+ //addr += addr_byte_size;
}
context.type = EmulateInstruction::eContextAdjustStackPointer;
@@ -1295,13 +1295,12 @@
return false;
uint32_t imm32; // the immediate operand
uint32_t d;
- bool setflags;
+ //bool setflags = false; // Add this back if/when support eEncodingT3 eEncodingA1
switch (encoding)
{
case eEncodingT1:
// d = UInt(Rd); setflags = FALSE; imm32 = ZeroExtend(imm8:'00', 32);
d = Bits32 (opcode, 10, 8);
- setflags = false;
imm32 = (Bits32 (opcode, 7, 0) << 2);
break;
@@ -1309,7 +1308,6 @@
case eEncodingT2:
// d = 13; setflags = FALSE; imm32 = ZeroExtend(imm7:'00', 32);
d = 13;
- setflags = false;
imm32 = ThumbImm7Scaled(opcode); // imm32 = ZeroExtend(imm7:'00', 32)
break;
@@ -1335,6 +1333,15 @@
{
if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_r0 + d, addr))
return false;
+
+ // Add this back if/when support eEncodingT3 eEncodingA1
+ //if (setflags)
+ //{
+ // APSR.N = result<31>;
+ // APSR.Z = IsZeroBit(result);
+ // APSR.C = carry;
+ // APSR.V = overflow;
+ //}
}
}
return true;
@@ -5395,6 +5402,7 @@
case eEncodingT1:
Rd = Bits32(opcode, 10, 8);
imm32 = ThumbImm8Scaled(opcode); // imm32 = ZeroExtend(imm8:'00', 32)
+ add = true;
break;
case eEncodingT2:
case eEncodingT3:
@@ -11505,6 +11513,10 @@
else
alignment = 4;
}
+ else
+ {
+ return false;
+ }
// d = UInt(D:Vd); n = UInt(Rn); m = UInt(Rm);
d = (Bit32 (opcode, 22) << 4) | Bits32 (opcode, 15, 12);
n = Bits32 (opcode, 19, 16);
@@ -11841,6 +11853,10 @@
else
alignment = 4;
}
+ else
+ {
+ return false;
+ }
// d = UInt(D:Vd); n = UInt(Rn); m = UInt(Rm);
d = (Bit32 (opcode, 22) << 4) | Bits32 (opcode, 15, 12);
n = Bits32 (opcode, 19, 16);
@@ -13583,13 +13599,13 @@
unwind_plan.Clear();
unwind_plan.SetRegisterKind (eRegisterKindDWARF);
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
// Our previous Call Frame Address is the stack pointer
- row.SetCFARegister (dwarf_sp);
+ row->SetCFARegister (dwarf_sp);
// Our previous PC is in the LR
- row.SetRegisterLocationToRegister(dwarf_pc, dwarf_lr, true);
+ row->SetRegisterLocationToRegister(dwarf_pc, dwarf_lr, true);
unwind_plan.AppendRow (row);
// All other registers are the same.
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -142,7 +142,7 @@
&wrapper_struct_addr,
error_stream,
stop_others,
- 100000,
+ 0 /* no timeout */,
try_all_threads,
unwind_on_error,
ret);
Modified: lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Thu Jul 19 11:39:59 2012
@@ -877,14 +877,11 @@
DataExtractor dynsym_data;
if (ReadSectionData(dynsym, dynsym_data))
{
-
const unsigned section_size = dynsym_data.GetByteSize();
- unsigned offset = 0;
unsigned cursor = 0;
while (cursor < section_size)
{
- offset = cursor;
if (!symbol.Parse(dynsym_data, &cursor))
break;
Modified: lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Jul 19 11:39:59 2012
@@ -2933,13 +2933,8 @@
func_start_entry->data = true;
addr_t symbol_file_addr = func_start_entry->addr;
- uint32_t symbol_flags = 0;
if (is_arm)
- {
- if (symbol_file_addr & 1)
- symbol_flags = MACHO_NLIST_ARM_SYMBOL_IS_THUMB;
symbol_file_addr &= 0xfffffffffffffffeull;
- }
const FunctionStarts::Entry *next_func_start_entry = function_starts.FindNextEntry (func_start_entry);
const addr_t section_end_file_addr = section_file_addr + symbol_section->GetByteSize();
@@ -3236,8 +3231,21 @@
if (load_cmd.cmd == LoadCommandUUID)
{
const uint8_t *uuid_bytes = m_data.PeekData(offset, 16);
+
if (uuid_bytes)
{
+ // OpenCL on Mac OS X uses the same UUID for each of its object files.
+ // We pretend these object files have no UUID to prevent crashing.
+
+ const uint8_t opencl_uuid[] = { 0x8c, 0x8e, 0xb3, 0x9b,
+ 0x3b, 0xa8,
+ 0x4b, 0x16,
+ 0xb6, 0xa4,
+ 0x27, 0x63, 0xbb, 0x14, 0xf0, 0x0d };
+
+ if (!memcmp(uuid_bytes, opencl_uuid, 16))
+ return false;
+
uuid->SetBytes (uuid_bytes);
return true;
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Thu Jul 19 11:39:59 2012
@@ -99,6 +99,7 @@
{
case llvm::Triple::Apple:
create = true;
+ break;
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/ARMUtils.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/ARMUtils.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/ARMUtils.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/ARMUtils.h Thu Jul 19 11:39:59 2012
@@ -25,10 +25,10 @@
static inline uint32_t DecodeImmShift(const uint32_t type, const uint32_t imm5, ARM_ShifterType &shift_t)
{
- switch (type) {
+ switch (type)
+ {
default:
//assert(0 && "Invalid shift type");
- return UINT32_MAX;
case 0:
shift_t = SRType_LSL;
return imm5;
@@ -50,6 +50,9 @@
return imm5;
}
}
+ shift_t = SRType_Invalid;
+ return UINT32_MAX;
+
}
// A8.6.35 CMP (register) -- Encoding T3
@@ -322,6 +325,7 @@
if (bits(imm12, 11, 10) == 0)
{
switch (bits(imm12, 9, 8)) {
+ default: // Keep static analyzer happy with a default case
case 0:
imm32 = abcdefgh;
break;
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Thu Jul 19 11:39:59 2012
@@ -182,14 +182,14 @@
m_fast_unwind_plan_sp = GetFastUnwindPlanForFrame ();
m_full_unwind_plan_sp = GetFullUnwindPlanForFrame ();
- const UnwindPlan::Row *active_row = NULL;
+ UnwindPlan::RowSP active_row;
int cfa_offset = 0;
- int row_register_kind;
+ int row_register_kind = -1;
if (m_full_unwind_plan_sp && m_full_unwind_plan_sp->PlanValidAtAddress (m_current_pc))
{
active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
- if (active_row && log)
+ if (active_row.get() && log)
{
StreamString active_row_strm;
active_row->Dump(active_row_strm, m_full_unwind_plan_sp.get(), &m_thread, m_start_pc.GetLoadAddress(exe_ctx.GetTargetPtr()));
@@ -198,7 +198,7 @@
}
}
- if (active_row == NULL)
+ if (!active_row.get())
{
m_frame_type = eNotAValidFrame;
return;
@@ -356,8 +356,8 @@
m_current_offset_backed_up_one = -1;
addr_t cfa_regval;
int row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
- const UnwindPlan::Row *row = m_full_unwind_plan_sp->GetRowForFunctionOffset(0);
- if (row)
+ UnwindPlan::RowSP row = m_full_unwind_plan_sp->GetRowForFunctionOffset(0);
+ if (row.get())
{
uint32_t cfa_regnum = row->GetCFARegister();
int cfa_offset = row->GetCFAOffset();
@@ -505,9 +505,9 @@
// We've set m_frame_type and m_sym_ctx before this call.
m_fast_unwind_plan_sp = GetFastUnwindPlanForFrame ();
- const UnwindPlan::Row *active_row = NULL;
+ UnwindPlan::RowSP active_row;
int cfa_offset = 0;
- int row_register_kind;
+ int row_register_kind = -1;
// Try to get by with just the fast UnwindPlan if possible - the full UnwindPlan may be expensive to get
// (e.g. if we have to parse the entire eh_frame section of an ObjectFile for the first time.)
@@ -516,7 +516,7 @@
{
active_row = m_fast_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
row_register_kind = m_fast_unwind_plan_sp->GetRegisterKind ();
- if (active_row && log)
+ if (active_row.get() && log)
{
StreamString active_row_strm;
active_row->Dump(active_row_strm, m_fast_unwind_plan_sp.get(), &m_thread, m_start_pc.GetLoadAddress(exe_ctx.GetTargetPtr()));
@@ -531,7 +531,7 @@
{
active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
- if (active_row && log)
+ if (active_row.get() && log)
{
StreamString active_row_strm;
active_row->Dump(active_row_strm, m_full_unwind_plan_sp.get(), &m_thread, m_start_pc.GetLoadAddress(exe_ctx.GetTargetPtr()));
@@ -541,7 +541,7 @@
}
}
- if (active_row == NULL)
+ if (!active_row.get())
{
m_frame_type = eNotAValidFrame;
return;
@@ -670,8 +670,8 @@
const char *has_fast = "";
if (m_fast_unwind_plan_sp)
has_fast = ", and has a fast UnwindPlan";
- log->Printf("%*sFrame %u frame has a fast UnwindPlan",
- m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
+ log->Printf("%*sFrame %u frame%s",
+ m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number, has_fast);
}
m_frame_type = eNormalFrame;
return unwind_plan_sp;
@@ -1038,7 +1038,7 @@
if (m_fast_unwind_plan_sp)
{
- const UnwindPlan::Row *active_row = m_fast_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
+ UnwindPlan::RowSP active_row = m_fast_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
unwindplan_registerkind = m_fast_unwind_plan_sp->GetRegisterKind ();
uint32_t row_regnum;
if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
@@ -1071,7 +1071,7 @@
if (m_full_unwind_plan_sp)
{
- const UnwindPlan::Row *active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
+ UnwindPlan::RowSP active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
unwindplan_registerkind = m_full_unwind_plan_sp->GetRegisterKind ();
uint32_t row_regnum;
if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -49,6 +49,7 @@
m_supports_alloc_dealloc_memory (eLazyBoolCalculate),
m_supports_memory_region_info (eLazyBoolCalculate),
m_supports_watchpoint_support_info (eLazyBoolCalculate),
+ m_watchpoints_trigger_after_instruction(eLazyBoolCalculate),
m_supports_qProcessInfoPID (true),
m_supports_qfProcessInfo (true),
m_supports_qUserName (true),
@@ -1019,6 +1020,17 @@
if (m_os_version_major != UINT32_MAX)
++num_keys_decoded;
}
+ else if (name.compare("watchpoint_exceptions_received") == 0)
+ {
+ ++num_keys_decoded;
+ if (strcmp(value.c_str(),"before") == 0)
+ m_watchpoints_trigger_after_instruction = eLazyBoolNo;
+ else if (strcmp(value.c_str(),"after") == 0)
+ m_watchpoints_trigger_after_instruction = eLazyBoolYes;
+ else
+ --num_keys_decoded;
+ }
+
}
if (num_keys_decoded > 0)
@@ -1352,6 +1364,30 @@
}
+lldb_private::Error
+GDBRemoteCommunicationClient::GetWatchpointSupportInfo (uint32_t &num, bool& after)
+{
+ Error error(GetWatchpointSupportInfo(num));
+ if (error.Success())
+ error = GetWatchpointsTriggerAfterInstruction(after);
+ return error;
+}
+
+lldb_private::Error
+GDBRemoteCommunicationClient::GetWatchpointsTriggerAfterInstruction (bool &after)
+{
+ Error error;
+
+ // we assume watchpoints will happen after running the relevant opcode
+ // and we only want to override this behavior if we have explicitly
+ // received a qHostInfo telling us otherwise
+ if (m_qHostInfo_is_valid != eLazyBoolYes)
+ after = true;
+ else
+ after = (m_watchpoints_trigger_after_instruction != eLazyBoolNo);
+ return error;
+}
+
int
GDBRemoteCommunicationClient::SetSTDIN (char const *path)
{
@@ -1788,13 +1824,13 @@
std::string name;
std::string value;
uint16_t port = 0;
- lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
+ //lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
while (response.GetNameColonValue(name, value))
{
if (name.size() == 4 && name.compare("port") == 0)
port = Args::StringToUInt32(value.c_str(), 0, 0);
- if (name.size() == 3 && name.compare("pid") == 0)
- pid = Args::StringToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0);
+// if (name.size() == 3 && name.compare("pid") == 0)
+// pid = Args::StringToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0);
}
return port;
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Thu Jul 19 11:39:59 2012
@@ -209,6 +209,12 @@
lldb_private::Error
GetWatchpointSupportInfo (uint32_t &num);
+ lldb_private::Error
+ GetWatchpointSupportInfo (uint32_t &num, bool& after);
+
+ lldb_private::Error
+ GetWatchpointsTriggerAfterInstruction (bool &after);
+
const lldb_private::ArchSpec &
GetHostArchitecture ();
@@ -358,6 +364,7 @@
lldb_private::LazyBool m_supports_alloc_dealloc_memory;
lldb_private::LazyBool m_supports_memory_region_info;
lldb_private::LazyBool m_supports_watchpoint_support_info;
+ lldb_private::LazyBool m_watchpoints_trigger_after_instruction;
bool
m_supports_qProcessInfoPID:1,
Modified: lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Thu Jul 19 11:39:59 2012
@@ -223,6 +223,11 @@
if (sub != LLDB_INVALID_CPUTYPE)
response.Printf ("cpusubtype:%u;", sub);
+ if (cpu == ArchSpec::kCore_arm_any)
+ response.Printf("watchpoint_exceptions_received:before;"); // On armv7 we use "synchronous" watchpoints which means the exception is delivered before the instruction executes.
+ else
+ response.Printf("watchpoint_exceptions_received:after;");
+
switch (lldb::endian::InlHostByteOrder())
{
case eByteOrderBig: response.PutCString ("endian:big;"); break;
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -229,8 +229,7 @@
m_register_info.Clear();
uint32_t reg_offset = 0;
uint32_t reg_num = 0;
- StringExtractorGDBRemote::ResponseType response_type;
- for (response_type = StringExtractorGDBRemote::eResponse;
+ for (StringExtractorGDBRemote::ResponseType response_type = StringExtractorGDBRemote::eResponse;
response_type == StringExtractorGDBRemote::eResponse;
++reg_num)
{
@@ -376,7 +375,6 @@
}
else
{
- response_type = StringExtractorGDBRemote::eError;
break;
}
}
@@ -1271,7 +1269,6 @@
uint32_t exc_type = 0;
std::vector<addr_t> exc_data;
addr_t thread_dispatch_qaddr = LLDB_INVALID_ADDRESS;
- uint32_t exc_data_count = 0;
ThreadSP thread_sp;
while (stop_packet.GetNameColonValue(name, value))
@@ -1281,11 +1278,6 @@
// exception type in big endian hex
exc_type = Args::StringToUInt32 (value.c_str(), 0, 16);
}
- else if (name.compare("mecount") == 0)
- {
- // exception count in big endian hex
- exc_data_count = Args::StringToUInt32 (value.c_str(), 0, 16);
- }
else if (name.compare("medata") == 0)
{
// exception data in big endian hex
@@ -2015,6 +2007,13 @@
}
Error
+ProcessGDBRemote::GetWatchpointSupportInfo (uint32_t &num, bool& after)
+{
+ Error error (m_gdb_comm.GetWatchpointSupportInfo (num, after));
+ return error;
+}
+
+Error
ProcessGDBRemote::DoDeallocateMemory (lldb::addr_t addr)
{
Error error;
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -207,6 +207,9 @@
virtual lldb_private::Error
GetWatchpointSupportInfo (uint32_t &num);
+ virtual lldb_private::Error
+ GetWatchpointSupportInfo (uint32_t &num, bool& after);
+
virtual bool
StartNoticingNewThreads();
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Thu Jul 19 11:39:59 2012
@@ -618,9 +618,8 @@
DWARFDebugInfoEntry::Attributes attributes;
const char *name = NULL;
const char *mangled_cstr = NULL;
- bool is_variable = false;
bool is_declaration = false;
- bool is_artificial = false;
+ //bool is_artificial = false;
bool has_address = false;
bool has_location = false;
bool is_global_or_static_variable = false;
@@ -629,8 +628,6 @@
const size_t num_attributes = die.GetAttributes(m_dwarf2Data, this, fixed_form_sizes, attributes);
if (num_attributes > 0)
{
- is_variable = tag == DW_TAG_variable;
-
for (uint32_t i=0; i<num_attributes; ++i)
{
dw_attr_t attr = attributes.AttributeAtIndex(i);
@@ -647,10 +644,10 @@
is_declaration = form_value.Unsigned() != 0;
break;
- case DW_AT_artificial:
- if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
- is_artificial = form_value.Unsigned() != 0;
- break;
+// case DW_AT_artificial:
+// if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
+// is_artificial = form_value.Unsigned() != 0;
+// break;
case DW_AT_MIPS_linkage_name:
if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
@@ -798,7 +795,7 @@
// as our name. If it starts with '_', then it is ok, else compare
// the string to make sure it isn't the same and we don't end up
// with duplicate entries
- if (name != mangled_cstr && ((mangled_cstr[0] == '_') || (::strcmp(name, mangled_cstr) != 0)))
+ if (name != mangled_cstr && ((mangled_cstr[0] == '_') || (name && ::strcmp(name, mangled_cstr) != 0)))
{
Mangled mangled (mangled_cstr, true);
func_fullnames.Insert (mangled.GetMangledName(), die.GetOffset());
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Thu Jul 19 11:39:59 2012
@@ -2127,8 +2127,6 @@
if (abbrev_decl->Code() == abbrev_code)
return abbrev_decl;
- // Only log if we are the one to figure out that the module was modified
- // which is indicated by SetModified() returning false.
dwarf2Data->GetObjectFile()->GetModule()->ReportErrorIfModifyDetected ("0x%8.8x: the DWARF debug information has been modified (abbrev code was %u, and is now %u)",
GetOffset(),
(uint32_t)abbrev_decl->Code(),
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp Thu Jul 19 11:39:59 2012
@@ -105,7 +105,6 @@
const char *name = NULL;
const char *mangled = NULL;
bool add_die = false;
- bool is_variable = false;
const size_t num_attributes = die->GetAttributes(dwarf2Data, cu, fixed_form_sizes, attributes);
if (num_attributes > 0)
{
@@ -113,8 +112,6 @@
dw_tag_t tag = die->Tag();
- is_variable = tag == DW_TAG_variable;
-
for (i=0; i<num_attributes; ++i)
{
dw_attr_t attr = attributes.AttributeAtIndex(i);
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Thu Jul 19 11:39:59 2012
@@ -186,83 +186,83 @@
bool
DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu)
{
- bool indirect = false;
- do
+ switch (form)
{
- indirect = false;
- switch (form)
- {
- // Blocks if inlined data that have a length field and the data bytes
- // inlined in the .debug_info
- case DW_FORM_exprloc:
- case DW_FORM_block: { dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr); *offset_ptr += size; } return true;
- case DW_FORM_block1: { dw_uleb128_t size = debug_info_data.GetU8(offset_ptr); *offset_ptr += size; } return true;
- case DW_FORM_block2: { dw_uleb128_t size = debug_info_data.GetU16(offset_ptr); *offset_ptr += size; } return true;
- case DW_FORM_block4: { dw_uleb128_t size = debug_info_data.GetU32(offset_ptr); *offset_ptr += size; } return true;
-
- // Inlined NULL terminated C-strings
- case DW_FORM_string:
- debug_info_data.GetCStr(offset_ptr);
- return true;
-
- // Compile unit address sized values
- case DW_FORM_addr:
- case DW_FORM_ref_addr:
- *offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu);
- return true;
-
- // 0 bytes values (implied from DW_FORM)
- case DW_FORM_flag_present:
- return true;
-
- // 1 byte values
- case DW_FORM_data1:
- case DW_FORM_flag:
- case DW_FORM_ref1:
- *offset_ptr += 1;
- return true;
+ // Blocks if inlined data that have a length field and the data bytes
+ // inlined in the .debug_info
+ case DW_FORM_exprloc:
+ case DW_FORM_block: { dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr); *offset_ptr += size; } return true;
+ case DW_FORM_block1: { dw_uleb128_t size = debug_info_data.GetU8(offset_ptr); *offset_ptr += size; } return true;
+ case DW_FORM_block2: { dw_uleb128_t size = debug_info_data.GetU16(offset_ptr); *offset_ptr += size; } return true;
+ case DW_FORM_block4: { dw_uleb128_t size = debug_info_data.GetU32(offset_ptr); *offset_ptr += size; } return true;
- // 2 byte values
- case DW_FORM_data2:
- case DW_FORM_ref2:
- *offset_ptr += 2;
- return true;
+ // Inlined NULL terminated C-strings
+ case DW_FORM_string:
+ debug_info_data.GetCStr(offset_ptr);
+ return true;
- // 32 bit for DWARF 32, 64 for DWARF 64
- case DW_FORM_sec_offset:
- *offset_ptr += 4;
- return true;
-
- // 4 byte values
- case DW_FORM_strp:
- case DW_FORM_data4:
- case DW_FORM_ref4:
- *offset_ptr += 4;
- return true;
+ // Compile unit address sized values
+ case DW_FORM_addr:
+ case DW_FORM_ref_addr:
+ *offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu);
+ return true;
- // 8 byte values
- case DW_FORM_data8:
- case DW_FORM_ref8:
- case DW_FORM_ref_sig8:
- *offset_ptr += 8;
- return true;
-
- // signed or unsigned LEB 128 values
- case DW_FORM_sdata:
- case DW_FORM_udata:
- case DW_FORM_ref_udata:
- debug_info_data.Skip_LEB128(offset_ptr);
- return true;
+ // 0 bytes values (implied from DW_FORM)
+ case DW_FORM_flag_present:
+ return true;
- case DW_FORM_indirect:
- indirect = true;
- form = debug_info_data.GetULEB128(offset_ptr);
- break;
- default:
- return false;
+ // 1 byte values
+ case DW_FORM_data1:
+ case DW_FORM_flag:
+ case DW_FORM_ref1:
+ *offset_ptr += 1;
+ return true;
+
+ // 2 byte values
+ case DW_FORM_data2:
+ case DW_FORM_ref2:
+ *offset_ptr += 2;
+ return true;
+
+ // 32 bit for DWARF 32, 64 for DWARF 64
+ case DW_FORM_sec_offset:
+ *offset_ptr += 4;
+ return true;
+
+ // 4 byte values
+ case DW_FORM_strp:
+ case DW_FORM_data4:
+ case DW_FORM_ref4:
+ *offset_ptr += 4;
+ return true;
+
+ // 8 byte values
+ case DW_FORM_data8:
+ case DW_FORM_ref8:
+ case DW_FORM_ref_sig8:
+ *offset_ptr += 8;
+ return true;
+
+ // signed or unsigned LEB 128 values
+ case DW_FORM_sdata:
+ case DW_FORM_udata:
+ case DW_FORM_ref_udata:
+ debug_info_data.Skip_LEB128(offset_ptr);
+ return true;
+
+ case DW_FORM_indirect:
+ {
+ dw_form_t indirect_form = debug_info_data.GetULEB128(offset_ptr);
+ return DWARFFormValue::SkipValue (indirect_form,
+ debug_info_data,
+ offset_ptr,
+ cu);
}
- } while (indirect);
- return true;
+
+ default:
+ break;
+ }
+ return false;
}
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -421,16 +421,8 @@
return 0;
uint64_t debug_abbrev_file_size = 0;
- uint64_t debug_aranges_file_size = 0;
- uint64_t debug_frame_file_size = 0;
uint64_t debug_info_file_size = 0;
uint64_t debug_line_file_size = 0;
- uint64_t debug_loc_file_size = 0;
- uint64_t debug_macinfo_file_size = 0;
- uint64_t debug_pubnames_file_size = 0;
- uint64_t debug_pubtypes_file_size = 0;
- uint64_t debug_ranges_file_size = 0;
- uint64_t debug_str_file_size = 0;
section = section_list->FindSectionByName(GetDWARFMachOSegmentName ()).get();
@@ -449,15 +441,11 @@
m_flags.Set (flagsGotDebugAbbrevData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugAranges, true).get();
- if (section)
- debug_aranges_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugArangesData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugFrame, true).get();
- if (section)
- debug_frame_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugFrameData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugLine, true).get();
@@ -467,39 +455,27 @@
m_flags.Set (flagsGotDebugLineData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugLoc, true).get();
- if (section)
- debug_loc_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugLocData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugMacInfo, true).get();
- if (section)
- debug_macinfo_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugMacInfoData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugPubNames, true).get();
- if (section)
- debug_pubnames_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugPubNamesData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugPubTypes, true).get();
- if (section)
- debug_pubtypes_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugPubTypesData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugRanges, true).get();
- if (section)
- debug_ranges_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugRangesData);
section = section_list->FindSectionByType (eSectionTypeDWARFDebugStr, true).get();
- if (section)
- debug_str_file_size = section->GetFileSize();
- else
+ if (!section)
m_flags.Set (flagsGotDebugStrData);
}
else
@@ -1834,7 +1810,7 @@
AccessType accessibility = default_accessibility;
bool is_virtual = false;
bool is_base_of_class = true;
- off_t member_offset = 0;
+ //off_t member_offset = 0;
uint32_t i;
for (i=0; i<num_attributes; ++i)
{
@@ -1848,31 +1824,31 @@
case DW_AT_decl_line: decl.SetLine(form_value.Unsigned()); break;
case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
- case DW_AT_data_member_location:
- if (form_value.BlockData())
- {
- Value initialValue(0);
- Value memberOffset(0);
- const DataExtractor& debug_info_data = get_debug_info_data();
- uint32_t block_length = form_value.Unsigned();
- uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
- if (DWARFExpression::Evaluate (NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- debug_info_data,
- block_offset,
- block_length,
- eRegisterKindDWARF,
- &initialValue,
- memberOffset,
- NULL))
- {
- member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
- }
- }
- break;
+// case DW_AT_data_member_location:
+// if (form_value.BlockData())
+// {
+// Value initialValue(0);
+// Value memberOffset(0);
+// const DataExtractor& debug_info_data = get_debug_info_data();
+// uint32_t block_length = form_value.Unsigned();
+// uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
+// if (DWARFExpression::Evaluate (NULL,
+// NULL,
+// NULL,
+// NULL,
+// NULL,
+// debug_info_data,
+// block_offset,
+// block_length,
+// eRegisterKindDWARF,
+// &initialValue,
+// memberOffset,
+// NULL))
+// {
+// member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
+// }
+// }
+// break;
case DW_AT_accessibility:
accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned());
@@ -4011,58 +3987,12 @@
const dw_tag_t tag = die->Tag();
switch (tag)
{
- case DW_TAG_enumerator:
- {
- DWARFDebugInfoEntry::Attributes attributes;
- const size_t num_child_attributes = die->GetAttributes(this, dwarf_cu, fixed_form_sizes, attributes);
- if (num_child_attributes > 0)
- {
- const char *name = NULL;
- bool got_value = false;
- int64_t enum_value = 0;
-
- uint32_t i;
- for (i=0; i<num_child_attributes; ++i)
- {
- const dw_attr_t attr = attributes.AttributeAtIndex(i);
- DWARFFormValue form_value;
- if (attributes.ExtractFormValueAtIndex(this, i, form_value))
- {
- switch (attr)
- {
- case DW_AT_const_value:
- got_value = true;
- enum_value = form_value.Unsigned();
- break;
-
- case DW_AT_name:
- name = form_value.AsCString(&get_debug_str_data());
- break;
-
- case DW_AT_description:
- default:
- case DW_AT_decl_file:
- case DW_AT_decl_line:
- case DW_AT_decl_column:
- case DW_AT_sibling:
- break;
- }
- }
- }
- }
- }
- break;
-
case DW_TAG_subrange_type:
{
DWARFDebugInfoEntry::Attributes attributes;
const size_t num_child_attributes = die->GetAttributes(this, dwarf_cu, fixed_form_sizes, attributes);
if (num_child_attributes > 0)
{
- const char *name = NULL;
- bool got_value = false;
- uint64_t byte_size = 0;
- int64_t enum_value = 0;
uint64_t num_elements = 0;
uint64_t lower_bound = 0;
uint64_t upper_bound = 0;
@@ -4075,13 +4005,7 @@
{
switch (attr)
{
- case DW_AT_const_value:
- got_value = true;
- enum_value = form_value.Unsigned();
- break;
-
case DW_AT_name:
- name = form_value.AsCString(&get_debug_str_data());
break;
case DW_AT_count:
@@ -4096,10 +4020,6 @@
byte_stride = form_value.Unsigned();
break;
- case DW_AT_byte_size:
- byte_size = form_value.Unsigned();
- break;
-
case DW_AT_lower_bound:
lower_bound = form_value.Unsigned();
break;
@@ -5152,7 +5072,6 @@
ConstString type_name_const_str;
Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
size_t byte_size = 0;
- bool byte_size_valid = false;
Declaration decl;
Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID;
@@ -5206,7 +5125,7 @@
if (type_name_cstr)
type_name_const_str.SetCString(type_name_cstr);
break;
- case DW_AT_byte_size: byte_size = form_value.Unsigned(); byte_size_valid = true; break;
+ case DW_AT_byte_size: byte_size = form_value.Unsigned(); break;
case DW_AT_encoding: encoding = form_value.Unsigned(); break;
case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
default:
@@ -5328,6 +5247,7 @@
{
// Set a bit that lets us know that we are currently parsing this
m_die_to_type[die] = DIE_IS_BEING_PARSED;
+ bool byte_size_valid = false;
LanguageType class_language = eLanguageTypeUnknown;
bool is_complete_objc_class = false;
@@ -5711,9 +5631,9 @@
type_name_const_str.SetCString(type_name_cstr);
break;
case DW_AT_type: encoding_uid = form_value.Reference(dwarf_cu); break;
- case DW_AT_byte_size: byte_size = form_value.Unsigned(); byte_size_valid = true; break;
- case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
- case DW_AT_declaration: is_forward_declaration = form_value.Unsigned() != 0; break;
+ case DW_AT_byte_size: byte_size = form_value.Unsigned(); break;
+ case DW_AT_accessibility: break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+ case DW_AT_declaration: break; //is_forward_declaration = form_value.Unsigned() != 0; break;
case DW_AT_allocated:
case DW_AT_associated:
case DW_AT_bit_stride:
@@ -5781,7 +5701,7 @@
// Set a bit that lets us know that we are currently parsing this
m_die_to_type[die] = DIE_IS_BEING_PARSED;
- const char *mangled = NULL;
+ //const char *mangled = NULL;
dw_offset_t type_die_offset = DW_INVALID_OFFSET;
bool is_variadic = false;
bool is_inline = false;
@@ -5816,10 +5736,10 @@
type_name_const_str.SetCString(type_name_cstr);
break;
- case DW_AT_MIPS_linkage_name: mangled = form_value.AsCString(&get_debug_str_data()); break;
+ case DW_AT_MIPS_linkage_name: break; // mangled = form_value.AsCString(&get_debug_str_data()); break;
case DW_AT_type: type_die_offset = form_value.Reference(dwarf_cu); break;
case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
- case DW_AT_declaration: is_forward_declaration = form_value.Unsigned() != 0; break;
+ case DW_AT_declaration: break; // is_forward_declaration = form_value.Unsigned() != 0; break;
case DW_AT_inline: is_inline = form_value.Unsigned() != 0; break;
case DW_AT_virtuality: is_virtual = form_value.Unsigned() != 0; break;
case DW_AT_explicit: is_explicit = form_value.Unsigned() != 0; break;
@@ -6214,11 +6134,11 @@
break;
case DW_AT_type: type_die_offset = form_value.Reference(dwarf_cu); break;
- case DW_AT_byte_size: byte_size = form_value.Unsigned(); byte_size_valid = true; break;
+ case DW_AT_byte_size: break; // byte_size = form_value.Unsigned(); break;
case DW_AT_byte_stride: byte_stride = form_value.Unsigned(); break;
case DW_AT_bit_stride: bit_stride = form_value.Unsigned(); break;
- case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
- case DW_AT_declaration: is_forward_declaration = form_value.Unsigned() != 0; break;
+ case DW_AT_accessibility: break; // accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+ case DW_AT_declaration: break; // is_forward_declaration = form_value.Unsigned() != 0; break;
case DW_AT_allocated:
case DW_AT_associated:
case DW_AT_data_location:
@@ -6597,7 +6517,7 @@
bool is_external = false;
bool is_artificial = false;
bool location_is_const_value_data = false;
- AccessType accessibility = eAccessNone;
+ //AccessType accessibility = eAccessNone;
for (i=0; i<num_attributes; ++i)
{
@@ -6644,7 +6564,7 @@
break;
case DW_AT_artificial: is_artificial = form_value.Unsigned() != 0; break;
- case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+ case DW_AT_accessibility: break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
case DW_AT_declaration:
case DW_AT_description:
case DW_AT_endianity:
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -143,14 +143,20 @@
m_compile_unit_infos[i].so_symbol = symtab->SymbolAtIndex(oso_indexes[i] - 2);
m_compile_unit_infos[i].oso_symbol = symtab->SymbolAtIndex(oso_indexes[i]);
uint32_t sibling_idx = m_compile_unit_infos[i].so_symbol->GetSiblingIndex();
- assert (sibling_idx != 0);
- assert (sibling_idx > i + 1);
- m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
- m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
- m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
-
- if (log)
- log->Printf("Initialized OSO 0x%8.8x: file=%s", i, m_compile_unit_infos[i].oso_symbol->GetName().GetCString());
+ // The sibling index can't be less that or equal to the current index "i"
+ if (sibling_idx <= i)
+ {
+ m_obj_file->GetModule()->ReportError ("N_SO in symbol with UID %u has invalid sibling in debug map, please file a bug and attach the binary listed in this error", m_compile_unit_infos[i].so_symbol->GetID());
+ }
+ else
+ {
+ m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
+ m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
+ m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
+
+ if (log)
+ log->Printf("Initialized OSO 0x%8.8x: file=%s", i, m_compile_unit_infos[i].oso_symbol->GetName().GetCString());
+ }
}
}
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Thu Jul 19 11:39:59 2012
@@ -225,30 +225,37 @@
xmlNode *value_node = key_node->next;
while (value_node && value_node->type != XML_ELEMENT_NODE)
value_node = value_node->next;
- if (strcmp((const char *)value_node->name, "string") == 0)
+ if (value_node && value_node->name)
{
- const char *node_content = (const char *)::xmlNodeGetContent(value_node);
- if (node_content)
+ if (strcmp((const char *)value_node->name, "string") == 0)
{
- strncpy(DBGBuildSourcePath, node_content, sizeof(DBGBuildSourcePath));
+ const char *node_content = (const char *)::xmlNodeGetContent(value_node);
+ if (node_content)
+ {
+ strncpy(DBGBuildSourcePath, node_content, sizeof(DBGBuildSourcePath));
+ }
}
+ key_node = value_node;
}
- key_node = value_node;
}
else if (strcmp(key_name, "DBGSourcePath") == 0)
{
xmlNode *value_node = key_node->next;
while (value_node && value_node->type != XML_ELEMENT_NODE)
value_node = value_node->next;
- if (strcmp((const char *)value_node->name, "string") == 0)
+ if (value_node && value_node->name)
{
- const char *node_content = (const char *)::xmlNodeGetContent(value_node);
- if (node_content)
+ if (strcmp((const char *)value_node->name, "string") == 0)
{
- strncpy(DBGSourcePath, node_content, sizeof(DBGSourcePath));
+ const char *node_content = (const char *)::xmlNodeGetContent(value_node);
+ if (node_content)
+ {
+ FileSpec resolved_source_path(node_content, true);
+ resolved_source_path.GetPath(DBGSourcePath, sizeof(DBGSourcePath));
+ }
}
+ key_node = value_node;
}
- key_node = value_node;
}
}
}
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -86,23 +86,45 @@
RegisterValue cfa_reg_value;
cfa_reg_value.SetUInt (m_initial_sp, m_cfa_reg_info.byte_size);
SetRegisterValue (m_cfa_reg_info, cfa_reg_value);
-
+
const InstructionList &inst_list = disasm_sp->GetInstructionList ();
const size_t num_instructions = inst_list.GetSize();
+
if (num_instructions > 0)
{
Instruction *inst = inst_list.GetInstructionAtIndex (0).get();
const addr_t base_addr = inst->GetAddress().GetFileAddress();
- // Initialize the current row with the one row that was created
- // from the CreateFunctionEntryUnwind call above...
- m_curr_row = unwind_plan.GetLastRow();
+
+ // Make a copy of the current instruction Row and save it in m_curr_row
+ // so we can add updates as we process the instructions.
+ UnwindPlan::RowSP last_row = unwind_plan.GetLastRow();
+ UnwindPlan::Row *newrow = new UnwindPlan::Row;
+ if (last_row.get())
+ *newrow = *last_row.get();
+ m_curr_row.reset(newrow);
+
+ // Once we've seen the initial prologue instructions complete, save a
+ // copy of the CFI at that point into prologue_completed_row for possible
+ // use later.
+ int instructions_since_last_prologue_insn = 0; // # of insns since last CFI was update
+ bool prologue_complete = false; // true if we have finished prologue setup
+ bool reinstate_prologue_next_instruction = false; // Next iteration, re-install the prologue row of CFI
+ UnwindPlan::RowSP prologue_completed_row; // copy of prologue row of CFI
+
+ // cache the pc register number (in whatever register numbering this UnwindPlan uses) for
+ // quick reference during instruction parsing.
+ uint32_t pc_reg_num = LLDB_INVALID_REGNUM;
+ RegisterInfo pc_reg_info;
+ if (m_inst_emulator_ap->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, pc_reg_info))
+ pc_reg_num = pc_reg_info.kinds[unwind_plan.GetRegisterKind()];
+
for (size_t idx=0; idx<num_instructions; ++idx)
{
+ m_curr_row_modified = false;
inst = inst_list.GetInstructionAtIndex (idx).get();
if (inst)
{
-
if (log && log->GetVerbose ())
{
StreamString strm;
@@ -115,14 +137,70 @@
exe_ctx.GetTargetPtr());
m_inst_emulator_ap->EvaluateInstruction (eEmulateInstructionOptionIgnoreConditions);
-
- if (unwind_plan.GetLastRow() != m_curr_row)
+
+ // Were there any changes to the CFI while evaluating this instruction?
+ if (m_curr_row_modified)
{
- // Be sure to not edit the offset unless our row has changed
- // so that the "!=" call above doesn't trigger every time
- m_curr_row.SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr);
+ reinstate_prologue_next_instruction = false;
+ m_curr_row->SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr);
// Append the new row
unwind_plan.AppendRow (m_curr_row);
+
+ // Allocate a new Row for m_curr_row, copy the current state into it
+ UnwindPlan::Row *newrow = new UnwindPlan::Row;
+ *newrow = *m_curr_row.get();
+ m_curr_row.reset(newrow);
+
+ instructions_since_last_prologue_insn = 0;
+
+ // If the caller's pc is "same", we've just executed an epilogue and we return to the caller
+ // after this instruction completes executing.
+ // If there are any instructions past this, there must have been flow control over this
+ // epilogue so we'll reinstate the original prologue setup instructions.
+ UnwindPlan::Row::RegisterLocation pc_regloc;
+ if (prologue_complete
+ && pc_reg_num != LLDB_INVALID_REGNUM
+ && m_curr_row->GetRegisterInfo (pc_reg_num, pc_regloc)
+ && pc_regloc.IsSame())
+ {
+ if (log && log->GetVerbose())
+ log->Printf("UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly -- pc is <same>, restore prologue instructions.");
+ reinstate_prologue_next_instruction = true;
+ }
+ }
+ else
+ {
+ // If the previous instruction was a return-to-caller (epilogue), and we're still executing
+ // instructions in this function, there must be a code path that jumps over that epilogue.
+ // Reinstate the frame setup from the prologue.
+ if (reinstate_prologue_next_instruction)
+ {
+ if (log && log->GetVerbose())
+ log->Printf("UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly -- Reinstating prologue instruction set");
+ UnwindPlan::Row *newrow = new UnwindPlan::Row;
+ *newrow = *prologue_completed_row.get();
+ m_curr_row.reset(newrow);
+ m_curr_row->SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr);
+ unwind_plan.AppendRow(m_curr_row);
+
+ newrow = new UnwindPlan::Row;
+ *newrow = *m_curr_row.get();
+ m_curr_row.reset(newrow);
+
+ reinstate_prologue_next_instruction = false;
+ }
+
+ // If we haven't seen any prologue instructions for a while (4 instructions in a row),
+ // the function prologue has probably completed. Save a copy of that Row.
+ if (prologue_complete == false && instructions_since_last_prologue_insn++ > 3)
+ {
+ prologue_complete = true;
+ UnwindPlan::Row *newrow = new UnwindPlan::Row;
+ *newrow = *m_curr_row.get();
+ prologue_completed_row.reset(newrow);
+ if (log && log->GetVerbose())
+ log->Printf("UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly -- prologue has been set up, saving a copy.");
+ }
}
}
}
@@ -362,7 +440,8 @@
{
m_pushed_regs[reg_num] = addr;
const int32_t offset = addr - m_initial_sp;
- m_curr_row.SetRegisterLocationToAtCFAPlusOffset (reg_num, offset, cant_replace);
+ m_curr_row->SetRegisterLocationToAtCFAPlusOffset (reg_num, offset, cant_replace);
+ m_curr_row_modified = true;
if (is_return_address_reg)
{
// This push was pushing the return address register,
@@ -372,7 +451,10 @@
{
uint32_t pc_reg_num = pc_reg_info.kinds[unwind_reg_kind];
if (pc_reg_num != LLDB_INVALID_REGNUM)
- m_curr_row.SetRegisterLocationToAtCFAPlusOffset (pc_reg_num, offset, can_replace);
+ {
+ m_curr_row->SetRegisterLocationToAtCFAPlusOffset (pc_reg_num, offset, can_replace);
+ m_curr_row_modified = true;
+ }
}
}
}
@@ -479,6 +561,7 @@
// m_curr_row.SetRegisterLocationToUndefined (reg_num,
// can_replace_only_if_unspecified,
// can_replace_only_if_unspecified);
+// m_curr_row_modified = true;
// }
// }
break;
@@ -488,7 +571,8 @@
const uint32_t reg_num = reg_info->kinds[m_unwind_plan_ptr->GetRegisterKind()];
if (reg_num != LLDB_INVALID_REGNUM)
{
- m_curr_row.SetRegisterLocationToSame (reg_num, must_replace);
+ m_curr_row->SetRegisterLocationToSame (reg_num, must_replace);
+ m_curr_row_modified = true;
}
}
break;
@@ -500,8 +584,9 @@
m_cfa_reg_info = *reg_info;
const uint32_t cfa_reg_num = reg_info->kinds[m_unwind_plan_ptr->GetRegisterKind()];
assert (cfa_reg_num != LLDB_INVALID_REGNUM);
- m_curr_row.SetCFARegister(cfa_reg_num);
- m_curr_row.SetCFAOffset(m_initial_sp - reg_value.GetAsUInt64());
+ m_curr_row->SetCFARegister(cfa_reg_num);
+ m_curr_row->SetCFAOffset(m_initial_sp - reg_value.GetAsUInt64());
+ m_curr_row_modified = true;
}
break;
@@ -510,7 +595,8 @@
// subsequent adjustments to the stack pointer.
if (!m_fp_is_cfa)
{
- m_curr_row.SetCFAOffset (m_initial_sp - reg_value.GetAsUInt64());
+ m_curr_row->SetCFAOffset (m_initial_sp - reg_value.GetAsUInt64());
+ m_curr_row_modified = true;
}
break;
}
Modified: lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h Thu Jul 19 11:39:59 2012
@@ -134,6 +134,7 @@
m_thread_ptr (NULL),
m_unwind_plan_ptr (NULL),
m_curr_row (),
+ m_curr_row_modified (false),
m_cfa_reg_info (),
m_fp_is_cfa (false),
m_register_values (),
@@ -161,7 +162,8 @@
lldb_private::AddressRange* m_range_ptr;
lldb_private::Thread* m_thread_ptr;
lldb_private::UnwindPlan* m_unwind_plan_ptr;
- lldb_private::UnwindPlan::Row m_curr_row;
+ lldb_private::UnwindPlan::RowSP m_curr_row;
+ bool m_curr_row_modified;
typedef std::map<uint64_t, uint64_t> PushedRegisterToAddrMap;
uint64_t m_initial_sp;
lldb_private::RegisterInfo m_cfa_reg_info;
Modified: lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Thu Jul 19 11:39:59 2012
@@ -531,7 +531,7 @@
bool
AssemblyParse_x86::get_non_call_site_unwind_plan (UnwindPlan &unwind_plan)
{
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
int non_prologue_insn_count = 0;
m_cur_insn = m_func_bounds.GetBaseAddress ();
int current_func_text_offset = 0;
@@ -548,20 +548,26 @@
unwind_plan.SetRegisterKind (eRegisterKindLLDB);
// At the start of the function, find the CFA by adding wordsize to the SP register
- row.SetOffset (current_func_text_offset);
- row.SetCFARegister (m_lldb_sp_regnum);
- row.SetCFAOffset (m_wordsize);
+ row->SetOffset (current_func_text_offset);
+ row->SetCFARegister (m_lldb_sp_regnum);
+ row->SetCFAOffset (m_wordsize);
// caller's stack pointer value before the call insn is the CFA address
initial_regloc.SetIsCFAPlusOffset (0);
- row.SetRegisterInfo (m_lldb_sp_regnum, initial_regloc);
+ row->SetRegisterInfo (m_lldb_sp_regnum, initial_regloc);
// saved instruction pointer can be found at CFA - wordsize.
current_sp_bytes_offset_from_cfa = m_wordsize;
initial_regloc.SetAtCFAPlusOffset (-current_sp_bytes_offset_from_cfa);
- row.SetRegisterInfo (m_lldb_ip_regnum, initial_regloc);
+ row->SetRegisterInfo (m_lldb_ip_regnum, initial_regloc);
unwind_plan.AppendRow (row);
+
+ // Allocate a new Row, populate it with the existing Row contents.
+ UnwindPlan::Row *newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
+
const bool prefer_file_cache = true;
Target *target = m_exe_ctx.GetTargetPtr();
@@ -584,21 +590,29 @@
if (push_rbp_pattern_p ())
{
- row.SetOffset (current_func_text_offset + insn_len);
+ row->SetOffset (current_func_text_offset + insn_len);
current_sp_bytes_offset_from_cfa += m_wordsize;
- row.SetCFAOffset (current_sp_bytes_offset_from_cfa);
+ row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
UnwindPlan::Row::RegisterLocation regloc;
- regloc.SetAtCFAPlusOffset (-row.GetCFAOffset());
- row.SetRegisterInfo (m_lldb_fp_regnum, regloc);
+ regloc.SetAtCFAPlusOffset (-row->GetCFAOffset());
+ row->SetRegisterInfo (m_lldb_fp_regnum, regloc);
unwind_plan.AppendRow (row);
+ // Allocate a new Row, populate it with the existing Row contents.
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
goto loopnext;
}
if (mov_rsp_rbp_pattern_p ())
{
- row.SetOffset (current_func_text_offset + insn_len);
- row.SetCFARegister (m_lldb_fp_regnum);
+ row->SetOffset (current_func_text_offset + insn_len);
+ row->SetCFARegister (m_lldb_fp_regnum);
unwind_plan.AppendRow (row);
+ // Allocate a new Row, populate it with the existing Row contents.
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
goto loopnext;
}
@@ -615,15 +629,19 @@
current_sp_bytes_offset_from_cfa += m_wordsize;
if (nonvolatile_reg_p (machine_regno) && machine_regno_to_lldb_regno (machine_regno, lldb_regno))
{
- row.SetOffset (current_func_text_offset + insn_len);
- if (row.GetCFARegister() == m_lldb_sp_regnum)
+ row->SetOffset (current_func_text_offset + insn_len);
+ if (row->GetCFARegister() == m_lldb_sp_regnum)
{
- row.SetCFAOffset (current_sp_bytes_offset_from_cfa);
+ row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
}
UnwindPlan::Row::RegisterLocation regloc;
regloc.SetAtCFAPlusOffset (-current_sp_bytes_offset_from_cfa);
- row.SetRegisterInfo (lldb_regno, regloc);
+ row->SetRegisterInfo (lldb_regno, regloc);
unwind_plan.AppendRow (row);
+ // Allocate a new Row, populate it with the existing Row contents.
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
}
goto loopnext;
}
@@ -632,11 +650,15 @@
{
if (machine_regno_to_lldb_regno (machine_regno, lldb_regno))
{
- row.SetOffset (current_func_text_offset + insn_len);
+ row->SetOffset (current_func_text_offset + insn_len);
UnwindPlan::Row::RegisterLocation regloc;
- regloc.SetAtCFAPlusOffset (-row.GetCFAOffset());
- row.SetRegisterInfo (lldb_regno, regloc);
+ regloc.SetAtCFAPlusOffset (-row->GetCFAOffset());
+ row->SetRegisterInfo (lldb_regno, regloc);
unwind_plan.AppendRow (row);
+ // Allocate a new Row, populate it with the existing Row contents.
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
goto loopnext;
}
}
@@ -644,11 +666,15 @@
if (sub_rsp_pattern_p (stack_offset))
{
current_sp_bytes_offset_from_cfa += stack_offset;
- if (row.GetCFARegister() == m_lldb_sp_regnum)
+ if (row->GetCFARegister() == m_lldb_sp_regnum)
{
- row.SetOffset (current_func_text_offset + insn_len);
- row.SetCFAOffset (current_sp_bytes_offset_from_cfa);
+ row->SetOffset (current_func_text_offset + insn_len);
+ row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
unwind_plan.AppendRow (row);
+ // Allocate a new Row, populate it with the existing Row contents.
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
}
goto loopnext;
}
@@ -722,21 +748,21 @@
if (ret_insn_offset != LLDB_INVALID_ADDRESS)
{
// Create a fresh, empty Row and RegisterLocation - don't mention any other registers
- UnwindPlan::Row epi_row;
+ UnwindPlan::RowSP epi_row(new UnwindPlan::Row);
UnwindPlan::Row::RegisterLocation epi_regloc;
// When the ret instruction is about to be executed, here's our state
- epi_row.SetOffset (ret_insn_offset);
- epi_row.SetCFARegister (m_lldb_sp_regnum);
- epi_row.SetCFAOffset (m_wordsize);
+ epi_row->SetOffset (ret_insn_offset);
+ epi_row->SetCFARegister (m_lldb_sp_regnum);
+ epi_row->SetCFAOffset (m_wordsize);
// caller's stack pointer value before the call insn is the CFA address
epi_regloc.SetIsCFAPlusOffset (0);
- epi_row.SetRegisterInfo (m_lldb_sp_regnum, epi_regloc);
+ epi_row->SetRegisterInfo (m_lldb_sp_regnum, epi_regloc);
// saved instruction pointer can be found at CFA - wordsize
epi_regloc.SetAtCFAPlusOffset (-m_wordsize);
- epi_row.SetRegisterInfo (m_lldb_ip_regnum, epi_regloc);
+ epi_row->SetRegisterInfo (m_lldb_ip_regnum, epi_regloc);
unwind_plan.AppendRow (epi_row);
}
@@ -755,7 +781,7 @@
bool
AssemblyParse_x86::get_fast_unwind_plan (AddressRange& func, UnwindPlan &unwind_plan)
{
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
UnwindPlan::Row::RegisterLocation pc_reginfo;
UnwindPlan::Row::RegisterLocation sp_reginfo;
UnwindPlan::Row::RegisterLocation fp_reginfo;
@@ -790,30 +816,41 @@
}
pc_reginfo.SetAtCFAPlusOffset (-m_wordsize);
- row.SetRegisterInfo (m_lldb_ip_regnum, pc_reginfo);
+ row->SetRegisterInfo (m_lldb_ip_regnum, pc_reginfo);
sp_reginfo.SetIsCFAPlusOffset (0);
- row.SetRegisterInfo (m_lldb_sp_regnum, sp_reginfo);
+ row->SetRegisterInfo (m_lldb_sp_regnum, sp_reginfo);
// Zero instructions into the function
- row.SetCFARegister (m_lldb_sp_regnum);
- row.SetCFAOffset (m_wordsize);
- row.SetOffset (0);
+ row->SetCFARegister (m_lldb_sp_regnum);
+ row->SetCFAOffset (m_wordsize);
+ row->SetOffset (0);
unwind_plan.AppendRow (row);
+ UnwindPlan::Row *newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
// push %rbp has executed - stack moved, rbp now saved
- row.SetCFAOffset (2 * m_wordsize);
+ row->SetCFAOffset (2 * m_wordsize);
fp_reginfo.SetAtCFAPlusOffset (2 * -m_wordsize);
- row.SetRegisterInfo (m_lldb_fp_regnum, fp_reginfo);
- row.SetOffset (1);
+ row->SetRegisterInfo (m_lldb_fp_regnum, fp_reginfo);
+ row->SetOffset (1);
unwind_plan.AppendRow (row);
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
+
// mov %rsp, %rbp has executed
- row.SetCFARegister (m_lldb_fp_regnum);
- row.SetCFAOffset (2 * m_wordsize);
- row.SetOffset (prologue_size); /// 3 or 4 bytes depending on arch
+ row->SetCFARegister (m_lldb_fp_regnum);
+ row->SetCFAOffset (2 * m_wordsize);
+ row->SetOffset (prologue_size); /// 3 or 4 bytes depending on arch
unwind_plan.AppendRow (row);
+ newrow = new UnwindPlan::Row;
+ *newrow = *row.get();
+ row.reset(newrow);
+
unwind_plan.SetPlanValidAddressRange (func);
return true;
}
Modified: lldb/branches/apple/python-GIL/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/Block.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/Block.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/Block.cpp Thu Jul 19 11:39:59 2012
@@ -542,7 +542,7 @@
}
clang::DeclContext *
-Block::GetClangDeclContextForInlinedFunction()
+Block::GetClangDeclContext()
{
SymbolContext sc;
Modified: lldb/branches/apple/python-GIL/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/ClangASTContext.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/ClangASTContext.cpp Thu Jul 19 11:39:59 2012
@@ -1156,9 +1156,6 @@
if (decl)
SetMetadata(ast, (uintptr_t)decl, metadata);
- if (!name)
- decl->setAnonymousStructOrUnion(true);
-
if (decl_ctx)
{
if (access_type != eAccessNone)
@@ -1961,8 +1958,18 @@
false, // Mutable
false); // HasInit
- if (!name)
- field->setImplicit();
+ if (!name) {
+ // Determine whether this field corresponds to an anonymous
+ // struct or union.
+ if (const TagType *TagT = field->getType()->getAs<TagType>()) {
+ if (RecordDecl *Rec = dyn_cast<RecordDecl>(TagT->getDecl()))
+ if (!Rec->getDeclName()) {
+ Rec->setAnonymousStructOrUnion(true);
+ field->setImplicit();
+
+ }
+ }
+ }
field->setAccess (ConvertAccessTypeToAccessSpecifier (access));
@@ -2413,7 +2420,7 @@
{
ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
- clang_type_t property_opaque_type_to_access;
+ clang_type_t property_opaque_type_to_access = NULL;
if (property_opaque_type)
property_opaque_type_to_access = property_opaque_type;
@@ -6323,3 +6330,49 @@
return llvm::dyn_cast<clang::DeclContext>(objc_method_decl);
}
+
+bool
+ClangASTContext::GetClassMethodInfoForDeclContext (clang::DeclContext *decl_ctx,
+ lldb::LanguageType &language,
+ bool &is_instance_method,
+ ConstString &language_object_name)
+{
+ language_object_name.Clear();
+ language = eLanguageTypeUnknown;
+ is_instance_method = false;
+
+ if (decl_ctx)
+ {
+ if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx))
+ {
+ if (method_decl->isStatic())
+ {
+ is_instance_method = false;
+ }
+ else
+ {
+ language_object_name.SetCString("this");
+ is_instance_method = true;
+ }
+ language = eLanguageTypeC_plus_plus;
+ return true;
+ }
+ else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx))
+ {
+ // Both static and instance methods have a "self" object in objective C
+ language_object_name.SetCString("self");
+ if (method_decl->isInstanceMethod())
+ {
+ is_instance_method = true;
+ }
+ else
+ {
+ is_instance_method = false;
+ }
+ language = eLanguageTypeObjC;
+ return true;
+ }
+ }
+ return false;
+}
+
Modified: lldb/branches/apple/python-GIL/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/ClangASTImporter.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/ClangASTImporter.cpp Thu Jul 19 11:39:59 2012
@@ -161,7 +161,7 @@
CompleteObjCInterfaceDecl(interface_decl);
}
}
- else if (ObjCProtocolDecl *protocol_decl = dyn_cast<ObjCProtocolDecl>(protocol_decl))
+ else if (ObjCProtocolDecl *protocol_decl = dyn_cast<ObjCProtocolDecl>(decl))
{
if (!protocol_decl->getDefinition())
protocol_decl->startDefinition();
Modified: lldb/branches/apple/python-GIL/source/Symbol/DWARFCallFrameInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/DWARFCallFrameInfo.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/DWARFCallFrameInfo.cpp Thu Jul 19 11:39:59 2012
@@ -398,12 +398,13 @@
uint32_t reg_num = 0;
int32_t op_offset = 0;
- uint32_t tmp_uval32;
uint32_t code_align = cie->code_align;
int32_t data_align = cie->data_align;
unwind_plan.SetPlanValidAddressRange (range);
- UnwindPlan::Row row = cie->initial_row;
+ UnwindPlan::Row *cie_initial_row = new UnwindPlan::Row;
+ *cie_initial_row = cie->initial_row;
+ UnwindPlan::RowSP row(cie_initial_row);
unwind_plan.SetRegisterKind (m_reg_kind);
@@ -426,7 +427,7 @@
// value and adding (delta * code_align). All other
// values in the new row are initially identical to the current row.
unwind_plan.AppendRow(row);
- row.SlideOffset(extended_opcode * code_align);
+ row->SlideOffset(extended_opcode * code_align);
}
break;
@@ -440,7 +441,7 @@
reg_num = extended_opcode;
op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
reg_location.SetAtCFAPlusOffset(op_offset);
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -455,8 +456,8 @@
// by the register index in that state, so we need to convert our
// GCC register number from the EH frame info, to a register index
- if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0).GetRegisterInfo(reg_num, reg_location))
- row.SetRegisterInfo (reg_num, reg_location);
+ if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0)->GetRegisterInfo(reg_num, reg_location))
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
}
@@ -476,7 +477,7 @@
// are initially identical to the current row. The new location value
// should always be greater than the current one.
unwind_plan.AppendRow(row);
- row.SetOffset(m_cfi_data.GetPointer(&offset) - startaddr.GetFileAddress());
+ row->SetOffset(m_cfi_data.GetPointer(&offset) - startaddr.GetFileAddress());
}
break;
@@ -486,7 +487,7 @@
// This instruction is identical to DW_CFA_advance_loc except for the
// encoding and size of the delta argument.
unwind_plan.AppendRow(row);
- row.SlideOffset (m_cfi_data.GetU8(&offset) * code_align);
+ row->SlideOffset (m_cfi_data.GetU8(&offset) * code_align);
}
break;
@@ -496,7 +497,7 @@
// This instruction is identical to DW_CFA_advance_loc except for the
// encoding and size of the delta argument.
unwind_plan.AppendRow(row);
- row.SlideOffset (m_cfi_data.GetU16(&offset) * code_align);
+ row->SlideOffset (m_cfi_data.GetU16(&offset) * code_align);
}
break;
@@ -506,7 +507,7 @@
// This instruction is identical to DW_CFA_advance_loc except for the
// encoding and size of the delta argument.
unwind_plan.AppendRow(row);
- row.SlideOffset (m_cfi_data.GetU32(&offset) * code_align);
+ row->SlideOffset (m_cfi_data.GetU32(&offset) * code_align);
}
break;
@@ -518,7 +519,7 @@
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
reg_location.SetAtCFAPlusOffset(op_offset);
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -528,8 +529,8 @@
// number. This instruction is identical to DW_CFA_restore except for
// the encoding and size of the register argument.
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
- if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0).GetRegisterInfo(reg_num, reg_location))
- row.SetRegisterInfo (reg_num, reg_location);
+ if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0)->GetRegisterInfo(reg_num, reg_location))
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -540,7 +541,7 @@
// register to undefined.
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
reg_location.SetUndefined();
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -551,7 +552,7 @@
// register to same value.
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
reg_location.SetSame();
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -564,7 +565,7 @@
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
uint32_t other_reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
reg_location.SetInRegister(other_reg_num);
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -600,8 +601,8 @@
// register and offset.
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
- row.SetCFARegister (reg_num);
- row.SetCFAOffset (op_offset);
+ row->SetCFARegister (reg_num);
+ row->SetCFAOffset (op_offset);
}
break;
@@ -611,7 +612,7 @@
// number. The required action is to define the current CFA rule to
// use the provided register (but to keep the old offset).
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
- row.SetCFARegister (reg_num);
+ row->SetCFARegister (reg_num);
}
break;
@@ -622,7 +623,7 @@
// the current CFA rule to use the provided offset (but
// to keep the old register).
op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
- row.SetCFAOffset (op_offset);
+ row->SetCFAOffset (op_offset);
}
break;
@@ -648,7 +649,7 @@
const uint8_t *block_data = (uint8_t *)m_cfi_data.GetData(&offset, block_len);
reg_location.SetAtDWARFExpression(block_data, block_len);
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -661,7 +662,7 @@
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
reg_location.SetAtCFAPlusOffset(op_offset);
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
@@ -673,8 +674,8 @@
// that the second operand is signed and factored.
reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
- row.SetCFARegister (reg_num);
- row.SetCFAOffset (op_offset);
+ row->SetCFARegister (reg_num);
+ row->SetCFAOffset (op_offset);
}
break;
@@ -684,7 +685,7 @@
// offset. This instruction is identical to DW_CFA_def_cfa_offset
// except that the operand is signed and factored.
op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
- row.SetCFAOffset (op_offset);
+ row->SetCFAOffset (op_offset);
}
break;
@@ -741,14 +742,13 @@
// }
//#endif
reg_location.SetIsDWARFExpression(block_data, block_len);
- row.SetRegisterInfo (reg_num, reg_location);
+ row->SetRegisterInfo (reg_num, reg_location);
}
break;
case DW_CFA_val_offset : // 0x14
case DW_CFA_val_offset_sf : // 0x15
default:
- tmp_uval32 = extended_opcode;
break;
}
}
Modified: lldb/branches/apple/python-GIL/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/SymbolContext.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/SymbolContext.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/SymbolContext.cpp Thu Jul 19 11:39:59 2012
@@ -13,6 +13,8 @@
#include "lldb/Core/Module.h"
#include "lldb/Host/Host.h"
#include "lldb/Interpreter/Args.h"
+#include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/Symbol.h"
@@ -535,7 +537,61 @@
return false;
}
-ConstString
+Block *
+SymbolContext::GetFunctionBlock ()
+{
+ if (function)
+ {
+ if (block)
+ {
+ // If this symbol context has a block, check to see if this block
+ // is itself, or is contained within a block with inlined function
+ // information. If so, then the inlined block is the block that
+ // defines the function.
+ Block *inlined_block = block->GetContainingInlinedBlock();
+ if (inlined_block)
+ return inlined_block;
+
+ // The block in this symbol context is not inside an inlined
+ // block, so the block that defines the function is the function's
+ // top level block, which is returned below.
+ }
+
+ // There is no block information in this symbol context, so we must
+ // assume that the block that is desired is the top level block of
+ // the function itself.
+ return &function->GetBlock(true);
+ }
+ return NULL;
+}
+
+bool
+SymbolContext::GetFunctionMethodInfo (lldb::LanguageType &language,
+ bool &is_instance_method,
+ ConstString &language_object_name)
+
+
+{
+ Block *function_block = GetFunctionBlock ();
+ if (function_block)
+ {
+ clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+
+ if (decl_context)
+ {
+ return ClangASTContext::GetClassMethodInfoForDeclContext (decl_context,
+ language,
+ is_instance_method,
+ language_object_name);
+ }
+ }
+ language = eLanguageTypeUnknown;
+ is_instance_method = false;
+ language_object_name.Clear();
+ return false;
+}
+
+ConstString
SymbolContext::GetFunctionName (Mangled::NamePreference preference)
{
if (function)
Modified: lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp Thu Jul 19 11:39:59 2012
@@ -295,36 +295,53 @@
m_cfa_reg_num = reg_num;
}
+bool
+UnwindPlan::Row::operator == (const UnwindPlan::Row& rhs) const
+{
+ if (m_offset != rhs.m_offset || m_cfa_reg_num != rhs.m_cfa_reg_num || m_cfa_offset != rhs.m_cfa_offset)
+ return false;
+ if (m_register_locations.size() != rhs.m_register_locations.size())
+ return false;
+ for (collection::const_iterator idx = m_register_locations.begin(); idx != m_register_locations.end(); ++idx)
+ {
+ collection::const_iterator lhs_pos = m_register_locations.find(idx->first);
+ collection::const_iterator rhs_pos = rhs.m_register_locations.find(idx->first);
+ if (lhs_pos->second != rhs_pos->second)
+ return false;
+ }
+ return true;
+}
+
void
-UnwindPlan::AppendRow (const UnwindPlan::Row &row)
+UnwindPlan::AppendRow (UnwindPlan::RowSP row)
{
- if (m_row_list.empty() || m_row_list.back().GetOffset() != row.GetOffset())
+ if (m_row_list.empty() || m_row_list.back()->GetOffset() != row->GetOffset())
m_row_list.push_back(row);
else
m_row_list.back() = row;
}
-const UnwindPlan::Row *
+UnwindPlan::RowSP
UnwindPlan::GetRowForFunctionOffset (int offset) const
{
- const UnwindPlan::Row *row_ptr = NULL;
+ RowSP row;
if (!m_row_list.empty())
{
if (offset == -1)
- row_ptr = &m_row_list.back();
+ row = m_row_list.back();
else
{
collection::const_iterator pos, end = m_row_list.end();
for (pos = m_row_list.begin(); pos != end; ++pos)
{
- if (pos->GetOffset() <= offset)
- row_ptr = &*pos;
+ if ((*pos)->GetOffset() <= offset)
+ row = *pos;
else
break;
}
}
}
- return row_ptr;
+ return row;
}
bool
@@ -333,7 +350,7 @@
return idx < m_row_list.size();
}
-const UnwindPlan::Row&
+const UnwindPlan::RowSP
UnwindPlan::GetRowAtIndex (uint32_t idx) const
{
// You must call IsValidRowIndex(idx) first before calling this!!!
@@ -341,7 +358,7 @@
return m_row_list[idx];
}
-const UnwindPlan::Row&
+const UnwindPlan::RowSP
UnwindPlan::GetLastRow () const
{
// You must call GetRowCount() first to make sure there is at least one row
@@ -410,7 +427,7 @@
for (pos = begin; pos != end; ++pos)
{
s.Printf ("row[%u]: ", (uint32_t)std::distance (begin, pos));
- pos->Dump(s, this, thread, base_addr);
+ (*pos)->Dump(s, this, thread, base_addr);
}
}
Modified: lldb/branches/apple/python-GIL/source/Symbol/VariableList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/VariableList.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/VariableList.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/VariableList.cpp Thu Jul 19 11:39:59 2012
@@ -176,3 +176,40 @@
}
}
+lldb::VariableSP
+VariableList::FindArtificialObjectVariable (lldb::LanguageType language) const
+{
+ lldb::VariableSP object_variable_sp;
+ ConstString object_variable_name;
+ switch (language)
+ {
+ case eLanguageTypeC_plus_plus:
+ object_variable_name.SetCString("this");
+ break;
+
+ case eLanguageTypeObjC:
+ case eLanguageTypeObjC_plus_plus:
+ object_variable_name.SetCString("self");
+ break;
+
+ default:
+ break;
+ }
+ if (object_variable_name)
+ {
+ const_iterator pos, end = m_variables.end();
+ for (pos = m_variables.begin(); pos != end; ++pos)
+ {
+ Variable *variable = pos->get();
+ if (variable->IsArtificial() &&
+ variable->GetScope() == eValueTypeVariableArgument &&
+ variable->GetName() == object_variable_name)
+ {
+ object_variable_sp = *pos;
+ break;
+ }
+ }
+ }
+ return object_variable_sp;
+}
+
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Thu Jul 19 11:39:59 2012
@@ -3179,11 +3179,11 @@
// break at main.cpp:58, run and hit the breakpoints on
// multiple threads, then somehow during the stepping over
// of all breakpoints no run gets reported.
- return_value = true;
// This is a transition from stop to run.
switch (m_thread_list.ShouldReportRun (event_ptr))
{
+ default:
case eVoteYes:
case eVoteNoOpinion:
return_value = true;
@@ -4228,11 +4228,27 @@
if (single_thread_timeout_usec != 0)
{
+ // we have a > 0 timeout, let us set it so that we stop after the deadline
real_timeout = TimeValue::Now();
real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec);
timeout_ptr = &real_timeout;
}
+ else if (first_timeout)
+ {
+ // if we are willing to wait "forever" we still need to have an initial timeout
+ // this timeout is going to induce all threads to run when hit. we do this so that
+ // we can avoid ending locked up because of multithreaded contention issues
+ real_timeout = TimeValue::Now();
+ real_timeout.OffsetWithNanoSeconds(500000000UL);
+ timeout_ptr = &real_timeout;
+ }
+ else
+ {
+ timeout_ptr = NULL; // if we are in a no-timeout scenario, then we only need a fake timeout the first time through
+ // at this point in the code, all threads will be running so we are willing to wait forever, and do not
+ // need a timeout
+ }
}
else
{
@@ -4242,7 +4258,6 @@
}
// Now wait for the process to stop again:
- stop_state = lldb::eStateInvalid;
event_sp.reset();
if (log)
Modified: lldb/branches/apple/python-GIL/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/StackFrame.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/StackFrame.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/StackFrame.cpp Thu Jul 19 11:39:59 2012
@@ -513,7 +513,7 @@
ValueObjectSP
-StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr,
+StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr,
DynamicValueType use_dynamic,
uint32_t options,
VariableSP &var_sp,
@@ -562,13 +562,42 @@
name_const_string.SetCStringWithLength (var_path.c_str(), separator_idx);
var_sp = variable_list->FindVariable(name_const_string);
+
+ bool synthetically_added_instance_object = false;
+
+ if (var_sp)
+ {
+ var_path.erase (0, name_const_string.GetLength ());
+ }
+ else if (options & eExpressionPathOptionsAllowDirectIVarAccess)
+ {
+ // Check for direct ivars access which helps us with implicit
+ // access to ivars with the "this->" or "self->"
+ GetSymbolContext(eSymbolContextFunction|eSymbolContextBlock);
+ lldb::LanguageType method_language = eLanguageTypeUnknown;
+ bool is_instance_method = false;
+ ConstString method_object_name;
+ if (m_sc.GetFunctionMethodInfo (method_language, is_instance_method, method_object_name))
+ {
+ if (is_instance_method && method_object_name)
+ {
+ var_sp = variable_list->FindVariable(method_object_name);
+ if (var_sp)
+ {
+ separator_idx = 0;
+ var_path.insert(0, "->");
+ synthetically_added_instance_object = true;
+ }
+ }
+ }
+ }
+
if (var_sp)
{
valobj_sp = GetValueObjectForFrameVariable (var_sp, use_dynamic);
if (!valobj_sp)
return valobj_sp;
- var_path.erase (0, name_const_string.GetLength ());
// We are dumping at least one child
while (separator_idx != std::string::npos)
{
@@ -651,23 +680,35 @@
if (no_synth_child || !child_valobj_sp)
{
// No child member with name "child_name"
- valobj_sp->GetExpressionPath (var_expr_path_strm, false);
- if (child_name)
+ if (synthetically_added_instance_object)
{
- error.SetErrorStringWithFormat ("\"%s\" is not a member of \"(%s) %s\"",
- child_name.GetCString(),
- valobj_sp->GetTypeName().AsCString("<invalid type>"),
- var_expr_path_strm.GetString().c_str());
+ // We added a "this->" or "self->" to the beginning of the expression
+ // and this is the first pointer ivar access, so just return the normal
+ // error
+ error.SetErrorStringWithFormat("no variable or instance variable named '%s' found in this frame",
+ name_const_string.GetCString());
}
else
{
- error.SetErrorStringWithFormat ("incomplete expression path after \"%s\" in \"%s\"",
- var_expr_path_strm.GetString().c_str(),
- var_expr_cstr);
+ valobj_sp->GetExpressionPath (var_expr_path_strm, false);
+ if (child_name)
+ {
+ error.SetErrorStringWithFormat ("\"%s\" is not a member of \"(%s) %s\"",
+ child_name.GetCString(),
+ valobj_sp->GetTypeName().AsCString("<invalid type>"),
+ var_expr_path_strm.GetString().c_str());
+ }
+ else
+ {
+ error.SetErrorStringWithFormat ("incomplete expression path after \"%s\" in \"%s\"",
+ var_expr_path_strm.GetString().c_str(),
+ var_expr_cstr);
+ }
}
return ValueObjectSP();
}
}
+ synthetically_added_instance_object = false;
// Remove the child name from the path
var_path.erase(0, child_name.GetLength());
if (use_dynamic != eNoDynamicValues)
Modified: lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp Thu Jul 19 11:39:59 2012
@@ -461,6 +461,36 @@
if (wp_sp)
{
ExecutionContext exe_ctx (m_thread.GetStackFrameAtIndex(0));
+ {
+ // check if this process is running on an architecture where watchpoints trigger
+ // before the associated instruction runs. if so, disable the WP, single-step and then
+ // re-enable the watchpoint
+ Process* process = exe_ctx.GetProcessPtr();
+ if (process)
+ {
+ uint32_t num; bool wp_triggers_after;
+ if (process->GetWatchpointSupportInfo(num, wp_triggers_after).Success())
+ {
+ if (!wp_triggers_after)
+ {
+ process->DisableWatchpoint(wp_sp.get());
+
+ ThreadPlan *new_plan = m_thread.QueueThreadPlanForStepSingleInstruction(false, // step-over
+ false, // abort_other_plans
+ true); // stop_other_threads
+ new_plan->SetIsMasterPlan (true);
+ new_plan->SetOkayToDiscard (false);
+ process->GetThreadList().SetSelectedThreadByID (m_thread.GetID());
+ process->Resume ();
+ process->WaitForProcessToStop (NULL);
+ process->GetThreadList().SetSelectedThreadByID (m_thread.GetID());
+ MakeStopInfoValid(); // make sure we do not fail to stop because of the single-step taken above
+
+ process->EnableWatchpoint(wp_sp.get());
+ }
+ }
+ }
+ }
StoppointCallbackContext context (event_ptr, exe_ctx, false);
bool stop_requested = wp_sp->InvokeCallback (&context);
// Also make sure that the callback hasn't continued the target.
@@ -490,7 +520,8 @@
wp_sp->GetConditionText(),
NULL,
result_value_sp,
- error);
+ error,
+ 500000);
if (result_code == eExecutionCompleted)
{
if (result_value_sp)
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=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Target.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Target.cpp Thu Jul 19 11:39:59 2012
@@ -1652,7 +1652,8 @@
bool unwind_on_error,
bool keep_in_memory,
lldb::DynamicValueType use_dynamic,
- lldb::ValueObjectSP &result_valobj_sp
+ lldb::ValueObjectSP &result_valobj_sp,
+ uint32_t single_thread_timeout_usec
)
{
ExecutionResults execution_results = eExecutionSetupError;
@@ -1781,7 +1782,8 @@
unwind_on_error,
expr_cstr,
prefix,
- result_valobj_sp);
+ result_valobj_sp,
+ single_thread_timeout_usec);
}
}
Modified: lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepInRange.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepInRange.cpp Thu Jul 19 11:39:59 2012
@@ -242,13 +242,12 @@
if (avoid_regexp_to_use != NULL)
{
- SymbolContext sc = frame->GetSymbolContext(eSymbolContextSymbol);
+ SymbolContext sc = frame->GetSymbolContext(eSymbolContextFunction|eSymbolContextBlock|eSymbolContextSymbol);
if (sc.symbol != NULL)
{
- const char *unnamed_symbol = "<UNKNOWN>";
- const char *sym_name = sc.symbol->GetMangled().GetName().AsCString(unnamed_symbol);
- if (strcmp (sym_name, unnamed_symbol) != 0)
- return avoid_regexp_to_use->Execute(sym_name);
+ const char *frame_function_name = sc.GetFunctionName().GetCString();
+ if (frame_function_name)
+ return avoid_regexp_to_use->Execute(frame_function_name);
}
}
return false;
Modified: lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Thu Jul 19 11:39:59 2012
@@ -227,14 +227,21 @@
substrs = ['(NSNumber *) num1 = ',' (int)5',
'(NSNumber *) num2 = ',' (float)3.1',
'(NSNumber *) num3 = ',' (double)3.14',
- '(NSNumber *) num4 = ',' (long)18446744073709551614',
+ '(NSNumber *) num4 = ',' (long)-2',
'(NSNumber *) num5 = ',' (char)65',
'(NSNumber *) num6 = ',' (long)255',
'(NSNumber *) num7 = ','2000000',
'(NSNumber *) num8_Y = ',' @"1"',
'(NSNumber *) num8_N = ',' @"0"',
- '(NSNumber *) num9 = ',' (short)33920'])
+ '(NSNumber *) num9 = ',' (short)-31616'])
+ self.expect('frame variable num_at1 num_at2 num_at3 num_at4',
+ substrs = ['(NSNumber *) num_at1 = ',' (int)12',
+ '(NSNumber *) num_at2 = ',' (int)-12',
+ '(NSNumber *) num_at3 = ',' (double)12.5',
+ '(NSNumber *) num_at4 = ',' (double)-12.5'])
+
+
self.expect('frame variable str0 str1 str2 str3 str4 str5 str6 str8 str9 str10 str11 label1 label2 processName str12',
substrs = ['(NSString *) str1 = ',' @"A rather short ASCII NSString object is here"',
'(NSString *) str0 = ',' @"255"',
Modified: lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-objc/main.m Thu Jul 19 11:39:59 2012
@@ -153,6 +153,10 @@
NSNumber* num8_Y = [NSNumber numberWithBool:YES];
NSNumber* num8_N = [NSNumber numberWithBool:NO];
NSNumber* num9 = [NSNumber numberWithShort:0x1E8480];
+ NSNumber* num_at1 = @12;
+ NSNumber* num_at2 = @-12;
+ NSNumber* num_at3 = @12.5;
+ NSNumber* num_at4 = @-12.5;
NSString *str0 = [num6 stringValue];
Modified: lldb/branches/apple/python-GIL/test/functionalities/process_launch/TestProcessLaunch.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/process_launch/TestProcessLaunch.py?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/process_launch/TestProcessLaunch.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/process_launch/TestProcessLaunch.py Thu Jul 19 11:39:59 2012
@@ -48,7 +48,7 @@
pass
launch_command = "process launch -i " + in_file + " -o " + out_file + " -e " + err_file
-
+
self.expect (launch_command,
patterns = [ "Process .* launched: .*a.out" ])
@@ -69,7 +69,7 @@
success = False
err_msg = err_msg + " ERROR: stdout file does not contain correct output.\n"
out_f.close();
-
+
# Try to delete the 'stdout' file
try:
os.remove (out_file)
@@ -139,6 +139,15 @@
except OSError:
pass
+ # Check that we get an error when we have a nonexisting path
+ launch_command = "process launch -w %s -o %s -e %s" % (my_working_dir_path + 'z',
+ out_file_path,
+ err_file_path)
+
+ self.expect(launch_command, error=True,
+ startstr = "error: No such file or directory: %sz" % my_working_dir_path)
+
+ # Really launch the process
launch_command = "process launch -w %s -o %s -e %s" % (my_working_dir_path,
out_file_path,
err_file_path)
@@ -164,7 +173,7 @@
success = False
err_msg = err_msg + "The current working directory was not set correctly.\n"
out_f.close();
-
+
# Try to delete the 'stdout' and 'stderr' files
try:
os.remove(out_file_path)
Modified: lldb/branches/apple/python-GIL/tools/darwin-debug/darwin-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/darwin-debug/darwin-debug.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/darwin-debug/darwin-debug.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/darwin-debug/darwin-debug.cpp Thu Jul 19 11:39:59 2012
@@ -164,6 +164,7 @@
int main (int argc, char *const *argv, char *const *envp, const char **apple)
{
+#if defined (DEBUG_LLDB_LAUNCHER)
const char *program_name = strrchr(apple[0], '/');
if (program_name)
@@ -171,7 +172,6 @@
else
program_name = apple[0];
-#if defined (DEBUG_LLDB_LAUNCHER)
printf("%s called with:\n", program_name);
for (int i=0; i<argc; ++i)
printf("argv[%u] = '%s'\n", i, argv[i]);
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=160513&r1=160512&r2=160513&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 Thu Jul 19 11:39:59 2012
@@ -368,7 +368,6 @@
26CE05C7115C36870022F371 /* ShellScript */,
26CE0591115C31C20022F371 /* Sources */,
26CE0592115C31C20022F371 /* Frameworks */,
- 261CE9BE14D327CC006D8EFE /* Codesign */,
);
buildRules = (
);
@@ -407,20 +406,6 @@
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
- 261CE9BE14D327CC006D8EFE /* Codesign */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = Codesign;
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = "/bin/sh -x";
- shellScript = "if [ $CONFIGURATION != BuildAndIntegration -a $PLATFORM_NAME = macosx ]; then /usr/bin/codesign -s lldb_codesign -f \"$TARGET_BUILD_DIR/$TARGET_NAME\"; fi";
- };
26CE05C7115C36870022F371 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -495,10 +480,11 @@
i386,
);
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 188;
+ CURRENT_PROJECT_VERSION = 189;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
SDKROOT = "";
STRIP_INSTALLED_PRODUCT = NO;
VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -515,11 +501,12 @@
armv7s,
);
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
- CURRENT_PROJECT_VERSION = 188;
+ CURRENT_PROJECT_VERSION = 189;
DEAD_CODE_STRIPPING = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
SDKROOT = "";
STRIPFLAGS = "-x";
STRIP_STYLE = debugging;
@@ -540,7 +527,7 @@
x86_64,
i386,
);
- CURRENT_PROJECT_VERSION = 188;
+ CURRENT_PROJECT_VERSION = 189;
DEAD_CODE_STRIPPING = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -557,10 +544,9 @@
262419A21198A93E00067686 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 188;
+ CURRENT_PROJECT_VERSION = 189;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -609,10 +595,11 @@
26CE0596115C31C30022F371 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 188;
+ CURRENT_PROJECT_VERSION = 189;
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -649,6 +636,8 @@
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
PRODUCT_NAME = debugserver;
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+ "PROVISIONING_PROFILE[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR)";
ZERO_LINK = NO;
@@ -658,10 +647,11 @@
26CE0597115C31C30022F371 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+ "CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
COPY_PHASE_STRIP = YES;
- CURRENT_PROJECT_VERSION = 188;
+ CURRENT_PROJECT_VERSION = 189;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -698,6 +688,8 @@
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
PRODUCT_NAME = debugserver;
+ "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+ "PROVISIONING_PROFILE[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR)";
ZERO_LINK = NO;
Modified: lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme Thu Jul 19 11:39:59 2012
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0430"
+ LastUpgradeVersion = "0450"
version = "1.8">
<BuildAction
parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
@@ -56,6 +56,7 @@
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
+ enableOpenGLFrameCaptureMode = "0"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/DNB.cpp Thu Jul 19 11:39:59 2012
@@ -1214,9 +1214,9 @@
case '%':
{
f++; // Skip the '%' character
- int min_field_width = 0;
- int precision = 0;
- uint32_t flags = 0;
+// int min_field_width = 0;
+// int precision = 0;
+ //uint32_t flags = 0;
uint32_t length_modifiers = 0;
uint32_t byte_size = 0;
uint32_t actual_byte_size = 0;
@@ -1233,12 +1233,12 @@
// Decode any flags
switch (*f)
{
- case '#': fprintf_format += *f++; flags |= alternate_form; break;
- case '0': fprintf_format += *f++; flags |= zero_padding; break;
- case '-': fprintf_format += *f++; flags |= negative_field_width; break;
- case ' ': fprintf_format += *f++; flags |= blank_space; break;
- case '+': fprintf_format += *f++; flags |= show_sign; break;
- case ',': fprintf_format += *f++; flags |= show_thousands_separator;break;
+ case '#': fprintf_format += *f++; break; //flags |= alternate_form; break;
+ case '0': fprintf_format += *f++; break; //flags |= zero_padding; break;
+ case '-': fprintf_format += *f++; break; //flags |= negative_field_width; break;
+ case ' ': fprintf_format += *f++; break; //flags |= blank_space; break;
+ case '+': fprintf_format += *f++; break; //flags |= show_sign; break;
+ case ',': fprintf_format += *f++; break; //flags |= show_thousands_separator;break;
case '{':
case '[':
{
@@ -1330,7 +1330,8 @@
// Check for a minimum field width
if (isdigit(*f))
{
- min_field_width = strtoul(f, &end, 10);
+ //min_field_width = strtoul(f, &end, 10);
+ strtoul(f, &end, 10);
if (end > f)
{
fprintf_format.append(f, end - f);
@@ -1346,7 +1347,8 @@
if (isdigit(*f))
{
fprintf_format += '.';
- precision = strtoul(f, &end, 10);
+ //precision = strtoul(f, &end, 10);
+ strtoul(f, &end, 10);
if (end > f)
{
fprintf_format.append(f, end - f);
@@ -1453,7 +1455,7 @@
byte_size = sizeof(char);
else if (length_modifiers & length_mod_h)
byte_size = sizeof(short);
- if (length_modifiers & length_mod_ll)
+ else if (length_modifiers & length_mod_ll)
byte_size = sizeof(long long);
else if (length_modifiers & length_mod_l)
byte_size = sizeof(long);
Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachException.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachException.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachException.cpp Thu Jul 19 11:39:59 2012
@@ -122,7 +122,6 @@
mach_msg_type_number_t *new_stateCnt
)
{
- kern_return_t kret;
if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
{
DNBLogThreaded("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = 0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { 0x%llx, 0x%llx })",
@@ -135,8 +134,8 @@
(uint64_t)(exc_data_count > 0 ? exc_data[0] : 0xBADDBADD),
(uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD));
}
- kret = mach_port_deallocate (mach_task_self (), task_port);
- kret = mach_port_deallocate (mach_task_self (), thread_port);
+ mach_port_deallocate (mach_task_self (), task_port);
+ mach_port_deallocate (mach_task_self (), thread_port);
return KERN_FAILURE;
}
@@ -229,7 +228,7 @@
if (desc < end_desc)
{
const char *sig_str = SysSignal::Name(soft_signal);
- desc += snprintf(desc, end_desc - desc, " EXC_SOFT_SIGNAL( %i ( %s ))", soft_signal, sig_str ? sig_str : "unknown signal");
+ snprintf(desc, end_desc - desc, " EXC_SOFT_SIGNAL( %i ( %s ))", soft_signal, sig_str ? sig_str : "unknown signal");
}
}
else
Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachProcess.cpp Thu Jul 19 11:39:59 2012
@@ -421,8 +421,7 @@
{
DisableAllBreakpoints (true);
DisableAllWatchpoints (true);
- // The static analyzer complains about this, but just leave the following line in.
- clear_bps_and_wps = false;
+ //clear_bps_and_wps = false;
}
uint32_t thread_idx = m_thread_list.GetThreadIndexForThreadStoppedWithSignal (SIGSTOP);
if (thread_idx_ptr)
@@ -1865,18 +1864,20 @@
// If our parent is setgid, lets make sure we don't inherit those
// extra powers due to nepotism.
- ::setgid (getgid ());
+ if (::setgid (getgid ()) == 0)
+ {
- // Let the child have its own process group. We need to execute
- // this call in both the child and parent to avoid a race condition
- // between the two processes.
- ::setpgid (0, 0); // Set the child process group to match its pid
+ // Let the child have its own process group. We need to execute
+ // this call in both the child and parent to avoid a race condition
+ // between the two processes.
+ ::setpgid (0, 0); // Set the child process group to match its pid
- // Sleep a bit to before the exec call
- ::sleep (1);
+ // Sleep a bit to before the exec call
+ ::sleep (1);
- // Turn this process into
- ::execv (path, (char * const *)argv);
+ // Turn this process into
+ ::execv (path, (char * const *)argv);
+ }
// Exit with error code. Child process should have taken
// over in above exec call and if the exec fails it will
// exit the child process below.
Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachThreadList.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/MacOSX/MachThreadList.cpp Thu Jul 19 11:39:59 2012
@@ -470,9 +470,9 @@
uint32_t
MachThreadList::EnableHardwareWatchpoint (const DNBBreakpoint* wp) const
{
+ uint32_t hw_index = INVALID_NUB_HW_INDEX;
if (wp != NULL)
{
- uint32_t hw_index;
PTHREAD_MUTEX_LOCKER (locker, m_threads_mutex);
const uint32_t num_threads = m_threads.size();
for (uint32_t idx = 0; idx < num_threads; ++idx)
@@ -492,9 +492,8 @@
// Use an arbitrary thread to signal the completion of our transaction.
if (num_threads)
m_threads[0]->HardwareWatchpointStateChanged();
- return hw_index;
}
- return INVALID_NUB_HW_INDEX;
+ return hw_index;
}
bool
Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/RNBRemote.cpp Thu Jul 19 11:39:59 2012
@@ -586,7 +586,7 @@
case '$':
// Look for a standard gdb packet?
end_idx = data.find('#', idx + 1);
- if (end_idx == std::string::npos || end_idx + 2 > data_size)
+ if (end_idx == std::string::npos || end_idx + 3 > data_size)
{
end_idx = std::string::npos;
}
@@ -594,7 +594,7 @@
{
// Add two for the checksum bytes and 1 to point to the
// byte just past the end of this packet
- end_idx += 2 + 1;
+ end_idx += 3;
}
break;
@@ -1674,7 +1674,7 @@
}
}
// Did we get a properly formatted logging bitmask?
- if (*p == ';')
+ if (p && *p == ';')
{
// Enable DNB logging
DNBLogSetLogCallback(ASLLogCallback, NULL);
@@ -2028,14 +2028,21 @@
register_value_in_hex_fixed_width (std::ostream& ostrm,
nub_process_t pid,
nub_thread_t tid,
- const register_map_entry_t* reg)
+ const register_map_entry_t* reg,
+ const DNBRegisterValue *reg_value_ptr)
{
if (reg != NULL)
{
- DNBRegisterValue val;
- if (DNBThreadGetRegisterValueByID (pid, tid, reg->nub_info.set, reg->nub_info.reg, &val))
+ DNBRegisterValue reg_value;
+ if (reg_value_ptr == NULL)
+ {
+ if (DNBThreadGetRegisterValueByID (pid, tid, reg->nub_info.set, reg->nub_info.reg, ®_value))
+ reg_value_ptr = ®_value;
+ }
+
+ if (reg_value_ptr)
{
- append_hex_value (ostrm, val.value.v_uint8, reg->gdb_size, false);
+ append_hex_value (ostrm, reg_value_ptr->value.v_uint8, reg->gdb_size, false);
}
else
{
@@ -2063,7 +2070,8 @@
gdb_regnum_with_fixed_width_hex_register_value (std::ostream& ostrm,
nub_process_t pid,
nub_thread_t tid,
- const register_map_entry_t* reg)
+ const register_map_entry_t* reg,
+ const DNBRegisterValue *reg_value_ptr)
{
// Output the register number as 'NN:VVVVVVVV;' where NN is a 2 bytes HEX
// gdb register number, and VVVVVVVV is the correct number of hex bytes
@@ -2071,7 +2079,7 @@
if (reg != NULL)
{
ostrm << RAWHEX8(reg->gdb_regnum) << ':';
- register_value_in_hex_fixed_width (ostrm, pid, tid, reg);
+ register_value_in_hex_fixed_width (ostrm, pid, tid, reg, reg_value_ptr);
ostrm << ';';
}
}
@@ -2173,15 +2181,18 @@
if (g_num_reg_entries == 0)
InitializeRegisters ();
- DNBRegisterValue reg_value;
- for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)
+ if (g_reg_entries != NULL)
{
- if (g_reg_entries[reg].expedite)
+ DNBRegisterValue reg_value;
+ for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)
{
- if (!DNBThreadGetRegisterValueByID (pid, tid, g_reg_entries[reg].nub_info.set, g_reg_entries[reg].nub_info.reg, ®_value))
- continue;
+ if (g_reg_entries[reg].expedite)
+ {
+ if (!DNBThreadGetRegisterValueByID (pid, tid, g_reg_entries[reg].nub_info.set, g_reg_entries[reg].nub_info.reg, ®_value))
+ continue;
- gdb_regnum_with_fixed_width_hex_register_value (ostrm, pid, tid, &g_reg_entries[reg]);
+ gdb_regnum_with_fixed_width_hex_register_value (ostrm, pid, tid, &g_reg_entries[reg], ®_value);
+ }
}
}
@@ -2496,7 +2507,7 @@
}
for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)
- register_value_in_hex_fixed_width (ostrm, pid, tid, &g_reg_entries[reg]);
+ register_value_in_hex_fixed_width (ostrm, pid, tid, &g_reg_entries[reg], NULL);
return SendPacket (ostrm.str ());
}
@@ -2695,7 +2706,6 @@
}
else if (strstr (p, "vCont") == p)
{
- rnb_err_t rnb_err = rnb_success;
typedef struct
{
nub_thread_t tid;
@@ -2747,7 +2757,7 @@
break;
default:
- rnb_err = HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Unsupported action in vCont packet");
+ HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Unsupported action in vCont packet");
break;
}
if (*c == ':')
@@ -3194,7 +3204,7 @@
}
else
{
- register_value_in_hex_fixed_width (ostrm, pid, tid, reg_entry);
+ register_value_in_hex_fixed_width (ostrm, pid, tid, reg_entry, NULL);
}
return SendPacket (ostrm.str());
}
@@ -3587,10 +3597,13 @@
if (cputype == CPU_TYPE_ARM)
{
strm << "ostype:ios;";
+ // On armv7 we use "synchronous" watchpoints which means the exception is delivered before the instruction executes.
+ strm << "watchpoint_exceptions_received:before;";
}
else
{
strm << "ostype:macosx;";
+ strm << "watchpoint_exceptions_received:after;";
}
// char ostype[64];
// len = sizeof(ostype);
Modified: lldb/branches/apple/python-GIL/tools/debugserver/source/debugserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/debugserver/source/debugserver.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/debugserver/source/debugserver.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/debugserver/source/debugserver.cpp Thu Jul 19 11:39:59 2012
@@ -1141,6 +1141,7 @@
int listen_port = INT32_MAX;
char str[PATH_MAX];
+ str[0] = '\0';
if (g_lockdown_opt == 0 && g_applist_opt == 0)
{
Modified: lldb/branches/apple/python-GIL/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/tools/driver/Driver.cpp?rev=160513&r1=160512&r2=160513&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/tools/driver/Driver.cpp (original)
+++ lldb/branches/apple/python-GIL/tools/driver/Driver.cpp Thu Jul 19 11:39:59 2012
@@ -722,7 +722,7 @@
{
// Skip any options we consumed with getopt_long
argc -= optind;
- argv += optind;
+ //argv += optind; // Commented out to keep static analyzer happy
if (argc > 0)
::fprintf (out_fh, "Warning: program arguments are ignored when attaching.\n");
More information about the lldb-commits
mailing list