gdb "Junk at end of arguments." when trying "catch throw std::bad_aloc"

710 views Asked by At

I've been trying to debug an instance of std::bad_alloc in gdb.

In gdb 7.4.1 and 7.5.91 I tried

(gdb) catch throw std::bad_alloc
Junk at end of arguments.

I've tried wrapping std::bad_alloc in single and double quotes, without success.

Is there a workaround for this, or another way to catch bad_alloc?

Edit: Just to say I tried the suggestion from a related question to break on the constructor of bad_alloc by doing

(gdb) b 'std::bad_alloc::bad_alloc()'

but this breakpoint was not found.

0

There are 0 answers