This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] Use SBFrame.GetDisplayFunctionName() instead of SBFrame.GetFunctionName()
AcceptedPublic

Authored by ivanhernandez13 on Jan 12 2023, 2:15 PM.

Details

Reviewers
clayborg
Summary

This change replaces calls to SBFrame.GetFunctionName() with
SBFrame.GetDisplayFunctionName() which can return much more user
friendly names in some cases, particularly for Swift code.

A trivial example:

main.swift

class Doer {
    static func doTheThing() {
        print("Hello World!")
    }
}
Doer.doTheThing()

lldb

(lldb) script
>>> frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
>>> frame.GetDisplayFunctionName()
'static Doer.doTheThing()'
>>> frame.GetFunctionName()
'static main.Doer.doTheThing() -> ()'

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 2:15 PM
ivanhernandez13 requested review of this revision.Jan 12 2023, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 2:15 PM
ivanhernandez13 edited the summary of this revision. (Show Details)Jan 13 2023, 12:09 PM
ivanhernandez13 edited the summary of this revision. (Show Details)
clayborg accepted this revision.Jan 19 2023, 2:37 PM
This revision is now accepted and ready to land.Jan 19 2023, 2:37 PM