Erroneous underscores in templates with templates
See original GitHub issueDescribe the bug
Analyzing a program with debug info (both dwarf and pdb) that contains a symbol with a template containing a template will apply a symbol which does not match the symbol in the debug info. The GnuDemangler
seems to be the only thing to apply it correctly. The ms demangler gets this even more wrong and adds in things like “class_” and “struct_” into the symbol name.
To Reproduce Steps to reproduce the behavior:
- Compile the code under attachments with optimizations disabled to prevent inlining.
- Go to the main function and see
Holder<Holder<int>_>::Holder
instead ofHolder<Holder<int>>::Holder
Expected behavior There should obviously be no underscored where there were none to begin with.
Attachments
template <typename T>
class Holder {
T t;
public:
Holder() : t(){}
~Holder() = default;
T get() const { return t; }
};
int main() {
Holder<Holder<int>> var;
return var.get().get();
}
Environment (please complete the following information):
- OS: Microsoft Windows [Version 10.0.22000.556]
- Java Version: 11
- Ghidra Version: 10.1.2 and 10.2_DEV 21aa55cf2dd173c668ca042cf8d352fb8462394c
Additional context Sometimes a demangler will insert a space for readability. Removing it instead of replacing it with an underscore would be correct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Underscore template throwing variable not defined error
You used to be able to parse and fill in an Underscore template in one go like this: var html = _.template(template_string, data);....
Read more >Use underscores instead of hyphens in template filenames
Problem/Motivation Template suggestions use underscores but template files currently use hyphens. Now that we are using templates by default ...
Read more >How to access underscore starting attributes in templates
Hi all of you. I need to pass a model to my template and then access its attributes. Some of them start with...
Read more >template: allow undefined keys #237 - jashkenas/underscore
When the template function needs an element that is not defined it returns an Error. It would be great if the template function...
Read more >SAP message 37620 I/O template must begin with an under
The first character of the template is replaced with an underscore. How to fix this error? Check the contents of the string. The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ryanmkurtz this also occurs with DWARF import and PDB loading.
That’s going pretty far back now. I mistook your initial response as a won’t fix and am willing to put up a fight about it. It may seem like a stupid and minor problem but when having to manually rename 100s of labels so that the correct
this
type gets used, as well as so it is correct, gets painfully tedious.