[Lldb-commits] [lldb] r156833 - in /lldb/branches/lldb-platform-work: ./ examples/darwin/heap_find/ examples/summaries/cocoa/ include/lldb/API/ include/lldb/Target/ scripts/Python/ scripts/Python/interface/ source/API/ source/Commands/ source/Expression/ source/Host/common/ source/Interpreter/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/Platform/MacOSX/ source/Plugins/Process/Utility/ source/Plugins/Process/gdb-remote/ source/Plugins/SymbolFile/DWARF/ source/Target/ test/expression_command/issu...
Johnny Chen
johnny.chen at apple.com
Tue May 15 11:30:50 PDT 2012
Author: johnny
Date: Tue May 15 13:30:50 2012
New Revision: 156833
URL: http://llvm.org/viewvc/llvm-project?rev=156833&view=rev
Log:
Merge changes from ToT. Conflicts resolved: Platform.cpp and PlatformDarwin.cpp.
Added:
lldb/branches/lldb-platform-work/test/lang/c/stepping/TestStepAndBreakpoints.py
- copied unchanged from r156797, lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py
Modified:
lldb/branches/lldb-platform-work/ (props changed)
lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py
lldb/branches/lldb-platform-work/examples/summaries/cocoa/CFString.py
lldb/branches/lldb-platform-work/include/lldb/API/SBFrame.h
lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h
lldb/branches/lldb-platform-work/include/lldb/Target/Target.h
lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h
lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i
lldb/branches/lldb-platform-work/scripts/Python/interface/SBValueList.i
lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig
lldb/branches/lldb-platform-work/source/API/SBFrame.cpp
lldb/branches/lldb-platform-work/source/API/SBThread.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectLog.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp
lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp
lldb/branches/lldb-platform-work/source/Host/common/Host.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp
lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/branches/lldb-platform-work/source/Target/Platform.cpp
lldb/branches/lldb-platform-work/source/Target/Target.cpp
lldb/branches/lldb-platform-work/source/Target/Thread.cpp
lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp
lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallUserExpression.cpp
lldb/branches/lldb-platform-work/test/expression_command/issue_11588/Test11588.py
lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m
lldb/branches/lldb-platform-work/test/lang/c/stepping/main.c
lldb/branches/lldb-platform-work/www/lldb-gdb.html
Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 15 13:30:50 2012
@@ -1 +1 @@
-/lldb/trunk:154223-156605
+/lldb/trunk:154223-156797
Modified: lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py (original)
+++ lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py Tue May 15 13:30:50 2012
@@ -126,12 +126,10 @@
def dump_stack_history_entries(addr, history):
# malloc_stack_entry *get_stack_history_for_address (const void * addr)
expr = 'get_stack_history_for_address((void *)0x%x, %u)' % (addr, history)
- print 'expr = "%s"' % (expr)
expr_sbvalue = lldb.frame.EvaluateExpression (expr)
if expr_sbvalue.error.Success():
if expr_sbvalue.unsigned:
expr_value = lldb.value(expr_sbvalue)
- #print 'expr_value = ', expr_value
idx = 0;
stack_history_entry = expr_value[idx]
while int(stack_history_entry.address) != 0:
Modified: lldb/branches/lldb-platform-work/examples/summaries/cocoa/CFString.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/summaries/cocoa/CFString.py?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/summaries/cocoa/CFString.py (original)
+++ lldb/branches/lldb-platform-work/examples/summaries/cocoa/CFString.py Tue May 15 13:30:50 2012
@@ -65,14 +65,14 @@
return 0;
return 6;
- def read_unicode(self, pointer):
+ def read_unicode(self, pointer,max_len=2048):
logger = lldb.formatters.Logger.Logger()
process = self.valobj.GetTarget().GetProcess()
error = lldb.SBError()
pystr = u''
# cannot do the read at once because the length value has
# a weird encoding. better play it safe here
- while True:
+ while max_len > 0:
content = process.ReadMemory(pointer, 2, error)
new_bytes = bytearray(content)
b0 = new_bytes[0]
@@ -89,6 +89,8 @@
else:
value = b0 * 256 + b1
pystr = pystr + unichr(value)
+ # read max_len unicode values, not max_len bytes
+ max_len = max_len - 1
return pystr
# handle the special case strings
@@ -150,8 +152,11 @@
data = self.valobj.CreateChildAtOffset("content",
offset, self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar).GetPointerType());
data_value = data.GetValueAsUnsigned(0)
- data_value = data_value + 1
- return self.valobj.CreateValueFromExpression("content", "(char*)(" + str(data_value) + ")")
+ if self.explicit and self.unicode:
+ return self.read_unicode(data_value).encode('utf-8')
+ else:
+ data_value = data_value + 1
+ return self.valobj.CreateValueFromExpression("content", "(char*)(" + str(data_value) + ")")
def handle_UTF8_inline(self):
logger = lldb.formatters.Logger.Logger()
Modified: lldb/branches/lldb-platform-work/include/lldb/API/SBFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/API/SBFrame.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/API/SBFrame.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/API/SBFrame.h Tue May 15 13:30:50 2012
@@ -103,6 +103,9 @@
lldb::SBValue
EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic);
+ lldb::SBValue
+ EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic, bool unwind_on_error);
+
/// Gets the lexical block that defines the stack frame. Another way to think
/// of this is it will return the block that contains all of the variables
/// for a stack frame. Inlined functions are represented as SBBlock objects
Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Platform.h Tue May 15 13:30:50 2012
@@ -369,6 +369,15 @@
virtual bool
GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info);
+
+ //------------------------------------------------------------------
+ // Set a breakpoint on all functions that can end up creating a thread
+ // for this platform. This is needed when running expressions and
+ // also for process control.
+ //------------------------------------------------------------------
+ virtual lldb::BreakpointSP
+ SetThreadCreationBreakpoint (Target &target);
+
const std::string &
GetRemoteURL () const
Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Target.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Target.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Target.h Tue May 15 13:30:50 2012
@@ -500,8 +500,8 @@
lldb::BreakpointSP
CreateBreakpoint (const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
- std::vector<std::string> func_names,
- uint32_t func_name_type_mask,
+ const std::vector<std::string> &func_names,
+ uint32_t func_name_type_mask,
bool internal = false,
LazyBool skip_prologue = eLazyBoolCalculate);
Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ThreadPlanCallFunction.h Tue May 15 13:30:50 2012
@@ -133,7 +133,6 @@
bool
ConstructorSetup (Thread &thread,
- bool discard_on_error,
ABI *& abi,
lldb::addr_t &start_load_addr,
lldb::addr_t &function_load_addr);
@@ -170,6 +169,7 @@
lldb::ValueObjectSP m_return_valobj_sp; // If this contains a valid pointer, use the ABI to extract values when complete
bool m_takedown_done; // We want to ensure we only do the takedown once. This ensures that.
lldb::addr_t m_stop_address; // This is the address we stopped at. Also set in DoTakedown;
+ bool m_discard_on_error;
DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallFunction);
};
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i Tue May 15 13:30:50 2012
@@ -116,7 +116,7 @@
def __len__(self):
if self.sbblock:
- return self.sbblock.GetNumRanges()
+ return int(self.sbblock.GetNumRanges())
return 0
def __getitem__(self, key):
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i Tue May 15 13:30:50 2012
@@ -156,7 +156,7 @@
else:
return my_data
def __len__(self):
- return self.sbdata.GetByteSize()/self.item_size
+ return int(self.sbdata.GetByteSize()/self.item_size)
def all(self):
return self[0:len(self)]
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i Tue May 15 13:30:50 2012
@@ -137,6 +137,9 @@
lldb::SBValue
EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic);
+ lldb::SBValue
+ EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic, bool unwind_on_error);
+
%feature("docstring", "
/// Gets the lexical block that defines the stack frame. Another way to think
/// of this is it will return the block that contains all of the variables
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i Tue May 15 13:30:50 2012
@@ -62,7 +62,7 @@
%pythoncode %{
def __len__(self):
'''Access len of the instruction list.'''
- return self.GetSize();
+ return int(self.GetSize())
def __getitem__(self, key):
'''Access instructions by integer index.'''
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i Tue May 15 13:30:50 2012
@@ -259,7 +259,7 @@
def __len__(self):
if self.sbmodule:
- return self.sbmodule.GetNumSymbols()
+ return int(self.sbmodule.GetNumSymbols())
return 0
def __getitem__(self, key):
@@ -315,7 +315,7 @@
def __len__(self):
if self.sbmodule:
- return self.sbmodule.GetNumSections()
+ return int(self.sbmodule.GetNumSections())
return 0
def __getitem__(self, key):
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i Tue May 15 13:30:50 2012
@@ -321,7 +321,8 @@
self.sbprocess = sbprocess
def __len__(self):
- if self.sbprocess: return self.sbprocess.GetNumThreads()
+ if self.sbprocess:
+ return int(self.sbprocess.GetNumThreads())
return 0
def __getitem__(self, key):
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i Tue May 15 13:30:50 2012
@@ -62,7 +62,7 @@
%pythoncode %{
def __len__(self):
- return self.GetSize()
+ return int(self.GetSize())
def __getitem__(self, key):
count = len(self)
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i Tue May 15 13:30:50 2012
@@ -691,7 +691,7 @@
def __len__(self):
if self.sbtarget:
- return self.sbtarget.GetNumModules()
+ return int(self.sbtarget.GetNumModules())
return 0
def __getitem__(self, key):
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i Tue May 15 13:30:50 2012
@@ -182,7 +182,7 @@
def __len__(self):
if self.sbthread:
- return self.sbthread.GetNumFrames()
+ return int(self.sbthread.GetNumFrames())
return 0
def __getitem__(self, key):
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBValueList.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBValueList.i?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBValueList.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBValueList.i Tue May 15 13:30:50 2012
@@ -98,8 +98,8 @@
FindValueObjectByUID (lldb::user_id_t uid);
%pythoncode %{
def __len__(self):
- return self.GetSize()
-
+ return int(self.GetSize())
+
def __getitem__(self, key):
count = len(self)
#------------------------------------------------------------
Modified: lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/python-typemaps.swig Tue May 15 13:30:50 2012
@@ -116,11 +116,14 @@
// typemap for an incoming buffer
// See also SBProcess::ReadMemory.
%typemap(in) (void *buf, size_t size) {
- if (!PyInt_Check($input)) {
- PyErr_SetString(PyExc_ValueError, "Expecting an integer");
- return NULL;
+ if (PyInt_Check($input)) {
+ $2 = PyInt_AsLong($input);
+ } else if (PyLong_Check($input)) {
+ $2 = PyLong_AsLong($input);
+ } else {
+ PyErr_SetString(PyExc_ValueError, "Expecting an integer or long object");
+ return NULL;
}
- $2 = PyInt_AsLong($input);
if ($2 <= 0) {
PyErr_SetString(PyExc_ValueError, "Positive integer expected");
return NULL;
@@ -329,4 +332,4 @@
%typemap(freearg) (uint32_t *versions) {
free($1);
-}
\ No newline at end of file
+}
Modified: lldb/branches/lldb-platform-work/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFrame.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFrame.cpp Tue May 15 13:30:50 2012
@@ -1028,6 +1028,12 @@
SBValue
SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value)
{
+ return EvaluateExpression (expr, fetch_dynamic_value, true);
+}
+
+SBValue
+SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error)
+{
LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
LogSP expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -1056,7 +1062,6 @@
expr, fetch_dynamic_value, frame_description.GetString().c_str());
const bool coerce_to_id = false;
- const bool unwind_on_error = true;
const bool keep_in_memory = false;
exe_results = target->EvaluateExpression (expr,
Modified: lldb/branches/lldb-platform-work/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBThread.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBThread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBThread.cpp Tue May 15 13:30:50 2012
@@ -531,7 +531,7 @@
{
Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
Thread *thread = exe_ctx.GetThreadPtr();
- bool abort_other_plans = true;
+ bool abort_other_plans = false;
StackFrameSP frame_sp(thread->GetStackFrameAtIndex (0));
ThreadPlan *new_plan = NULL;
@@ -574,7 +574,7 @@
if (exe_ctx.HasThreadScope())
{
Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
- bool abort_other_plans = true;
+ bool abort_other_plans = false;
Thread *thread = exe_ctx.GetThreadPtr();
StackFrameSP frame_sp(thread->GetStackFrameAtIndex (0));
@@ -616,7 +616,7 @@
if (exe_ctx.HasThreadScope())
{
Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
- bool abort_other_plans = true;
+ bool abort_other_plans = false;
bool stop_other_threads = true;
Thread *thread = exe_ctx.GetThreadPtr();
@@ -651,7 +651,7 @@
if (exe_ctx.HasThreadScope())
{
Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
- bool abort_other_plans = true;
+ bool abort_other_plans = false;
bool stop_other_threads = true;
Thread *thread = exe_ctx.GetThreadPtr();
@@ -703,7 +703,7 @@
if (exe_ctx.HasThreadScope())
{
Mutex::Locker api_locker (exe_ctx.GetTargetPtr()->GetAPIMutex());
- bool abort_other_plans = true;
+ bool abort_other_plans = false;
bool stop_other_threads = true;
Address target_addr (addr);
@@ -806,7 +806,7 @@
AddressRange fun_range = frame_sc.function->GetAddressRange();
std::vector<addr_t> step_over_until_addrs;
- const bool abort_other_plans = true;
+ const bool abort_other_plans = false;
const bool stop_other_threads = true;
const bool check_inlines = true;
const bool exact = false;
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectLog.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectLog.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectLog.cpp Tue May 15 13:30:50 2012
@@ -114,9 +114,9 @@
Execute (Args& args,
CommandReturnObject &result)
{
- if (args.GetArgumentCount() < 1)
+ if (args.GetArgumentCount() < 2)
{
- result.AppendErrorWithFormat("Usage: %s\n", m_cmd_syntax.c_str());
+ result.AppendErrorWithFormat("%s takes a log channel and one or more log types.\n", m_cmd_name.c_str());
}
else
{
@@ -264,7 +264,7 @@
const size_t argc = args.GetArgumentCount();
if (argc == 0)
{
- result.AppendErrorWithFormat("Usage: %s\n", m_cmd_syntax.c_str());
+ result.AppendErrorWithFormat("%s takes a log channel and one or more log types.\n", m_cmd_name.c_str());
}
else
{
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp Tue May 15 13:30:50 2012
@@ -946,7 +946,7 @@
return false;
}
- const bool abort_other_plans = true;
+ const bool abort_other_plans = false;
StackFrame *frame = thread->GetStackFrameAtIndex(m_options.m_frame_idx).get();
if (frame == NULL)
Modified: lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp Tue May 15 13:30:50 2012
@@ -410,6 +410,8 @@
discard_on_error,
this_arg,
cmd_arg);
+ new_plan->SetIsMasterPlan(true);
+ new_plan->SetOkayToDiscard (false);
return new_plan;
}
Modified: lldb/branches/lldb-platform-work/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/common/Host.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/common/Host.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Host/common/Host.cpp Tue May 15 13:30:50 2012
@@ -371,12 +371,9 @@
if (!g_vendor)
{
#if defined (__APPLE__)
- char ostype[64];
- size_t len = sizeof(ostype);
- if (::sysctlbyname("kern.ostype", &ostype, &len, NULL, 0) == 0)
- g_vendor.SetCString (ostype);
- else
- g_vendor.SetCString("apple");
+ const ArchSpec &host_arch = GetArchitecture (eSystemDefaultArchitecture);
+ const llvm::StringRef &str_ref = host_arch.GetTriple().getVendorName();
+ g_vendor.SetCStringWithLength(str_ref.data(), str_ref.size());
#elif defined (__linux__)
g_vendor.SetCString("gnu");
#elif defined (__FreeBSD__)
@@ -393,7 +390,9 @@
if (!g_os_string)
{
#if defined (__APPLE__)
- g_os_string.SetCString("darwin");
+ const ArchSpec &host_arch = GetArchitecture (eSystemDefaultArchitecture);
+ const llvm::StringRef &str_ref = host_arch.GetTriple().getOSName();
+ g_os_string.SetCStringWithLength(str_ref.data(), str_ref.size());
#elif defined (__linux__)
g_os_string.SetCString("linux");
#elif defined (__FreeBSD__)
@@ -409,18 +408,8 @@
static ConstString g_host_triple;
if (!(g_host_triple))
{
- StreamString triple;
- triple.Printf("%s-%s-%s",
- GetArchitecture().GetArchitectureName(),
- GetVendorString().AsCString(),
- GetOSString().AsCString());
-
- std::transform (triple.GetString().begin(),
- triple.GetString().end(),
- triple.GetString().begin(),
- ::tolower);
-
- g_host_triple.SetCString(triple.GetString().c_str());
+ const ArchSpec &host_arch = GetArchitecture (eSystemDefaultArchitecture);
+ g_host_triple.SetCString(host_arch.GetTriple().getTriple().c_str());
}
return g_host_triple;
}
@@ -1238,19 +1227,22 @@
lldb::TargetSP
Host::GetDummyTarget (lldb_private::Debugger &debugger)
{
- static TargetSP dummy_target;
+ static TargetSP g_dummy_target_sp;
- if (!dummy_target)
+ if (!g_dummy_target_sp)
{
+ ArchSpec arch(Target::GetDefaultArchitecture());
+ if (!arch.IsValid())
+ arch = Host::GetArchitecture ();
Error err = debugger.GetTargetList().CreateTarget(debugger,
FileSpec(),
- Host::GetTargetTriple().AsCString(),
+ arch.GetTriple().getTriple().c_str(),
false,
NULL,
- dummy_target);
+ g_dummy_target_sp);
}
- return dummy_target;
+ return g_dummy_target_sp;
}
struct ShellInfo
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp Tue May 15 13:30:50 2012
@@ -34,7 +34,7 @@
platform_sp = Platform::Create (m_platform_name.c_str(), error);
if (platform_sp)
{
- if (!platform_sp->IsCompatibleArchitecture(arch, &platform_arch))
+ if (platform_arch.IsValid() && !platform_sp->IsCompatibleArchitecture(arch, &platform_arch))
{
error.SetErrorStringWithFormat("platform '%s' doesn't support '%s'", platform_sp->GetName(), arch.GetTriple().getTriple().c_str());
platform_sp.reset();
Modified: lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp Tue May 15 13:30:50 2012
@@ -65,12 +65,8 @@
void
AppleThreadPlanStepThroughObjCTrampoline::DidPush ()
{
-// StreamString errors;
-// ExecutionContext exc_ctx;
-// m_thread.CalculateExecutionContext(exc_ctx);
-// m_func_sp.reset(m_impl_function->GetThreadPlanToCallFunction (exc_ctx, m_args_addr, errors, m_stop_others));
-// m_func_sp->SetPrivate(true);
-// m_thread.QueueThreadPlan (m_func_sp, false);
+ // Setting up the memory space for the called function text might require allocations,
+ // i.e. a nested function call. This needs to be done as a PreResumeAction.
m_thread.GetProcess()->AddPreResumeAction (PreResumeInitializeClangFunction, (void *) this);
}
@@ -91,6 +87,7 @@
m_thread.CalculateExecutionContext(exc_ctx);
m_func_sp.reset(m_impl_function->GetThreadPlanToCallFunction (exc_ctx, m_args_addr, errors, m_stop_others));
m_func_sp->SetPrivate(true);
+ m_func_sp->SetOkayToDiscard(true);
m_thread.QueueThreadPlan (m_func_sp, false);
}
return true;
Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue May 15 13:30:50 2012
@@ -962,3 +962,39 @@
return m_developer_directory.c_str();
return NULL;
}
+
+
+BreakpointSP
+PlatformDarwin::SetThreadCreationBreakpoint (Target &target)
+{
+ BreakpointSP bp_sp;
+ static const char *g_bp_names[] =
+ {
+ "start_wqthread",
+ "_pthread_wqthread",
+ "_pthread_start",
+ };
+
+ static const char *g_bp_modules[] =
+ {
+ "libsystem_c.dylib",
+ "libSystem.B.dylib"
+ };
+
+ FileSpecList bp_modules;
+ for (int i = 0; i < sizeof(g_bp_modules)/sizeof(const char *); i++)
+ {
+ const char *bp_module = g_bp_modules[i];
+ bp_modules.Append(FileSpec(bp_module, false));
+ }
+
+ bp_sp = target.CreateBreakpoint (&bp_modules,
+ NULL,
+ g_bp_names,
+ sizeof(g_bp_names)/sizeof(const char *),
+ eFunctionNameTypeFull,
+ true);
+
+ return bp_sp;
+}
+
Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformDarwin.h Tue May 15 13:30:50 2012
@@ -79,6 +79,9 @@
GetProcessInfo (lldb::pid_t pid,
lldb_private::ProcessInstanceInfo &proc_info);
+ virtual lldb::BreakpointSP
+ SetThreadCreationBreakpoint (lldb_private::Target &target);
+
virtual uint32_t
FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info,
lldb_private::ProcessInstanceInfoList &process_infos);
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp Tue May 15 13:30:50 2012
@@ -90,6 +90,10 @@
if (call_plan_sp)
{
StreamFile error_strm;
+ // This plan is a utility plan, so set it to discard itself when done.
+ call_plan_sp->SetIsMasterPlan (true);
+ call_plan_sp->SetOkayToDiscard(true);
+
StackFrame *frame = thread->GetStackFrameAtIndex (0).get();
if (frame)
{
@@ -164,6 +168,10 @@
if (call_plan_sp)
{
StreamFile error_strm;
+ // This plan is a utility plan, so set it to discard itself when done.
+ call_plan_sp->SetIsMasterPlan (true);
+ call_plan_sp->SetOkayToDiscard(true);
+
StackFrame *frame = thread->GetStackFrameAtIndex (0).get();
if (frame)
{
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue May 15 13:30:50 2012
@@ -436,10 +436,10 @@
const uint8_t signo = response.GetHexU8 (UINT8_MAX);
- bool continue_after_aync = false;
+ bool continue_after_async = false;
if (m_async_signal != -1 || m_async_packet_predicate.GetValue())
{
- continue_after_aync = true;
+ continue_after_async = true;
// We sent an interrupt packet to stop the inferior process
// for an async signal or to send an async packet while running
// but we might have been single stepping and received the
@@ -454,7 +454,7 @@
// a lot of trouble for us!
if (signo != SIGINT && signo != SIGSTOP)
{
- continue_after_aync = false;
+ continue_after_async = false;
// We didn't get a a SIGINT or SIGSTOP, so try for a
// very brief time (1 ms) to get another stop reply
@@ -471,7 +471,7 @@
// our interrupt didn't stop the target so we
// shouldn't continue after the async signal
// or packet is sent...
- continue_after_aync = false;
+ continue_after_async = false;
break;
}
}
@@ -515,7 +515,7 @@
Host::GetSignalAsCString (async_signal));
// Set the continue packet to resume even if the
- // interrupt didn't cause our stop (ignore continue_after_aync)
+ // interrupt didn't cause our stop (ignore continue_after_async)
continue_packet.assign(signal_packet, signal_packet_len);
continue;
}
@@ -549,13 +549,13 @@
m_async_packet_predicate.SetValue(false, eBroadcastAlways);
if (packet_log)
- packet_log->Printf ("async: sent packet, continue_after_aync = %i", continue_after_aync);
+ packet_log->Printf ("async: sent packet, continue_after_async = %i", continue_after_async);
// Set the continue packet to resume if our interrupt
// for the async packet did cause the stop
- if (continue_after_aync)
+ if (continue_after_async)
{
- continue_packet.assign (1, 'c');
+ //continue_packet.assign (1, 'c');
continue;
}
}
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue May 15 13:30:50 2012
@@ -18,6 +18,7 @@
#include "lldb/Core/Scalar.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Utility/Utils.h"
// Project includes
#include "Utility/StringExtractorGDBRemote.h"
#include "ProcessGDBRemote.h"
@@ -691,7 +692,7 @@
}
void
-GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters()
+GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch)
{
// For Advanced SIMD and VFP register mapping.
static uint32_t g_d0_regs[] = { 26, 27, LLDB_INVALID_REGNUM }; // (s0, s1)
@@ -727,6 +728,14 @@
static uint32_t g_q14_regs[] = { 71, 72, LLDB_INVALID_REGNUM }; // (d28, d29)
static uint32_t g_q15_regs[] = { 73, 74, LLDB_INVALID_REGNUM }; // (d30, d31)
+ // This is our array of composite registers, with each element coming from the above register mappings.
+ static uint32_t *g_composites[] = {
+ g_d0_regs, g_d1_regs, g_d2_regs, g_d3_regs, g_d4_regs, g_d5_regs, g_d6_regs, g_d7_regs,
+ g_d8_regs, g_d9_regs, g_d10_regs, g_d11_regs, g_d12_regs, g_d13_regs, g_d14_regs, g_d15_regs,
+ g_q0_regs, g_q1_regs, g_q2_regs, g_q3_regs, g_q4_regs, g_q5_regs, g_q6_regs, g_q7_regs,
+ g_q8_regs, g_q9_regs, g_q10_regs, g_q11_regs, g_q12_regs, g_q13_regs, g_q14_regs, g_q15_regs
+ };
+
static RegisterInfo g_register_infos[] = {
// NAME ALT SZ OFF ENCODING FORMAT COMPILER DWARF GENERIC GDB LLDB VALUE REGS INVALIDATE REGS
// ====== ====== === === ============= ============ =================== =================== ====================== === ==== ========== ===============
@@ -839,51 +848,84 @@
{ "q15", NULL, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15, LLDB_INVALID_REGNUM, 106, 106 }, g_q15_regs, NULL}
};
- static const uint32_t num_registers = sizeof (g_register_infos)/sizeof (RegisterInfo);
+ static const uint32_t num_registers = arraysize(g_register_infos);
static ConstString gpr_reg_set ("General Purpose Registers");
static ConstString sfp_reg_set ("Software Floating Point Registers");
static ConstString vfp_reg_set ("Floating Point Registers");
uint32_t i;
- // Calculate the offsets of the registers
- // Note that the layout of the "composite" registers (d0-d15 and q0-q15) which comes after the
- // "primordial" registers is important. This enables us to calculate the offset of the composite
- // register by using the offset of its first primordial register. For example, to calculate the
- // offset of q0, use s0's offset.
- if (g_register_infos[2].byte_offset == 0)
+ if (from_scratch)
{
- uint32_t byte_offset = 0;
- for (i=0; i<num_registers; ++i)
+ // Calculate the offsets of the registers
+ // Note that the layout of the "composite" registers (d0-d15 and q0-q15) which comes after the
+ // "primordial" registers is important. This enables us to calculate the offset of the composite
+ // register by using the offset of its first primordial register. For example, to calculate the
+ // offset of q0, use s0's offset.
+ if (g_register_infos[2].byte_offset == 0)
{
- // For primordial registers, increment the byte_offset by the byte_size to arrive at the
- // byte_offset for the next register. Otherwise, we have a composite register whose
- // offset can be calculated by consulting the offset of its first primordial register.
- if (!g_register_infos[i].value_regs)
+ uint32_t byte_offset = 0;
+ for (i=0; i<num_registers; ++i)
{
- g_register_infos[i].byte_offset = byte_offset;
- byte_offset += g_register_infos[i].byte_size;
+ // For primordial registers, increment the byte_offset by the byte_size to arrive at the
+ // byte_offset for the next register. Otherwise, we have a composite register whose
+ // offset can be calculated by consulting the offset of its first primordial register.
+ if (!g_register_infos[i].value_regs)
+ {
+ g_register_infos[i].byte_offset = byte_offset;
+ byte_offset += g_register_infos[i].byte_size;
+ }
+ else
+ {
+ const uint32_t first_primordial_reg = g_register_infos[i].value_regs[0];
+ g_register_infos[i].byte_offset = g_register_infos[first_primordial_reg].byte_offset;
+ }
}
+ }
+ for (i=0; i<num_registers; ++i)
+ {
+ ConstString name;
+ ConstString alt_name;
+ if (g_register_infos[i].name && g_register_infos[i].name[0])
+ name.SetCString(g_register_infos[i].name);
+ if (g_register_infos[i].alt_name && g_register_infos[i].alt_name[0])
+ alt_name.SetCString(g_register_infos[i].alt_name);
+
+ if (i <= 15 || i == 25)
+ AddRegister (g_register_infos[i], name, alt_name, gpr_reg_set);
+ else if (i <= 24)
+ AddRegister (g_register_infos[i], name, alt_name, sfp_reg_set);
else
- {
- const uint32_t first_primordial_reg = g_register_infos[i].value_regs[0];
- g_register_infos[i].byte_offset = g_register_infos[first_primordial_reg].byte_offset;
- }
+ AddRegister (g_register_infos[i], name, alt_name, vfp_reg_set);
}
}
- for (i=0; i<num_registers; ++i)
+ else
{
- ConstString name;
- ConstString alt_name;
- if (g_register_infos[i].name && g_register_infos[i].name[0])
- name.SetCString(g_register_infos[i].name);
- if (g_register_infos[i].alt_name && g_register_infos[i].alt_name[0])
- alt_name.SetCString(g_register_infos[i].alt_name);
-
- if (i <= 15 || i == 25)
- AddRegister (g_register_infos[i], name, alt_name, gpr_reg_set);
- else if (i <= 24)
- AddRegister (g_register_infos[i], name, alt_name, sfp_reg_set);
- else
- AddRegister (g_register_infos[i], name, alt_name, vfp_reg_set);
+ // Add composite registers to our primordial registers, then.
+ const uint32_t num_composites = arraysize(g_composites);
+ const uint32_t num_primordials = GetNumRegisters();
+ RegisterInfo *g_comp_register_infos = g_register_infos + (num_registers - num_composites);
+ for (i=0; i<num_composites; ++i)
+ {
+ ConstString name;
+ ConstString alt_name;
+ const uint32_t first_primordial_reg = g_comp_register_infos[i].value_regs[0];
+ const char *reg_name = g_register_infos[first_primordial_reg].name;
+ if (reg_name && reg_name[0])
+ {
+ for (uint32_t j = 0; j < num_primordials; ++j)
+ {
+ const RegisterInfo *reg_info = GetRegisterInfoAtIndex(j);
+ // Find a matching primordial register info entry.
+ if (reg_info && reg_info->name && ::strcasecmp(reg_info->name, reg_name) == 0)
+ {
+ // The name matches the existing primordial entry.
+ // Find and assign the offset, and then add this composite register entry.
+ g_comp_register_infos[i].byte_offset = reg_info->byte_offset;
+ name.SetCString(g_comp_register_infos[i].name);
+ AddRegister(g_comp_register_infos[i], name, alt_name, vfp_reg_set);
+ }
+ }
+ }
+ }
}
}
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h Tue May 15 13:30:50 2012
@@ -154,7 +154,7 @@
}
void
- HardcodeARMRegisters();
+ HardcodeARMRegisters(bool from_scratch);
protected:
//------------------------------------------------------------------
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue May 15 13:30:50 2012
@@ -173,8 +173,9 @@
m_continue_S_tids (),
m_dispatch_queue_offsets_addr (LLDB_INVALID_ADDRESS),
m_max_memory_size (512),
- m_waiting_for_attach (false),
- m_thread_observation_bps()
+ m_addr_to_mmap_size (),
+ m_thread_create_bp_sp (),
+ m_waiting_for_attach (false)
{
m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit, "async thread should exit");
m_async_broadcaster.SetEventName (eBroadcastBitAsyncContinue, "async thread continue");
@@ -378,25 +379,28 @@
}
}
- if (reg_num == 0)
+ // We didn't get anything if the accumulated reg_num is zero. See if we are
+ // debugging ARM and fill with a hard coded register set until we can get an
+ // updated debugserver down on the devices.
+ // On the other hand, if the accumulated reg_num is positive, see if we can
+ // add composite registers to the existing primordial ones.
+ bool from_scratch = (reg_num == 0);
+
+ const ArchSpec &target_arch = GetTarget().GetArchitecture();
+ const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
+ if (!target_arch.IsValid())
{
- // We didn't get anything. See if we are debugging ARM and fill with
- // a hard coded register set until we can get an updated debugserver
- // down on the devices.
- const ArchSpec &target_arch = GetTarget().GetArchitecture();
- const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
- if (!target_arch.IsValid())
- {
- if (remote_arch.IsValid()
- && remote_arch.GetMachine() == llvm::Triple::arm
- && remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
- m_register_info.HardcodeARMRegisters();
- }
- else if (target_arch.GetMachine() == llvm::Triple::arm)
- {
- m_register_info.HardcodeARMRegisters();
- }
+ if (remote_arch.IsValid()
+ && remote_arch.GetMachine() == llvm::Triple::arm
+ && remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
+ m_register_info.HardcodeARMRegisters(from_scratch);
}
+ else if (target_arch.GetMachine() == llvm::Triple::arm)
+ {
+ m_register_info.HardcodeARMRegisters(from_scratch);
+ }
+
+ // At this point, we can finalize our register info.
m_register_info.Finalize ();
}
@@ -2669,51 +2673,33 @@
bool
ProcessGDBRemote::StartNoticingNewThreads()
{
- static const char *bp_names[] =
- {
- "start_wqthread",
- "_pthread_wqthread",
- "_pthread_start",
- NULL
- };
-
LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
- size_t num_bps = m_thread_observation_bps.size();
- if (num_bps != 0)
+ if (m_thread_create_bp_sp)
{
- for (int i = 0; i < num_bps; i++)
- {
- lldb::BreakpointSP break_sp = m_target.GetBreakpointByID(m_thread_observation_bps[i]);
- if (break_sp)
- {
- if (log && log->GetVerbose())
- log->Printf("Enabled noticing new thread breakpoint.");
- break_sp->SetEnabled(true);
- }
- }
+ if (log && log->GetVerbose())
+ log->Printf("Enabled noticing new thread breakpoint.");
+ m_thread_create_bp_sp->SetEnabled(true);
}
- else
+ else
{
- for (int i = 0; bp_names[i] != NULL; i++)
+ PlatformSP platform_sp (m_target.GetPlatform());
+ if (platform_sp)
{
- Breakpoint *breakpoint = m_target.CreateBreakpoint (NULL, NULL, bp_names[i], eFunctionNameTypeFull, true).get();
- if (breakpoint)
+ m_thread_create_bp_sp = platform_sp->SetThreadCreationBreakpoint(m_target);
+ if (m_thread_create_bp_sp)
{
if (log && log->GetVerbose())
- log->Printf("Successfully created new thread notification breakpoint at \"%s\".", bp_names[i]);
- m_thread_observation_bps.push_back(breakpoint->GetID());
- breakpoint->SetCallback (ProcessGDBRemote::NewThreadNotifyBreakpointHit, this, true);
+ log->Printf("Successfully created new thread notification breakpoint %i", m_thread_create_bp_sp->GetID());
+ m_thread_create_bp_sp->SetCallback (ProcessGDBRemote::NewThreadNotifyBreakpointHit, this, true);
}
else
{
if (log)
log->Printf("Failed to create new thread notification breakpoint.");
- return false;
}
}
}
-
- return true;
+ return m_thread_create_bp_sp.get() != NULL;
}
bool
@@ -2722,19 +2708,10 @@
LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
if (log && log->GetVerbose())
log->Printf ("Disabling new thread notification breakpoint.");
- size_t num_bps = m_thread_observation_bps.size();
- if (num_bps != 0)
- {
- for (int i = 0; i < num_bps; i++)
- {
-
- lldb::BreakpointSP break_sp = m_target.GetBreakpointByID(m_thread_observation_bps[i]);
- if (break_sp)
- {
- break_sp->SetEnabled(false);
- }
- }
- }
+
+ if (m_thread_create_bp_sp)
+ m_thread_create_bp_sp->SetEnabled(false);
+
return true;
}
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Tue May 15 13:30:50 2012
@@ -315,9 +315,10 @@
tid_sig_collection m_continue_S_tids; // 'S' for step with signal
lldb::addr_t m_dispatch_queue_offsets_addr;
size_t m_max_memory_size; // The maximum number of bytes to read/write when reading and writing memory
- bool m_waiting_for_attach;
- std::vector<lldb::user_id_t> m_thread_observation_bps;
MMapMap m_addr_to_mmap_size;
+ lldb::BreakpointSP m_thread_create_bp_sp;
+ bool m_waiting_for_attach;
+
bool
StartAsyncThread ();
Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue May 15 13:30:50 2012
@@ -4858,6 +4858,135 @@
return type_sp;
}
+bool
+SymbolFileDWARF::CopyUniqueClassMethodTypes (Type *class_type,
+ DWARFCompileUnit* src_cu,
+ const DWARFDebugInfoEntry *src_class_die,
+ DWARFCompileUnit* dst_cu,
+ const DWARFDebugInfoEntry *dst_class_die)
+{
+ if (!class_type || !src_cu || !src_class_die || !dst_cu || !dst_class_die)
+ return false;
+ if (src_class_die->Tag() != dst_class_die->Tag())
+ return false;
+
+ // We need to complete the class type so we can get all of the method types
+ // parsed so we can then unique those types to their equivalent counterparts
+ // in "dst_cu" and "dst_class_die"
+ class_type->GetClangFullType();
+
+ const DWARFDebugInfoEntry *src_die;
+ const DWARFDebugInfoEntry *dst_die;
+ UniqueCStringMap<const DWARFDebugInfoEntry *> src_name_to_die;
+ UniqueCStringMap<const DWARFDebugInfoEntry *> dst_name_to_die;
+ for (src_die = src_class_die->GetFirstChild(); src_die != NULL; src_die = src_die->GetSibling())
+ {
+ if (src_die->Tag() == DW_TAG_subprogram)
+ {
+ const char *src_name = src_die->GetMangledName (this, src_cu);
+ if (src_name)
+ src_name_to_die.Append(ConstString(src_name).GetCString(), src_die);
+ }
+ }
+ for (dst_die = dst_class_die->GetFirstChild(); dst_die != NULL; dst_die = dst_die->GetSibling())
+ {
+ if (dst_die->Tag() == DW_TAG_subprogram)
+ {
+ const char *dst_name = dst_die->GetMangledName (this, dst_cu);
+ if (dst_name)
+ dst_name_to_die.Append(ConstString(dst_name).GetCString(), dst_die);
+ }
+ }
+ const uint32_t src_size = src_name_to_die.GetSize ();
+ const uint32_t dst_size = dst_name_to_die.GetSize ();
+ LogSP log (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO | DWARF_LOG_TYPE_COMPLETION));
+
+ if (src_size && dst_size)
+ {
+ uint32_t idx;
+ for (idx = 0; idx < src_size; ++idx)
+ {
+ src_die = src_name_to_die.GetValueAtIndexUnchecked (idx);
+ dst_die = dst_name_to_die.GetValueAtIndexUnchecked (idx);
+
+ if (src_die->Tag() != dst_die->Tag())
+ {
+ if (log)
+ log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but 0x%8.8x (%s) tags didn't match 0x%8.8x (%s)",
+ src_class_die->GetOffset(),
+ dst_class_die->GetOffset(),
+ src_die->GetOffset(),
+ DW_TAG_value_to_name(src_die->Tag()),
+ dst_die->GetOffset(),
+ DW_TAG_value_to_name(src_die->Tag()));
+ return false;
+ }
+
+ const char *src_name = src_die->GetMangledName (this, src_cu);
+ const char *dst_name = dst_die->GetMangledName (this, dst_cu);
+
+ // Make sure the names match
+ if (src_name == dst_name || (strcmp (src_name, dst_name) == 0))
+ continue;
+
+ if (log)
+ log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but 0x%8.8x (%s) names didn't match 0x%8.8x (%s)",
+ src_class_die->GetOffset(),
+ dst_class_die->GetOffset(),
+ src_die->GetOffset(),
+ src_name,
+ dst_die->GetOffset(),
+ dst_name);
+
+ return false;
+ }
+
+ for (idx = 0; idx < src_size; ++idx)
+ {
+ src_die = src_name_to_die.GetValueAtIndexUnchecked (idx);
+ dst_die = dst_name_to_die.GetValueAtIndexUnchecked (idx);
+
+ clang::DeclContext *src_decl_ctx = m_die_to_decl_ctx[src_die];
+ if (src_decl_ctx)
+ {
+ if (log)
+ log->Printf ("uniquing decl context %p from 0x%8.8x for 0x%8.8x\n", src_decl_ctx, src_die->GetOffset(), dst_die->GetOffset());
+ LinkDeclContextToDIE (src_decl_ctx, dst_die);
+ }
+ else
+ {
+ if (log)
+ log->Printf ("warning: tried to unique decl context from 0x%8.8x for 0x%8.8x, but none was found\n", src_die->GetOffset(), dst_die->GetOffset());
+ }
+
+ Type *src_child_type = m_die_to_type[src_die];
+ if (src_child_type)
+ {
+ if (log)
+ log->Printf ("uniquing type %p (uid=0x%llx) from 0x%8.8x for 0x%8.8x\n", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
+ m_die_to_type[dst_die] = src_child_type;
+ }
+ else
+ {
+ if (log)
+ log->Printf ("warning: tried to unique lldb_private::Type from 0x%8.8x for 0x%8.8x, but none was found\n", src_die->GetOffset(), dst_die->GetOffset());
+ }
+ }
+ return true;
+ }
+ else
+ {
+ if (log)
+ log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but 0x%8.8x has %u methods and 0x%8.8x has %u",
+ src_class_die->GetOffset(),
+ dst_class_die->GetOffset(),
+ src_die->GetOffset(),
+ src_size,
+ dst_die->GetOffset(),
+ dst_size);
+ }
+ return false;
+}
TypeSP
SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, bool *type_is_new_ptr)
@@ -5745,6 +5874,31 @@
Type *class_type = ResolveType (dwarf_cu, decl_ctx_die);
if (class_type)
{
+ if (class_type->GetID() != MakeUserID(decl_ctx_die->GetOffset()))
+ {
+ // We uniqued the parent class of this function to another class
+ // so we now need to associate all dies under "decl_ctx_die" to
+ // DIEs in the DIE for "class_type"...
+ DWARFCompileUnitSP class_type_cu_sp;
+ const DWARFDebugInfoEntry *class_type_die = DebugInfo()->GetDIEPtr(class_type->GetID(), &class_type_cu_sp);
+ if (class_type_die)
+ {
+ if (CopyUniqueClassMethodTypes (class_type,
+ class_type_cu_sp.get(),
+ class_type_die,
+ dwarf_cu,
+ decl_ctx_die))
+ {
+ type_ptr = m_die_to_type[die];
+ if (type_ptr)
+ {
+ type_sp = type_ptr->shared_from_this();
+ break;
+ }
+ }
+ }
+ }
+
if (specification_die_offset != DW_INVALID_OFFSET)
{
// We have a specification which we are going to base our function
Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue May 15 13:30:50 2012
@@ -521,6 +521,13 @@
const DWARFDebugInfoEntry *class_die,
const lldb_private::ConstString &selector);
+ bool
+ CopyUniqueClassMethodTypes (lldb_private::Type *class_type,
+ DWARFCompileUnit* src_cu,
+ const DWARFDebugInfoEntry *src_class_die,
+ DWARFCompileUnit* dst_cu,
+ const DWARFDebugInfoEntry *dst_class_die);
+
SymbolFileDWARFDebugMap * m_debug_map_symfile;
clang::TranslationUnitDecl * m_clang_tu_decl;
lldb_private::Flags m_flags;
Modified: lldb/branches/lldb-platform-work/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Platform.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Platform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Platform.cpp Tue May 15 13:30:50 2012
@@ -13,6 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/Breakpoint/BreakpointIDList.h"
#include "lldb/Core/Error.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/PluginManager.h"
@@ -842,6 +843,12 @@
return arraysize(g_rsync_option_table);
}
+lldb::BreakpointSP
+Platform::SetThreadCreationBreakpoint (lldb_private::Target &target)
+{
+ return lldb::BreakpointSP();
+}
+
OptionGroupPlatformSSH::OptionGroupPlatformSSH ()
{
}
Modified: lldb/branches/lldb-platform-work/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Target.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Target.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Target.cpp Tue May 15 13:30:50 2012
@@ -291,11 +291,11 @@
lldb::BreakpointSP
Target::CreateBreakpoint (const FileSpecList *containingModules,
- const FileSpecList *containingSourceFiles,
- std::vector<std::string> func_names,
- uint32_t func_name_type_mask,
- bool internal,
- LazyBool skip_prologue)
+ const FileSpecList *containingSourceFiles,
+ const std::vector<std::string> &func_names,
+ uint32_t func_name_type_mask,
+ bool internal,
+ LazyBool skip_prologue)
{
BreakpointSP bp_sp;
size_t num_names = func_names.size();
@@ -1512,7 +1512,6 @@
Target::GetDefaultArchitecture ()
{
lldb::UserSettingsControllerSP settings_controller_sp (GetSettingsController());
-
if (settings_controller_sp)
return static_cast<Target::SettingsController *>(settings_controller_sp.get())->GetArchitecture ();
return ArchSpec();
Modified: lldb/branches/lldb-platform-work/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Thread.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Thread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Thread.cpp Tue May 15 13:30:50 2012
@@ -375,8 +375,8 @@
if (plan_ptr->MischiefManaged())
{
- // We're going to pop the plans up to AND INCLUDING the plan that explains the stop.
- plan_ptr = GetPreviousPlan(plan_ptr);
+ // We're going to pop the plans up to and including the plan that explains the stop.
+ ThreadPlan *prev_plan_ptr = GetPreviousPlan (plan_ptr);
do
{
@@ -384,8 +384,13 @@
current_plan->WillStop();
PopPlan();
}
- while ((current_plan = GetCurrentPlan()) != plan_ptr);
- done_processing_current_plan = false;
+ while ((current_plan = GetCurrentPlan()) != prev_plan_ptr);
+ // Now, if the responsible plan was not "Okay to discard" then we're done,
+ // otherwise we forward this to the next plan in the stack below.
+ if (plan_ptr->IsMasterPlan() && !plan_ptr->OkayToDiscard())
+ done_processing_current_plan = true;
+ else
+ done_processing_current_plan = false;
}
else
done_processing_current_plan = true;
@@ -447,7 +452,6 @@
break;
}
}
-
}
else
{
Modified: lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp Tue May 15 13:30:50 2012
@@ -36,15 +36,12 @@
//----------------------------------------------------------------------
bool
ThreadPlanCallFunction::ConstructorSetup (Thread &thread,
- bool discard_on_error,
ABI *& abi,
lldb::addr_t &start_load_addr,
lldb::addr_t &function_load_addr)
{
- // Call function thread plans need to be master plans so that they can potentially stay on the stack when
- // a breakpoint is hit during the function call.
SetIsMasterPlan (true);
- SetOkayToDiscard (discard_on_error);
+ SetOkayToDiscard (false);
ProcessSP process_sp (thread.GetProcess());
if (!process_sp)
@@ -136,12 +133,13 @@
m_function_sp (NULL),
m_return_type (return_type),
m_takedown_done (false),
- m_stop_address (LLDB_INVALID_ADDRESS)
+ m_stop_address (LLDB_INVALID_ADDRESS),
+ m_discard_on_error (discard_on_error)
{
lldb::addr_t start_load_addr;
ABI *abi;
lldb::addr_t function_load_addr;
- if (!ConstructorSetup (thread, discard_on_error, abi, start_load_addr, function_load_addr))
+ if (!ConstructorSetup (thread, abi, start_load_addr, function_load_addr))
return;
if (this_arg && cmd_arg)
@@ -204,7 +202,7 @@
lldb::addr_t start_load_addr;
ABI *abi;
lldb::addr_t function_load_addr;
- if (!ConstructorSetup (thread, discard_on_error, abi, start_load_addr, function_load_addr))
+ if (!ConstructorSetup (thread, abi, start_load_addr, function_load_addr))
return;
if (!abi->PrepareTrivialCall (thread,
@@ -354,7 +352,7 @@
return true;
// If we don't want to discard this plan, than any stop we don't understand should be propagated up the stack.
- if (!OkayToDiscard())
+ if (!m_discard_on_error)
return false;
// Otherwise, check the case where we stopped for an internal breakpoint, in that case, continue on.
@@ -386,7 +384,13 @@
return false;
}
- return OkayToDiscard();
+ if (m_discard_on_error)
+ {
+ DoTakedown(false);
+ return true;
+ }
+ else
+ return false;
}
else
{
@@ -396,7 +400,7 @@
// explain the stop.
if (m_subplan_sp != NULL)
{
- if (OkayToDiscard())
+ if (m_discard_on_error)
{
DoTakedown(false);
return true;
@@ -412,7 +416,7 @@
bool
ThreadPlanCallFunction::ShouldStop (Event *event_ptr)
{
- if (PlanExplainsStop())
+ if (IsPlanComplete() || PlanExplainsStop())
{
ReportRegisterState ("Function completed. Register state was:");
Modified: lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallUserExpression.cpp?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallUserExpression.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallUserExpression.cpp Tue May 15 13:30:50 2012
@@ -47,6 +47,9 @@
ThreadPlanCallFunction (thread, function, ClangASTType(), arg, stop_other_threads, discard_on_error, this_arg, cmd_arg),
m_user_expression_sp (user_expression_sp)
{
+ // User expressions are generally "User generated" so we should set them up to stop when done.
+ SetIsMasterPlan (true);
+ SetOkayToDiscard(false);
}
ThreadPlanCallUserExpression::~ThreadPlanCallUserExpression ()
Modified: lldb/branches/lldb-platform-work/test/expression_command/issue_11588/Test11588.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/expression_command/issue_11588/Test11588.py?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/expression_command/issue_11588/Test11588.py (original)
+++ lldb/branches/lldb-platform-work/test/expression_command/issue_11588/Test11588.py Tue May 15 13:30:50 2012
@@ -59,13 +59,13 @@
addr = addr - 1
self.runCmd("register write r14 %d" % addr)
self.expect("register read r14",
- substrs = ["0x",hex(addr)[2:]])
+ substrs = ["0x",hex(addr)[2:].rstrip("L")]) # Remove trailing 'L' if it exists
self.expect("print *(StgClosure*)$r14",
substrs = ["(StgClosure) $",
"(StgClosure *) &$","0x",
"(long) addr = ",
"(long) load_address = ",
- hex(addr)[2:],
+ hex(addr)[2:].rstrip("L"),
str(addr)])
Modified: lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Tue May 15 13:30:50 2012
@@ -136,6 +136,8 @@
self.expect('frame variable french', substrs = ['Que veut cette horde d\'esclaves, De traîtres, de rois conjurés?'])
self.expect('frame variable german', substrs = ['Ãber-Ich und aus den Ansprüchen der sozialen Umwelt'])
self.expect('frame variable japanese', substrs = ['è²ã¯åã¸ã©æ£ãã¬ãã'])
+ self.expect('frame variable hebrew', substrs = ['×××× ×××'])
+
def plain_data_formatter_commands(self):
"""Test basic ObjC formatting behavior."""
Modified: lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m Tue May 15 13:30:50 2012
@@ -285,6 +285,8 @@
NSString* german = @"Ãber-Ich und aus den Ansprüchen der sozialen Umwelt";
void* data_set[3] = {str1,str2,str3};
+
+ NSString *hebrew = [NSString stringWithString:@"×××× ×××"];
NSArray* newArray = [[NSMutableArray alloc] init];
[newArray addObject:str1];
Modified: lldb/branches/lldb-platform-work/test/lang/c/stepping/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/c/stepping/main.c?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/c/stepping/main.c (original)
+++ lldb/branches/lldb-platform-work/test/lang/c/stepping/main.c Tue May 15 13:30:50 2012
@@ -14,12 +14,18 @@
int a(int val)
{
+ int return_value = val;
+
if (val <= 1)
- return b(val);
+ {
+ return_value = b(val); // break here to stop in a before calling b
+ }
else if (val >= 3)
- return c(val);
+ {
+ return_value = c(val);
+ }
- return val;
+ return return_value;
}
int b(int val)
Modified: lldb/branches/lldb-platform-work/www/lldb-gdb.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/www/lldb-gdb.html?rev=156833&r1=156832&r2=156833&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/www/lldb-gdb.html (original)
+++ lldb/branches/lldb-platform-work/www/lldb-gdb.html Tue May 15 13:30:50 2012
@@ -21,7 +21,7 @@
<div class="post">
<p>Below is a table of LLDB commands with the GDB counterparts.
- The built in GDB compatability aliases in GDB are also
+ The built in GDB-compatibility aliases in LLDB are also
listed.</p>
</div>
<div class="postfooter"></div>
@@ -871,6 +871,30 @@
</table>
<p>
</div>
+ <div class="postfooter"></div>
+ <h1 class ="postheader">Miscellaneous</h1>
+ <div class="post">
+ <p>
+ <table class="stats" width="620" cellspacing="0">
+ <tr>
+ <td class="hed" width="50%">LLDB</td>
+ <td class="hed" width="50%">GDB</td>
+ </tr>
+
+ <tr><td class="header" colspan="2">Echo text to the screen.</td></tr>
+ <tr>
+ <td class="content">
+ <b>(lldb)</b> script print "Here is some text"<br>
+ </td>
+ <td class="content">
+ <b>(gdb)</b> echo Here is some text\n<br>
+ </td>
+ </tr>
+
+ </table>
+ <p>
+ </div>
+
<div class="postfooter"></div>
<p>
More information about the lldb-commits
mailing list