GDB's disassemble command is nice for short C identifiers, e.g. main. For long, mangled C++ identifiers the verbosity is overkill. For example, using icpc I see results like
(gdb) disassemble 0x49de2f 0x49de5b
Dump of assembler code from 0x49de2f to 0x49de5b:
0x000000000049de2f <_ZN5pecos8suzerain16fftw_multi_array6detail18c2c_buffer_p...
Hi, I'm trying to build a project I have and it has several exported functions. The functions follow the stdcall convention and they get mangled if compiled with GCC as
Func@X
Other compilers mangle the name like this:
_Func@X
Is any way I can force GCC to mangle the names of the exported functions to the later example?
...
I am attempting to recover source from an assembly using Reg Gate's Reflector. The original source took advantage of several C# 3.0 features which has made it a little difficult to recover. For instance here is the recovered source for an anonymous type. The first thing that pops out is the <> in from on the class identifier. Run time ty...
I have a python class hierarchy, that I want to extend at runtime. Furthermore every class in this hierarchy has a static attribute 'dict', that I want to overwrite in every subclass. Simplyfied it looks like this:
'dict' is a protected (public but with leading underscore) member
class A(object):
_dict = {}
@classmethod
de...
In my development environment, I'm compiling a code base using GNU C++ 3.4.6. Code is under development, and unfortunately crashes now and then. It's nice to be able to run the traceback through a demangler, and I use c++filt 3.4. The problem comes when functions have a number of STL parameters. Consider
My_callback::operator()(
Stat...
void outputString(const char *str) {
cout << "outputString(const char *str) : " << str << endl;
}
turns out to be
Dump of assembler code for function _Z12outputStringPKc:
0x004013ee <_Z12outputStringPKc+0>: push ebp
0x004013ef <_Z12outputStringPKc+1>: mov ebp,esp
0x004013f1 <_Z12outputStringPKc+3>: sub esp,0x8
0x004...
I'm trying to compile a Java library that uses JNI. When I start the program, I see a crash with an UnsatisfiedLinkError, which says that a particular method could not be found in the DLL.
On closer inspection, I found out that g++, which I use for compilation and linking, mangled my method names by adding suffixes such as "@8" or "@16"...
I have read the existing questions on external/internal linkage over here on SO. My question is different - what happens if I have multiple definitions of the same variable with external linkage in different translation units under C and C++?
For example:
/*file1.c*/
typedef struct foo {
int a;
int b;
int c;
} foo;
foo xy...
From Java, I'm extracting an executable into a location specified using File.createTempFile(). When I try to run my executable, my program hangs when it tries to read the first line of output.
I have discovered that if I try to run the same extracted executable from another program, it works if I specify the directory as C:\Documents a...
I have a simple website with a master-page. To set properties to elements on a content page (such as Textbox) I use CSS. In designer it works well but when I launch a site a style isn't apllied to controls. The reason is simple. To say, I have a TextBox with id="TextBox1" in content page, it is placed in ContentPlaceHolder1. In CSS file ...
When profiling a Haskell program written in GHC, the names of typeclass functions are mangled in the .prof file to distinguish one instance's implementations of them from another. How can I demangle these names to find out which type's instance it is?
For example, suppose I have the following program, where types Fast and Slow both imp...
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 dist...
I hope to LoadLibrary on an unmanaged C++ DLL with managed code, and then call GetProcAddress on extern functions which have been mangled. My question is are the mangled names you get from a C++ compiler deterministic? That is: Will the name always by converted to the same mangled name, if the original's signature hasn't changed?
...
Hi I need to determine the mangled name of a function from within an c++ app itself.
Is there any equivalent to the __FUNCDNAME__ macro in g++ ?
...
I know MSVC does, and GCC doesn't?
What about the others?
...
When you have an ASP control like this:
<asp:TreeView ID="TreeItems" runat="server"></asp:TreeView>
The html that it generates mangles the names. If I want to access the ids of the generated items directly, I can try and figure out what it mangles the names to and look for that ID.
Are the names of the items generated guaranteed to b...
I have obtained program that is lovely mesh of fortran and c code.
In order for this program to compile it requires a series of libraries that comes precompiled from software vendor. This included among others Intel MKL, MPICH2 etc.
On linux everything works just fine. But on windows I am stuck:
Using the command line, I can compile the...
Normally using the same identifier like name of a variable for something like another variable within the same scope generates error by compiler, Is there any technique to actually indicate to compiler that in this scope up to this specific point this name has its own purpose and is used to refer to this variable but after this point the...