Palace Chan
Palace Chan

Reputation: 9203

why does inferior exit "normally" when i use dprintf in gdb?

I'm running a very trivial program (just a main with some random int assignments) to test out dprintf from gdb. A main which looks like this:

int main(void)
{
    int h = 17;
    int k = 42;
    std::cout << "stop here" << std::endl;
}

(the h part is line 5). I set the dprintf 6,"h is %d\n",h and if i say start I am taken to line 5 as expected..if I then say advance 7 the program exits even though 7 is the std::cout - why is this? (if I don't use dprintf and I say advance 7 I do, indeed, break on the std::cout line..)

Upvotes: 1

Views: 197

Answers (1)

Employed Russian
Employed Russian

Reputation: 213754

why is this?

It's a bug in GDB. You can report it in GDB bugzilla.

Upvotes: 2

Related Questions