frame #0: 0x00007fff88a18af2 libsystem_kernel.dylib read + 10
frame #1: 0x0000000100050c3b libedit.3.dylib read_init + 247
frame #2: 0x0000000100050e96 libedit.3.dylib el_wgetc + 155
frame #3: 0x000000010005115d libedit.3.dylib el_wgets + 578
frame #4: 0x000000010005debc libedit.3.dylib el_gets + 37
frame #5: 0x000000010000d409 lldb IOChannel::LibeditGetInput(this=0x0000000105700490, new_line=0x0000000105a03db0) + 89 at IOChannel.cpp:311
frame #6: 0x000000010000d8b6 lldb IOChannel::Run(this=0x0000000105700490) + 806 at IOChannel.cpp:391
frame #7: 0x000000010000d57d lldb IOChannel::IOReadThread(ptr=0x0000000105700490) + 29 at IOChannel.cpp:345
frame #8: 0x0000000101078923 LLDB ThreadCreateTrampoline(arg=0x00000001057179f0) + 227 at Host.cpp:549
frame #9: 0x00007fff884aa8bf libsystem_c.dylib _pthread_start + 335
frame #10: 0x00007fff884adb75 libsystem_c.dylib thread_start + 13
(lldb)
Modified:
lldb/trunk/source/Core/Debugger.cpp
Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=148110&r1=148109&r2=148110&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Fri Jan 13 02:39:16 2012
@@ -24,8 +24,10 @@
#include "lldb/Core/StreamString.h"
#include "lldb/Core/Timer.h"
#include "lldb/Core/ValueObject.h"
+#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Host/Terminal.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
@@ -1883,6 +1885,108 @@
var_success = true;
}
}
+ else if (::strncmp (var_name_begin, "name-with-args}", strlen("name-with-args}")) == 0)
+ {
+ // Print the function name with arguments in it
+
+ if (sc->function)
+ {
+ var_success = true;
+ ExecutionContextScope *exe_scope = exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL;
+ cstr = sc->function->GetName().AsCString (NULL);
+ if (cstr)
+ {
+ const InlineFunctionInfo *inline_info = NULL;
+ VariableListSP variable_list_sp;
+ bool get_function_vars = true;
+ if (sc->block)
+ {
+ Block *inline_block = sc->block->GetContainingInlinedBlock ();
+
+ if (inline_block)
+ {
+ get_function_vars = false;
+ inline_info = sc->block->GetInlinedFunctionInfo();
+ if (inline_info)
+ variable_list_sp = inline_block->GetBlockVariableList (true);
+ }
+ }
+
+ if (get_function_vars)
+ {
+ variable_list_sp = sc->function->GetBlock(true).GetBlockVariableList (true);
+ }
+
+ if (inline_info)
+ {
+ s.PutCString (cstr);
+ s.PutCString (" [inlined] ");
+ cstr = inline_info->GetName().GetCString();
+ }
+
+ VariableList args;
+ if (variable_list_sp)
+ {
+ const size_t num_variables = variable_list_sp->GetSize();
+ for (size_t var_idx = 0; var_idx < num_variables; ++var_idx)
+ {
+ VariableSP var_sp (variable_list_sp->GetVariableAtIndex(var_idx));
+ if (var_sp->GetScope() == eValueTypeVariableArgument)
+ args.AddVariable (var_sp);
+ }
+
+ }
+ if (args.GetSize() > 0)
+ {
+ const char *open_paren = strchr (cstr, '(');
+ const char *close_paren = NULL;
+ if (open_paren)
+ close_paren = strchr (open_paren, ')');
+
+ if (open_paren)
+ s.Write(cstr, open_paren - cstr + 1);
+ else
+ {
+ s.PutCString (cstr);
+ s.PutChar ('(');
+ }
+ const size_t num_args = variable_list_sp->GetSize();
+ for (size_t arg_idx = 0; arg_idx < num_args; ++arg_idx)
+ {
+ VariableSP var_sp (args.GetVariableAtIndex (arg_idx));
+ ValueObjectSP var_value_sp (ValueObjectVariable::Create (exe_scope, var_sp));
+ const char *var_name = var_value_sp->GetName().GetCString();
+ const char *var_value = var_value_sp->GetValueAsCString();
+ if (var_value_sp->GetError().Success())
+ {
+ if (arg_idx > 0)
+ s.PutCString (", ");
+ s.Printf ("%s=%s", var_name, var_value);
+ }
+ }
+
+ if (close_paren)
+ s.PutCString (close_paren);
+ else
+ s.PutChar(')');
+
+ }
+ else
+ {
+ s.PutCString(cstr);
+ }
+ }
+ }
+ else if (sc->symbol)
+ {
+ cstr = sc->symbol->GetName().AsCString (NULL);
+ if (cstr)
+ {
+ s.PutCString(cstr);
+ var_success = true;
+ }
+ }
+ }
else if (::strncmp (var_name_begin, "addr-offset}", strlen("addr-offset}")) == 0)
{
var_success = addr != NULL;
From gclayton at apple.com Fri Jan 13 02:41:20 2012
From: gclayton at apple.com (Greg Clayton)
Date: Fri, 13 Jan 2012 08:41:20 -0000
Subject: [Lldb-commits] [lldb] r148111 - /lldb/trunk/www/formats.html
Message-ID: <20120113084120.EC4802A6C12D@llvm.org>
Author: gclayton
Date: Fri Jan 13 02:41:20 2012
New Revision: 148111
URL: http://llvm.org/viewvc/llvm-project?rev=148111&view=rev
Log:
Updated HTML with info for ${function.name-with-args}
Modified:
lldb/trunk/www/formats.html
Modified: lldb/trunk/www/formats.html
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/www/formats.html?rev=148111&r1=148110&r2=148111&view=diff
==============================================================================
--- lldb/trunk/www/formats.html (original)
+++ lldb/trunk/www/formats.html Fri Jan 13 02:41:20 2012
@@ -79,7 +79,8 @@
| frame.fp | The generic frame register for the frame pointer. |
| frame.flags | The generic frame register for the flags register. |
| frame.reg.NAME | Access to any platform specific register by name (replace NAME with the name of the desired register). |
- | function.name | The name of the current function or symbol |
+ | function.name | The name of the current function or symbol. |
+ | function.name-with-args | The name of the current function with arguments and values or the symbol name. |
| function.pc-offset | The program counter offset within the current function or symbol |
| line.file.basename | The line table entry basename to the file for the current line entry in the current frame. |
| line.file.fullpath | The line table entry fullpath to the file for the current line entry in the current frame. |
@@ -254,4 +255,4 @@