Missing debugging info with gdb and nasm

I have a simple build program with the following makefile:

all : calc

calc : calc.o
    gcc -m32 -g -o calc calc.o

calc.o : calc.s
    nasm -f elf -g -F stabs calc.s

I try to debug it using gdb, but it always says:

A single step to exit the asc2int function, which has no line number information.

I have tried many solutions to the problem, including -F dwarf, but none of them work. Could you help me solve this problem?

+3
source share
1 answer

I do not see any problems with your make file.

Google nasm. , , , , , . .

, , , . nexti, next . disassemble , . , , script. asm_next .

set language asm
set disassembly-flavor intel
define asm_next
nexti
disassemble
end

,

gdb -x <script> calc

P.S. ad -O0, .s.

+4

All Articles