Answer the question
In order to leave comments, you need to log in
How to properly debug a program that uses I/O?
We have a program on assembler.
1 .data
2 str:
3 .string "test\n"
4
5 .text
6
7 .globl main
8
9 main:
10
11 pushl $str
12 call printf
13 addl $4, %esp
14 movl $0, %eax
15 ret
$ gcc -g temp.s
$ ./a.out
test
(gdb) run > log
Starting program: /home/rokker/yadisk/tmp/temps/a.out > log
Breakpoint 1, main () at temp.s:11
pushl $str
(gdb) s
call printf
(gdb) s
__printf (format=0x804a020 "test\n") at printf.c:28
printf.c: No such file or directory.
Answer the question
In order to leave comments, you need to log in
printf.c: No such file or directory.
The point is to put the output of the program in the log file. The same type of error occurs when using scanf.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question