Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda