name-mangling

Delphi - unmangle names in BPL's

廉价感情. 提交于 2019-11-28 20:51:47
Is it possible to unmangle names like these in Delphi? If so, where do I get more information? Example of an error message where it cannot find a certain entry in the dbrtl100.bpl I want to know which exact function it cannot find (unit, class, name, parameters, etc). --------------------------- myApp.exe - Entry Point Not Found --------------------------- The procedure entry point @Dbcommon@GetTableNameFromSQLEx$qqrx17System@WideString25Dbcommon@IDENTIFIEROption could not be located in the dynamic link library dbrtl100.bpl. --------------------------- OK --------------------------- I know it

Why do I have two destructor implementations in my assembly output? [duplicate]

橙三吉。 提交于 2019-11-27 20:58:21
问题 This question already has an answer here: GNU GCC (g++): Why does it generate multiple dtors? 2 answers And objdump of my .o file reveals that I have two different destructors for the same class. Why? Disassembly of section .text._ZN1AD0Ev: 0000000000000000 <_ZN1AD0Ev>: 0: 53 push %rbx 1: be 00 00 00 00 mov $0x0,%esi 6: 48 89 fb mov %rdi,%rbx 9: 48 c7 07 00 00 00 00 movq $0x0,(%rdi) 10: ba 2c 00 00 00 mov $0x2c,%edx 15: bf 00 00 00 00 mov $0x0,%edi 1a: e8 00 00 00 00 callq 1f <_ZN1AD0Ev+0x1f>

typeid() returns extra characters in g++

此生再无相见时 提交于 2019-11-27 20:37:44
class foo { public: void say_type_name() { std::cout << typeid(this).name() << std::endl; } }; int main() { foo f;; f.say_type_name(); } Above code prints P3foo on my ubuntu machine with g++. I am not getting why it is printing P3foo instead of just foo . If I change the code like std::cout << typeid(*this).name() << std::endl; it prints 3foo . Any thoughts? Because it is a pointer to foo. And foo has 3 characters. So it becomes P3foo . The other one has type foo , so it becomes 3foo . Note that the text is implementation dependent, and in this case GCC just gives you the internal, mangled

function to mangle/demangle functions

五迷三道 提交于 2019-11-27 14:00:06
问题 I have previously ,here, been shown that C++ functions aren't easily represented in assembly. Now I am interested in reading 1 way or another because callgrind, part of valgrind, show them demangled while in assembly they are shown mangled, so i would like to either mangle the valgrind function output or demangle the assembly names of functions. Anyone ever tried something like that? I was looking at a website and found out the following: Code to implement demangling is part of the GNU

What is the benefit of private name mangling in Python?

做~自己de王妃 提交于 2019-11-27 12:13:38
Python provides private name mangling for class methods and attributes. Are there any concrete cases where this feature is required, or is it just a carry over from Java and C++? Please describe a use case where Python name mangling should be used, if any? Also, I'm not interested in the case where the author is merely trying to prevent accidental external attribute access. I believe this use case is not aligned with the Python programming model. It's partly to prevent accidental internal attribute access. Here's an example: In your code, which is a library: class YourClass: def __init__(self)

C++ name mangling decoder for g++? [duplicate]

情到浓时终转凉″ 提交于 2019-11-27 11:30:54
问题 This question already has answers here : Why does typeid.name() return weird characters using GCC and how to make it print unmangled names? (6 answers) Closed 4 years ago . is there any C++ name-mangling decoder for g++? 回答1: You can use c++filt to demangle c++ symbols. For instance $ c++filt -n _Z1fv f() 回答2: c++filt, example usage here: Can we see the template instantiated code by C++ compiler 回答3: You may also be interested on the -C option of objdump : objdump -CSr main.o which demangles

Scala: How do I dynamically instantiate an object and invoke a method using reflection?

允我心安 提交于 2019-11-27 06:03:08
In Scala, what's the best way to dynamically instantiate an object and invoke a method using reflection? I would like to do Scala-equivalent of the following Java code: Class class = Class.forName("Foo"); Object foo = class.newInstance(); Method method = class.getMethod("hello", null); method.invoke(foo, null); In the above code, both the class name and the method name are passed in dynamically. The above Java mechanism could probably be used for Foo and hello() , but the Scala types don't match one-to-one with that of Java. For example, a class may be declared implicitly for a singleton

What does the GCC function suffix “isra” mean?

随声附和 提交于 2019-11-27 03:24:14
问题 While profiling a program compiled with gcc, I noticed functions like foo.isra.3 . What does isra indicate? I notice that one of the functions is only called in a few places, and one of the arguments is always specified as a literal value. Maybe it means it's a variant of the function optimised for certain arguments? 回答1: According to a comment on this bug report (and similar comments I could find): ISRA is the name of the variable that gets created by IPA SRA ... IPA SRA is an optimization

questions about name mangling in C++

走远了吗. 提交于 2019-11-27 00:58:17
I am trying to learn and understand name mangling in C++. Here are some questions: (1) From devx When a global function is overloaded, the generated mangled name for each overloaded version is unique. Name mangling is also applied to variables. Thus, a local variable and a global variable with the same user-given name still get distinct mangled names. Are there other examples that are using name mangling, besides overloading functions and same-name global and local variables ? (2) From Wiki The need arises where the language allows different entities to be named with the same identifier as

typeid() returns extra characters in g++

本小妞迷上赌 提交于 2019-11-26 20:24:48
问题 class foo { public: void say_type_name() { std::cout << typeid(this).name() << std::endl; } }; int main() { foo f;; f.say_type_name(); } Above code prints P3foo on my ubuntu machine with g++. I am not getting why it is printing P3foo instead of just foo . If I change the code like std::cout << typeid(*this).name() << std::endl; it prints 3foo . Any thoughts? 回答1: Because it is a pointer to foo. And foo has 3 characters. So it becomes P3foo . The other one has type foo , so it becomes 3foo .