GDB locks up

Jones
Unregistered
 
Post: #1
The debugger just locks up at 'Program Running...' it never gets to my breakpoints. Is it possible that this is because I declare a struct of large size?

By large I mean, possibly over 10megs. (It's not allocated using malloc or new, the struct is actually that size...)

Only *one* of the structs will ever be used at one time, but this is the first time GDB has not continued even after a long wait. This is the only cause I could think of.

Thanks.
Quote this message in a reply
Luminary
Posts: 5,125
Joined: 2002.04
Post: #2
If you pause the program, what does GDB say it's doing?
Quote this message in a reply
Jones
Unregistered
 
Post: #3
Well, it pends some breakpoints, it just doesn't get to them.

It also said this:

Quote:mi_cmd_stack_list_frames: Not enough frames in stack.
mi_cmd_stack_list_frames: Not enough frames in stack

I'm trying with dynamic memory allocation now.

EDIT: I've realized, I think it's because the breaks are in a function that is failing before it gets to them.

EDIT 2: While we're on the topic of debugging though, how come my Debugger(); calls never produce any output when in class functions? Rasp

Thanks!
Quote this message in a reply
Luminary
Posts: 5,125
Joined: 2002.04
Post: #4
Quote:mi_cmd_stack_list_frames: Not enough frames in stack.

That does suggest to me that maybe it's not even getting to main() -- I assume you've tried sticking a breakpoint on the first line of main.

Try actually calculating the size of your struct; it may well be larger than you think (10MB is nothing, 2GB could be problematic).

Also, watch the memory usage of your program in top and activity monitor as this happens. If it's skyrocketing, you know you've done something wrong Rasp
Quote this message in a reply
Jones
Unregistered
 
Post: #5
Well, the *original* struct was 1.6 gigs. When I re-wrote it (before this problem arose) it was only 100megs. After the third re-write (still before this) then it should have been 10 megs, and then some dynamic memory. Now it should only be 5 with more dynamic memory.

The problem actually arose from me defining (with #define) something incorrectly. Either that or the file I'm reading is actually big-endian and nobody told me. Sneaky
Quote this message in a reply
Post Reply