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 1086607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:50:04+00:00 2026-05-16T22:50:04+00:00

I am trying to debug a core file generated by a C++ binary without

  • 0

I am trying to debug a core file generated by a C++ binary without debug symbols. In order to do effective debugging, I need the debug symbols, so I’ve recompiled the same code with -g option in order to generate debug symbols in the recompiled binary. Can I now debug the same core file generated by the first binary (without debug symbols) using the second binary (has debug symbols, everything else is same) ?

Thanks a lot !

  • 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-16T22:50:04+00:00Added an answer on May 16, 2026 at 10:50 pm

    If you compiled original executable with e.g. g++ -O2 ..., you can not (as you probably have discovered) use a new executable built with g++ -g ... to debug the core — GDB needs the symbols to match, and they would not (due to difference in optimization levels).

    What you can do is build the new executable with the same optimization as the original, but also with debug symbols: g++ -O2 -g ....

    After you’ve built a new executable, run nm old.a.out > old.nm, nm new.a.out > new.nm and compare the outputs. They should be identical or very very close.

    If they are, you should be able to debug a core produced by old.a.out using new.a.out.

    In the future, you should always build your executable with debug symbols, then keep the full copy, but ship a copy without debug info:

    cp a.out a.out.debug
    strip --strip-debug a.out
    # a.out is now good to send to customers
    # keep a.out.debug for future debugging
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having real problems trying debug my code to malfunctioning print statements. I
I'm trying to debug this problem but not sure where exactly i need to
I am trying to debug a few regular expressions using: perl -Mre=debug file.pl The
I'm trying to debug simple ruby file in Aptana 3. class HelloWorld def initialize()
I am trying to extract level data from a PCM audio file using core
I'm trying to find a way to debug core files sent to me from
I'm trying to control mem leaks in my code. In my general header file
When trying to debug a program on Windows I can't seem to find where
I'm trying to debug an old VB6 program at my job. It's full of
I'm trying to debug a web page that makes heavy use of events, and

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.