My breakout program runs (sort of) with a few bugs. When I try to use gdb to help fix them, I get this:
(gdb) break main Breakpoint 1 at 0x804a0e3 (gdb) run Starting program: /home/jharvard/Dropbox/pset4/breakout1 Breakpoint 1, 0x0804a0e3 in main () (gdb) n Single stepping until exit from function main, which has no line number information. Detaching after fork from child process 15385.
Can someone help me understand what I might be doing wrong?
The output using "break 1" is:
(gdb) break 1 No symbol table is loaded. Use the "file" command.
Here is the output from running gdb on ./breakout:
gdb) break 1 Breakpoint 1 at 0x804946e: file breakout.c, line 1. (gdb) run Starting program: /home/jharvard/Dropbox/pset4/breakout Breakpoint 1, main_ () at breakout.c:47 47 srand48(time(NULL)); (gdb) n 50 GWindow window = newGWindow(WIDTH, HEIGHT); (gdb) n Detaching after fork from child process 11442. 53 initBricks(window); (gdb) n Program received signal SIGPIPE, Broken pipe. 0xb7fff424 in __kernel_vsyscall () (gdb) n Single stepping until exit from function __kernel_vsyscall, which has no line number information. _IO_new_file_write (f=0x808d2d8, data=0xb7ffc000, n=33) at fileops.c:1255 1255 if (count < 0) (gdb) n 1257 f->_flags |= _IO_ERR_SEEN; (gdb) n 1264 if (f->_offset >= 0) (gdb) n
GDB excerpt from properly working breakout code:
111 else if (getY(ball) + getHeight(ball) >= getHeight(window)) (gdb) n 124 GEvent event = getNextEvent(MOUSE_EVENT); (gdb) print getX(ball) No symbol "getX" in current context. (gdb) n 125 if (event != NULL) (gdb) print event $10 = (GEvent) 0x0 (gdb) n 138 GObject object = detectCollision(window, ball); (gdb) n 141 if(object != NULL) (gdb) n 153 if(object != NULL && object != paddle) (gdb) n 167 } (gdb) n 78 while (lives > 0 && bricks > 0) (gdb) print bricks $11 = 50 (gdb) print object No symbol "object" in current context. (gdb)