trying to understand a program via GDB
I'm working through C programming: Modern Approach by K.N. King
justify is a program that can correctly format (spacing) any sort of text. So if you write something like "hello space space space space space world" it will output "hello world". (cannot put multiple spaces as this forum is fixing it :))
The program contains three .c files:
justify.c
line.c
word.c
In order to run this program, the following is done
./justify <quote
Quote is a text file containing sentences that are not formatted correctly. When you redirect the quote file into the justify program, the output is formatted with correct spacing.
I want to analyse the program via GDB but I'm having difficulties bringing the file quote into gdb.
What I tried:
Code:
gcc -g -o justify.c line.c word.c justify
gdb ./justify
run < quote
after I type run < quote, program doesn't actually run, I just see this:
(gdb) run < quote
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /Users/prakagan/c_king/writing_large_programs/justify < quote
[New Thread 0x2303 of process 17155]
warning: unhandled dyld version (15)