Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
How can I use debug version of glibc to build a program?

i want to debug something in glibc, so i want to use a debug version of glibc to build the program. if i just use "gcc -o test test.c" to build the program,

apt-get install libc6-dbg

apt-get source libc6-dev

when i was debugging the programs,some val is told that it is optimized. and EIP is always jump back.

how can i debug the debug version of glibc.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Caveat: I use fedora but it has a similar mechanism.

The debug package downloads an additional file that has the debug information you would get if you compiled with -g for glibc.

But, this package matches the standard build which is built with optimization (e.g. -O2).

It's the optimization that is causing the behavior you're seeing. So, the gdb "coverage" will be spotty.

What you want is a glibc version that is built with -gdwarf-2 and -O0. AFAIK, you'll have to get that by building glibc yourself from the source.

You'll probably have to run the configure script and select the -g and -O options for the build. Then, run make. The exact details should be in the source documentation [or online] somewhere.

Then, you'll have to [forcibly] link your program against the built-from-source version.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!