<div dir="ltr">Hi Greg,<div><br></div><div>Thanks for the explanation. Even we strip the arguments we definitely will provide a UI for users to toggle arguments type/name/values. It's just, with argument types, the function name can be really long and hard to read:</div><div><img src="cid:ii_1543c52b6a804995" alt="Inline image 1" width="283" height="808" style="margin-right: 0px;"><br></div><div><br></div><div>I was surprised that I need to strip out arguments manually because in command line I can do "<span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">settings set frame-format [...%{</span><span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap"><b>function.name-without-args</b></span><span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">}]</span>" telling lldb to print callstack(using bt command) without arguments. My understanding is that the get function name without arguments exists because may not be exposed in python API yet. Is this not true?</div><div><br></div><div>// bt command output after <span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">settings set frame-format [...%{</span><span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap"><b>function.name-without-args</b></span><span style="color:rgb(48,57,66);font-family:Menlo,monospace;font-size:11px;white-space:pre-wrap">}...]</span></div><div> * frame #0: 0x0000000000403372 min`main + 586 at minimal.cpp:46<br></div><div><div>    frame #1: 0x00007f9a44c050f6 libc.so.6`__libc_start_main + 246</div><div>    frame #2: 0x0000000000402fb8 min`_start + 41 at start.S:122</div></div><div><br></div><div>Jeffrey</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 2:49 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The difference is how the debug info is emitted in the DWARF. Functions that come from C++ will have mangled names. These mangled names contain the arguments. If a function has a mangled name we will demangle it and display that. You can easily strip this if you want to by looking for the first "(" character and stripping the contents. We don't do anything like this. The main issue you will run into is if you have code like:<br>
<br>
<br>
int foo(int f)<br>
{<br>
    return f*2; // Break here...<br>
}<br>
<br>
float foo(float d)<br>
{<br>
    return (float)foo((int)d);<br>
}<br>
<br>
int main(int argc, const char **argv)<br>
{<br>
    float f = float(2.3);<br>
    return 0;<br>
}<br>
<br>
<br>
If you set a breakpoint at "Break here" and run you will currently get:<br>
<br>
foo(int) + 16<br>
foo(float) + 23<br>
main + 25<br>
<br>
But you are saying you would rather see:<br>
<br>
foo + 16<br>
foo + 23<br>
main + 25<br>
<br>
Or:<br>
<br>
foo(...) + 16<br>
foo(...) + 23<br>
main + 25<br>
<br>
"main" is funny because C++ compilers will often 'extern "C"' the function auto magically. This will stop it from getting a mangled name and stop us from showing "main(int, const char **)" as the function name.<br>
<br>
The other reason you might not want to strip anything from the actual name is what happens when you are debugging another language? If you strip any text between "(" and ")", you might ruin a stack frame for the "q" language that has a function name like "foo.bar.baz{int (hello)}" and display this as "foo.bar.baz{int ()}". So any stripping you do, you will want to only do this for specific languages. We do have "const char * SBFunction::GetDisplayName()", but we currently only do something different for Swift (the new Apple language). You can't change the output of that for C++.<br>
<br>
Personally I like to see all of the arguments that uniquely identify each function, but that is me. So anything you do in your debugger, you will want to make that configurable.<br>
<br>
Greg<br>
<span class=""><br>
<br>
> On Apr 21, 2016, at 1:45 PM, Jeffrey Tan via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I call SBFrame.name to get function name and display in our debugger callstack window. However, this seems to include arguments types sometimes.(Btw: why it includes arguments types for subFunction but not main() in screenshot?)<br>
><br>
</span>> <Screen Shot 2016-04-21 at 1.40.55 PM.png><br>
<span class="">><br>
> This is fine for small function, but can be really long if the function has a lot of arguments and the arguments are of template type.<br>
><br>
> Is there any way to only get the function name without arguments types?<br>
><br>
> I have tried ""settings set frame-format [..]" " which seems to only apply to "bt" command.<br>
> I have tried <a href="http://SBFrame.function.name" rel="noreferrer" target="_blank">SBFrame.function.name</a> the same result.<br>
><br>
> Did I miss anything?<br>
> Jeffrey<br>
</span>> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div><br></div>