Off-Topic > Off-Topic - Tiny Core Lounge

Small C Program

<< < (2/2)

Oh, I didn't consider that possibility. Thanks for pointing that out.

Welcome to the low-level land ;)

Hi nomer
If you install   gdb.tcz   you will be able step through a program, examine/change variables, and set breakpoints.
Open a terminal and stretch it to twice its normal size, then:
1. Compile your program using the   -O0 -g   options, do not strip the program.
2. gdb -tui YourProgram
3. br main                (Sets a breakpoint at main)
4. r                             (Short for run)
The top half of the window displays your source code. The next line to be executed is highlighted. Here is a good
tutorial on the basics:
I've found gdb to be handy when a program does exactly what I told it to do, instead of what I wanted it to do.

Hi nomer
Since you are doing screen I/O, read the section called   Separating the Input/Output    in this link:
This will keep the debugger screen from getting messed up by the printf statement.


[0] Message Index

[*] Previous page

Go to full version