LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to demangle c++ symbols (https://www.linuxquestions.org/questions/programming-9/how-to-demangle-c-symbols-682597/)

dayalan_cse 11-11-2008 06:27 AM

how to demangle c++ symbols
 
Hello All,

how to demangle c++ symbols in Linux environment using the below tools.

1) nm
2) objdump

Thanks & Regards
Deenadayalan

vladmihaisima 11-11-2008 08:20 AM

You could do:

Code:

nm object.o  | c++filt
and

Code:

objdump -t object.o  | c++filt

dayalan_cse 11-12-2008 06:17 AM

how to demance c++ symbol
 
Quote:

Originally Posted by vladmihaisima (Post 3338281)
You could do:

Code:

nm object.o  | c++filt
and

Code:

objdump -t object.o  | c++filt

Thanks for your information.

how can i demange a c++ symbol without using c++filt bcoz i see there is an option -C, followed by --Demangle=[std,gnu,...] to demangle c++ symbols.

Please let me know how to use nm or objdump to demangle c++ symbols without using c++filt.

Thanks,
Deenadayalan

vladmihaisima 11-12-2008 09:44 AM

Ok, I assume you didn't understand what the manual is trying to say. If not, please reprhase or give more details. Quoting from nm man page:
Code:

-C
 --demangle[=style]
          Decode  (demangle) low-level symbol names into user-level names.  Besides removing any ini-
          tial underscore prepended by the system, this makes C++ function names readable.  Different
          compilers  have  different  mangling  styles. The optional demangling style argument can be
          used to choose an appropriate demangling style for your compiler.

This means, you can use

Code:

nm -C object.o
and it will work. You could specify something like:

Code:

nm --demangle=style object.o
but this is OPTIONAL. (so, as I do not know what style can I use there, I left it empty and it worked).

dayalan_cse 11-12-2008 11:26 PM

how to demange c++ symbol
 
Quote:

Originally Posted by vladmihaisima (Post 3339548)
Ok, I assume you didn't understand what the manual is trying to say. If not, please reprhase or give more details. Quoting from nm man page:
Code:

-C
 --demangle[=style]
          Decode  (demangle) low-level symbol names into user-level names.  Besides removing any ini-
          tial underscore prepended by the system, this makes C++ function names readable.  Different
          compilers  have  different  mangling  styles. The optional demangling style argument can be
          used to choose an appropriate demangling style for your compiler.

This means, you can use

Code:

nm -C object.o
and it will work. You could specify something like:

Code:

nm --demangle=style object.o
but this is OPTIONAL. (so, as I do not know what style can I use there, I left it empty and it worked).


Thank you for your inputs.

Interesting. you are correct. i used style as "gnu"

this display all symbols information, i want to demangle for given symbol alone using nm or objdump commands.

Thanks,
Deenadayalan


All times are GMT -5. The time now is 04:53 PM.