[Lldb-commits] [lldb] r157732 - in /lldb/branches/apple/python-GIL: ./ include/lldb/Interpreter/CommandInterpreter.h source/API/SBCommandInterpreter.cpp source/Commands/CommandObjectBreakpointCommand.cpp source/Commands/CommandObjectCommands.cpp source/Commands/CommandObjectProcess.cpp source/Commands/CommandObjectThread.cpp source/Interpreter/CommandInterpreter.cpp source/Interpreter/CommandObjectRegexCommand.cpp source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp source/Target/Target.cpp
Filipe Cabecinhas
me at filcab.net
Wed May 30 22:04:10 PDT 2012
Author: filcab
Date: Thu May 31 00:04:10 2012
New Revision: 157732
URL: http://llvm.org/viewvc/llvm-project?rev=157732&view=rev
Log:
Merge changes from ToT trunk.
Modified:
lldb/branches/apple/python-GIL/ (props changed)
lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h
lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectCommands.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp
lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
lldb/branches/apple/python-GIL/source/Interpreter/CommandObjectRegexCommand.cpp
lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/branches/apple/python-GIL/source/Target/Target.cpp
Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 31 00:04:10 2012
@@ -1 +1 @@
-/lldb/trunk:156467-157679
+/lldb/trunk:156467-157728
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=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Interpreter/CommandInterpreter.h Thu May 31 00:04:10 2012
@@ -146,7 +146,7 @@
bool
HandleCommand (const char *command_line,
- bool add_to_history,
+ LazyBool add_to_history,
CommandReturnObject &result,
ExecutionContext *override_context = NULL,
bool repeat_on_empty_command = true,
@@ -179,7 +179,8 @@
bool stop_on_continue,
bool stop_on_error,
bool echo_commands,
- bool print_results,
+ bool print_results,
+ LazyBool add_to_history,
CommandReturnObject &result);
//------------------------------------------------------------------
@@ -209,7 +210,8 @@
bool stop_on_continue,
bool stop_on_error,
bool echo_commands,
- bool print_results,
+ bool print_results,
+ LazyBool add_to_history,
CommandReturnObject &result);
CommandObject *
@@ -477,6 +479,7 @@
char m_repeat_char;
bool m_batch_command_mode;
ChildrenTruncatedWarningStatus m_truncation_warning; // Whether we truncated children and whether the user has been told
+ uint32_t m_command_source_depth;
};
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=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBCommandInterpreter.cpp Thu May 31 00:04:10 2012
@@ -94,7 +94,7 @@
Mutex::Locker api_locker;
if (target_sp)
api_locker.Lock(target_sp->GetAPIMutex());
- m_opaque_ptr->HandleCommand (command_line, add_to_history, result.ref());
+ m_opaque_ptr->HandleCommand (command_line, add_to_history ? eLazyBoolYes : eLazyBoolNo, result.ref());
}
else
{
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=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectBreakpointCommand.cpp Thu May 31 00:04:10 2012
@@ -866,7 +866,8 @@
stop_on_continue,
data->stop_on_error,
echo_commands,
- print_results,
+ print_results,
+ eLazyBoolNo,
result);
result.GetImmediateOutputStream()->Flush();
result.GetImmediateErrorStream()->Flush();
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectCommands.cpp?rev=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectCommands.cpp Thu May 31 00:04:10 2012
@@ -284,7 +284,8 @@
m_options.m_stop_on_continue,
m_options.m_stop_on_error,
echo_commands,
- print_results,
+ print_results,
+ eLazyBoolCalculate,
result);
}
else
@@ -295,6 +296,36 @@
return result.Succeeded();
}
+
+ virtual const char*
+ GetRepeatCommand (Args ¤t_command_args, uint32_t index)
+ {
+ return "";
+ }
+
+ int
+ HandleArgumentCompletion (Args &input,
+ int &cursor_index,
+ int &cursor_char_position,
+ OptionElementVector &opt_element_vector,
+ int match_start_point,
+ int max_return_elements,
+ bool &word_complete,
+ StringList &matches)
+ {
+ std::string completion_str (input.GetArgumentAtIndex(cursor_index));
+ completion_str.erase (cursor_char_position);
+
+ CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
+ CommandCompletions::eDiskFileCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ NULL,
+ word_complete,
+ matches);
+ return matches.GetSize();
+ }
};
OptionDefinition
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp?rev=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp Thu May 31 00:04:10 2012
@@ -598,7 +598,7 @@
// This supports the use-case scenario of immediately continuing the process once attached.
if (m_options.attach_info.GetContinueOnceAttached())
- m_interpreter.HandleCommand("process continue", false, result);
+ m_interpreter.HandleCommand("process continue", eLazyBoolNo, result);
}
return result.Succeeded();
}
Modified: lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp?rev=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectThread.cpp Thu May 31 00:04:10 2012
@@ -678,7 +678,7 @@
result.AppendMessage ("Resuming thread ");
for (idx=0; idx<num_threads; ++idx)
{
- Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get();
+ Thread *thread = process->GetThreadList().FindThreadByIndexID(idx).get();
if (find(resume_thread_indexes.begin(), resume_thread_indexes.end(), idx) != resume_thread_indexes.end())
{
result.AppendMessageWithFormat ("%u ", idx);
@@ -704,7 +704,7 @@
// Set the actions that the threads should each take when resuming
for (idx=0; idx<num_threads; ++idx)
{
- Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get();
+ Thread *thread = process->GetThreadList().FindThreadByIndexID(idx).get();
if (thread == current_thread)
{
result.AppendMessageWithFormat ("Resuming thread 0x%4.4llx in process %llu\n", thread->GetID(), process->GetID());
@@ -937,7 +937,7 @@
}
else
{
- thread = process->GetThreadList().GetThreadAtIndex(m_options.m_thread_idx).get();
+ thread = process->GetThreadList().FindThreadByIndexID(m_options.m_thread_idx).get();
}
if (thread == NULL)
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=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp Thu May 31 00:04:10 2012
@@ -80,8 +80,8 @@
m_script_interpreter_ap (),
m_comment_char ('#'),
m_repeat_char ('!'),
- m_batch_command_mode (false),
- m_truncation_warning(eNoTruncation)
+ m_truncation_warning(eNoTruncation),
+ m_command_source_depth (0)
{
const char *dbg_name = debugger.GetInstanceName().AsCString();
std::string lang_name = ScriptInterpreter::LanguageToString (script_language);
@@ -1218,7 +1218,7 @@
bool
CommandInterpreter::HandleCommand (const char *command_line,
- bool add_to_history,
+ LazyBool lazy_add_to_history,
CommandReturnObject &result,
ExecutionContext *override_context,
bool repeat_on_empty_command,
@@ -1246,7 +1246,14 @@
if (!no_context_switching)
UpdateExecutionContext (override_context);
-
+
+ // <rdar://problem/11328896>
+ bool add_to_history;
+ if (lazy_add_to_history == eLazyBoolCalculate)
+ add_to_history = (m_command_source_depth == 0);
+ else
+ add_to_history = (lazy_add_to_history == eLazyBoolYes);
+
bool empty_command = false;
bool comment_command = false;
if (command_string.empty())
@@ -2226,7 +2233,7 @@
bool echo_commands = false;
bool print_results = false;
- HandleCommandsFromFile (init_file, exe_ctx, stop_on_continue, stop_on_error, echo_commands, print_results, result);
+ HandleCommandsFromFile (init_file, exe_ctx, stop_on_continue, stop_on_error, echo_commands, print_results, eLazyBoolNo, result);
}
else
{
@@ -2258,6 +2265,7 @@
bool stop_on_error,
bool echo_commands,
bool print_results,
+ LazyBool add_to_history,
CommandReturnObject &result)
{
size_t num_lines = commands.GetSize();
@@ -2294,7 +2302,7 @@
CommandReturnObject tmp_result;
// If override_context is not NULL, pass no_context_switching = true for
// HandleCommand() since we updated our context already.
- bool success = HandleCommand(cmd, false, tmp_result,
+ bool success = HandleCommand(cmd, add_to_history, tmp_result,
NULL, /* override_context */
true, /* repeat_on_empty_command */
override_context != NULL /* no_context_switching */);
@@ -2372,6 +2380,7 @@
bool stop_on_error,
bool echo_command,
bool print_result,
+ LazyBool add_to_history,
CommandReturnObject &result)
{
if (cmd_file.Exists())
@@ -2385,7 +2394,9 @@
result.SetStatus (eReturnStatusFailed);
return;
}
- HandleCommands (commands, context, stop_on_continue, stop_on_error, echo_command, print_result, result);
+ m_command_source_depth++;
+ HandleCommands (commands, context, stop_on_continue, stop_on_error, echo_command, print_result, add_to_history, result);
+ m_command_source_depth--;
}
else
{
Modified: lldb/branches/apple/python-GIL/source/Interpreter/CommandObjectRegexCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/CommandObjectRegexCommand.cpp?rev=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandObjectRegexCommand.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandObjectRegexCommand.cpp Thu May 31 00:04:10 2012
@@ -88,7 +88,7 @@
}
// Interpret the new command and return this as the result!
result.GetOutputStream().Printf("%s\n", new_command.c_str());
- return m_interpreter.HandleCommand(new_command.c_str(), true, result);
+ return m_interpreter.HandleCommand(new_command.c_str(), eLazyBoolCalculate, result);
}
}
result.SetStatus(eReturnStatusFailed);
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=157732&r1=157731&r2=157732&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 May 31 00:04:10 2012
@@ -1665,10 +1665,28 @@
{
// We use the current number of symbols in the symbol table in lieu of
// using nlist_idx in case we ever start trimming entries out
- if (symbol_name[0] == '/')
- N_SO_index = sym_idx;
+ const bool N_SO_has_full_path = symbol_name[0] == '/';
+ if (N_SO_has_full_path)
+ {
+ if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms))
+ {
+ // We have two consecutive N_SO entries where the first contains a directory
+ // and the second contains a full path.
+ sym[sym_idx - 1].GetMangled().SetValue(symbol_name, false);
+ m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
+ add_nlist = false;
+ }
+ else
+ {
+ // This is the first entry in a N_SO that contains a directory or
+ // a full path to the source file
+ N_SO_index = sym_idx;
+ }
+ }
else if (minimize && (N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms))
{
+ // This is usually the second N_SO entry that contains just the filename,
+ // so here we combine it with the first one if we are minimizing the symbol table
const char *so_path = sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString();
if (so_path && so_path[0])
{
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=157732&r1=157731&r2=157732&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Target.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Target.cpp Thu May 31 00:04:10 2012
@@ -2001,7 +2001,8 @@
stop_on_continue,
stop_on_error,
echo_commands,
- print_results,
+ print_results,
+ eLazyBoolNo,
result);
// If the command started the target going again, we should bag out of
More information about the lldb-commits
mailing list