Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- void f() {
- throw 42;
- }
- int main(int argc, char *argv[])
- {
- try {
- throw 42;
- //f();
- printf("after thrown");
- } catch (...) {
- printf("in catch stmtn");
- }
- printf("after try-catch stmtn");
- }
- $ gdb -q foo
- Reading symbols from foo...done.
- (gdb) start
- Temporary breakpoint 1 at 0x912: file foo.cpp, line 9.
- Starting program: /home/dannas/foo
- Temporary breakpoint 1, main (argc=1, argv=0x7fffffffdd88) at foo.cpp:9
- 9 throw 42;
- (gdb) next
- 12 } catch (...) {
- (gdb)
- 13 printf("in catch stmtn");
- (gdb)
- in catch stmt
- 12 } catch (...) {
- $ gdb -q foo
- Reading symbols from foo...done.
- (gdb) start
- Temporary breakpoint 1 at 0x912: file foo.cpp, line 10.
- Starting program: /home/dannas/foo
- Temporary breakpoint 1, main (argc=1, argv=0x7fffffffdd78) at foo.cpp:10
- 10 f();
- (gdb) n
- in catch stmt
- after try-catch stmt
- [Inferior 1 (process 32522) exited normally]
- $ gdb --version
- GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement