Skip to content

Shorten very long function names #345

@mjk-gh

Description

@mjk-gh

I have to work on programs that use a framework which causes extremely deeply nested template calls which in turn leads to long function names clogging up all dashboard panes where function names are printed, e.g. "Assembly" or "Stack":

 0x0801e8f4  indoor::app<appAdapter>::body<foo::app_foo<appAdapter, false>::gorgeCfg<perform
DPA<appAdapter>::outdoorBody, indoor::app<appAdapter>::go
rgeCfg<performDPA<appAdapter>::indoorBody, ns_gorgeLib::all_foo<ns_gorgeLib::all<name_cuteUs
age::name_Cute::Cute<name_cuteUsage::name_Cute::name_STD::PerformCfgPreset>::Member>::cfgPre
set, name_cuteUsage::name_Cute::Cute<name_cuteUsage::name_Cute::name_STD::PerformCfgPreset>:
:Member>::cfgPreset> >, ns_gorgeLib::gorge_foo::body<foo::app_foo<appAdapter, false>::gorgeC
fg<performDPA<appAdapter>::outdoorBody, indoor::app<appAdapter>::gorgeCfg<performDPA<appAdap
ter>::indoorBody, ns_gorgeLib::all_foo<ns_gorgeLib::all<name_cuteUsage::name_Cute::Cute<name
_cuteUsage::name_Cute::name_STD::PerformCfgPreset>::Member>::cfgPreset, name_cuteUsage::name
_Cute::Cute<name_cuteUsage::name_Cute::name_STD::PerformCfgPreset>::Member>::cfgPreset> > >,
 performDPA<appAdapter>::outdoorBody>::error::setError(unsigned long)+4 ldr     r3, [r4, #0]

(I did not exactly reproduce the character-precise wrap-arounds, but gave a rough impression of what it looks like)

As you can imagine, these extremely long function names make debugging hard. I would therefore ask for a way of shortening these names. Two methods to do that spring to mind:

  1. Show just beginning and end:
0x0801e8f4  indoor::app<appAdapter>::b ... r::setError(unsigned long)+4 ldr     r3, [r4, #0]
  1. Show just the end:
0x0801e8f4  ...Adapter>::outdoorBody>::error::setError(unsigned long)+4 ldr     r3, [r4, #0]

I would strongly opt for method 2, as the outermost template context is probably the least interesting, but in case there are use cases for that, one could make an option to choose between these two methods.

Thanks for considering this feature request!

EDIT: I see that for some lines, there is more behind the disassembled operation:

[...]:error::setError(unsigned long)+6 cbnz    r3, 0x801e8fc <_ZN3indoor3appI10
appAdapterE4bodyIN7foo11app_fooIS1_Lb0EE7gorgeCfgIN18performDPAIS1_E7outdoorBodyENS2_7
gorgeCfgINS9_7indoorBodyEN10ns_gorgeLib11all_fooINSD_3allIN14name_cuteUsage9name_CuteINS
H_8name_STD17PerformCfgPresetEE4MemberEE9cfgPresetESM_E9cfgPresetEEEEENSD_12gorge_foo4
bodyISS_EESA_E5error8setErrorEm+12>

The part in angle brackets is obviously derived from the nested template function instantiation and also extraordinarily long, therefore, this would probably best also be abbreviatied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions