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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:18:12+00:00 2026-05-28T04:18:12+00:00

I am aware of this question , but it does not appear to work

  • 0

I am aware of this question, but it does not appear to work for me.

For the setup, take a simple C++ program, hw.cpp, given by: int main() { }

Upon compiling with g++ -o hw hw.cpp -O0 -g on Linux, running ldd ./hw gives:

    linux-gate.so.1 =>  (0x003e5000)
    libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 (0x007c5000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x006a4000)
    libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0x00a40000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00a93000)
    /lib/ld-linux.so.2 (0x00a0f000)

Now I also appear to have debug libraries in /usr/lib/debug/lib/tls/i686/cmov/, which I imagine are the corresponding debug builds of the system libraries.

Question: How do I compile my program so that it is linked against the debug builds of the standard C and/or C++ libraries, libc/libm/libstdc++, shared or static? For the shared build, I want the output of ldd ./hw to point to the debug directory.

(Background: One of the shared libraries that’s used by my project is reported as leaking (“still reachable”) by Valgrind, but the origins are not in the shared library itself, but in dlopen-type code (see here). So I figured that if I can step through the _Start() invocation in the CRT I might be able to trace the culprit.)

Update/Correction: I think I was just very, very stupid – the debug libraries have probably always been linked as desired all along. I was confused by the debugger not showing anything while stepping, which is because I don’t have the source code for the libraries.

Update II: OK, belay the previous update. I have the library sources now, but while it is true that the standard library ships with debug symbols, I don’t appear to have a separate debug build. Is such a build available, and how would I link against it?

  • 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-28T04:18:12+00:00Added an answer on May 28, 2026 at 4:18 am

    On many Linux installations the debug libraries do not contain real code; they only contain the debug info. The two are separated so that you can choose not to install them if you don’t need them and you are short of disk space, but the debug libraries are no good on their own.

    GDB is normally preconfigured to find the debug libraries when you need them.

    Of course, your system maybe different. You don’t say what it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I aware that this will be a less programming question, but still... How can
Not many are aware of this feature, but Python's functions (and methods) can have
Before this is marked as duplicate, I'm aware of this question, but in my
Firstly, please don't dismiss this question - I'm aware it's an ugly situation but
This question is not about timing something accurately on Windows (XP or better), but
Firstly, I'm aware of this question , but I don't believe I'm asking the
I am aware of the duplicates of this question: How does the Google Did
In this question , I was made aware of glob()'s GLOB_BRACE option that allows
In the answer to this question ovanes states: Please be aware that boost::lexical_cast is
I'm aware that MD5 has had some collisions but this is more of a

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.