LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-11-2008, 06:27 AM   #1
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Rep: Reputation: 15
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
 
Old 11-11-2008, 08:20 AM   #2
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
You could do:

Code:
nm object.o  | c++filt
and

Code:
objdump -t object.o  | c++filt
 
Old 11-12-2008, 06:17 AM   #3
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
how to demance c++ symbol

Quote:
Originally Posted by vladmihaisima View Post
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
 
Old 11-12-2008, 09:44 AM   #4
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
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).
 
Old 11-12-2008, 11:26 PM   #5
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
how to demange c++ symbol

Quote:
Originally Posted by vladmihaisima View Post
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugger selectively not using symbols in library with symbols Millenniumman Programming 5 03-25-2007 09:44 AM
Debugger selectively not using symbols in library with symbols Millenniumman Programming 1 03-03-2007 07:46 PM
vi symbols mean? curos Linux - Software 3 01-03-2007 07:35 PM
Unresolved symbols dimi Linux - Laptop and Netbook 6 12-14-2003 07:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration