[lldb-dev] Function names in backtrace from python

jingham at apple.com jingham at apple.com
Mon May 11 11:36:28 PDT 2015


The docs say:

(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> help (lldb.SBFrame.GetFunctionName)
Help on method GetFunctionName in module lldb:

GetFunctionName(self) unbound lldb.SBFrame method
    GetFunctionName(self) -> str
    
    Get the appropriate function name for this frame. Inlined functions in
    LLDB are represented by Blocks that have inlined function information, so
    just looking at the SBFunction or SBSymbol for a frame isn't enough.
    This function will return the appropriate function, symbol or inlined
    function name for the frame.
    
    This function returns:
    - the name of the inlined function (if there is one)
    - the name of the concrete function (if there is one)
    - the name of the symbol (if there is one)
    - NULL
    
    See also IsInlined().

This is actually a little funny because usually the "Function" for a frame is the "real" function that contains all the currently active inlining, but it looks like this API is supposed to get you the inlining that this frame represents.  That seems naively intuitive but a little bit counter to how we talk about this elsewhere.

Jim


> On May 11, 2015, at 8:50 AM, Tamas Berghammer <tberghammer at google.com> wrote:
> 
> Hi All,
> 
> What is the expected behavior of SBFrame::GetFunctionName() in case of an inlined function (or possibly more nested inlined function)? Should it return the name of the deepest inlined function, the name of the outer most (non inlined) function or some combination of these two?
> 
> If I understand correctly, currently it returns the name of the deepest inlined function for the actual frame but TestNoreturnUnwind expect the name of the outer most (non inlined) function.
> 
> Thanks,
> Tamas
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list