Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 517781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:52:10+00:00 2026-05-13T07:52:10+00:00

void outputString(const char *str) { cout << outputString(const char *str) : << str <<

  • 0
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  
0x004013f4 <_Z12outputStringPKc+6>: mov    DWORD PTR [esp+4],0x443000  
0x004013fc <_Z12outputStringPKc+14>:    mov    DWORD PTR [esp],0x4463c0  
0x00401403 <_Z12outputStringPKc+21>:    call   0x43f6e8  <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc>  
0x00401408 <_Z12outputStringPKc+26>:    mov    edx,DWORD PTR [ebp+8]  
0x0040140b <_Z12outputStringPKc+29>:    mov    DWORD PTR [esp+4],edx  
0x0040140f <_Z12outputStringPKc+33>:    mov    DWORD PTR [esp],eax  
0x00401412 <_Z12outputStringPKc+36>:    call  0x43f6e8 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc>  
0x00401417 <_Z12outputStringPKc+41>:    mov    DWORD PTR [esp+4],0x43e4c8  
0x0040141f <_Z12outputStringPKc+49>:    mov    DWORD PTR [esp],eax  
0x00401422 <_Z12outputStringPKc+52>:    call   0x42e170 <_ZNSolsEPFRSoS_E>  
0x00401427 <_Z12outputStringPKc+57>:    leave  
0x00401428 <_Z12outputStringPKc+58>:    ret    
End of assembler dump.

All the disassemblies show only the manglinged function names,but its not eaiser for programmer to de-mangling and get the original function names with the bother to typing info symbol address for each mangling name met,so are there any methods that could make gdb show non-mangling function names on assembly model?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:52:11+00:00Added an answer on May 13, 2026 at 7:52 am

    You could do maint demangle _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc at the (gdb) prompt.

    The manual says:

    `set print asm-demangle'
    `set print asm-demangle on'
         Print C++ names in their source form rather than their mangled
         form, even in assembler code printouts such as instruction
         disassemblies.  The default is off.
    

    Unfortunately, it doesn’t appear to work:

    (gdb) set print asm-demangle on
    (gdb) disas
    Dump of assembler code for function _Z12outputStringPKc:
    0x00000000004009c4 <outputString(char const*)+0>:   push   %rbp
    0x00000000004009c5 <outputString(char const*)+1>:   mov    %rsp,%rbp
    0x00000000004009c8 <outputString(char const*)+4>:   sub    $0x10,%rsp
    0x00000000004009cc <outputString(char const*)+8>:   mov    %rdi,-0x8(%rbp)
    0x00000000004009d0 <outputString(char const*)+12>:  mov    $0x400bb0,%esi
    0x00000000004009d5 <outputString(char const*)+17>:  mov    $0x6012a0,%edi
    0x00000000004009da <outputString(char const*)+22>:  callq  0x400798 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
    0x00000000004009df <outputString(char const*)+27>:  mov    %rax,%rdi
    0x00000000004009e2 <outputString(char const*)+30>:  mov    -0x8(%rbp),%rsi
    0x00000000004009e6 <outputString(char const*)+34>:  callq  0x400798 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
    0x00000000004009eb <outputString(char const*)+39>:  mov    %rax,%rdi
    0x00000000004009ee <outputString(char const*)+42>:  mov    $0x4007c8,%esi
    0x00000000004009f3 <outputString(char const*)+47>:  callq  0x4007b8 <_ZNSolsEPFRSoS_E@plt>
    0x00000000004009f8 <outputString(char const*)+52>:  leaveq 
    0x00000000004009f9 <outputString(char const*)+53>:  retq   
    End of assembler dump.
    

    The setting changed how the current function is printed, but not how the functions it calls are printed (which is what I assume you are after).

    I think that is a bug in GDB, please file a bug in bugzilla.

    Update:

    The bug has been fixed in 2013. With GDB-10.0 the output is:

    (gdb) disas 0x555555555169
    Dump of assembler code for function _Z12outputStringPKc:
       0x0000555555555169 <+0>:     push   %rbp
       0x000055555555516a <+1>:     mov    %rsp,%rbp
       0x000055555555516d <+4>:     sub    $0x10,%rsp
       0x0000555555555171 <+8>:     mov    %rdi,-0x8(%rbp)
       0x0000555555555175 <+12>:    lea    0xe8c(%rip),%rax        # 0x555555556008
       0x000055555555517c <+19>:    mov    %rax,%rsi
       0x000055555555517f <+22>:    lea    0x2efa(%rip),%rax        # 0x555555558080 <std::cout@GLIBCXX_3.4>
       0x0000555555555186 <+29>:    mov    %rax,%rdi
       0x0000555555555189 <+32>:    callq  0x555555555040 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)@plt>
       0x000055555555518e <+37>:    mov    %rax,%rdx
       0x0000555555555191 <+40>:    mov    -0x8(%rbp),%rax
       0x0000555555555195 <+44>:    mov    %rax,%rsi
       0x0000555555555198 <+47>:    mov    %rdx,%rdi
       0x000055555555519b <+50>:    callq  0x555555555040 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)@plt>
       0x00005555555551a0 <+55>:    mov    0x2e29(%rip),%rdx        # 0x555555557fd0
       0x00005555555551a7 <+62>:    mov    %rdx,%rsi
       0x00005555555551aa <+65>:    mov    %rax,%rdi
       0x00005555555551ad <+68>:    callq  0x555555555050 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))@plt>
       0x00005555555551b2 <+73>:    nop
       0x00005555555551b3 <+74>:    leaveq
       0x00005555555551b4 <+75>:    retq
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

void outputString(const string &ss) { cout << outputString(const string& ) + ss << endl;
void say(char msg[]) { // using pointer to print out the first char of
#include <Windows.h> #include <cstdio> const int KEY=111; void encryptStrA(char* sometext) { int length; length=strlen(sometext);
void test() { unsigned char c; c = (~0)>>1 ; printf(c is %u\n,c); }
void SaveFiles(out XElement Attachments) { Attachments = null; if (Uploader1.UploadedFiles.Count() > 0) { Attachments
Updates code - (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar { mytimer3=[NSTimer scheduledTimerWithTimeInterval:.03 target:self selector:@selector(show) userInfo:nil repeats:NO]; NSLog(@
I have the following code: protected void Page_Load(object sender, EventArgs e) { XElement xml
I have the following code: class Program { static void Main(string[] args) { using
class mystring { friend ostream& operator<<(ostream &out, const mystring ss) { out << ss.s;
I want to define a new function inside my RPC code. I am new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.