Eli Zaretskii wrote: >> From: Aleksandar Ristovski >> Date: Tue, 27 May 2008 14:43:10 -0400 >> >>> This patch brings catchpoint output in line with breakpoints output: > > Thanks! I have one comment on your changes: > >> static enum print_stop_action >> print_exception_catchpoint (struct breakpoint *b) >> { >> + int bp_temp; >> + char msg[160]; >> + const char * msgspec; >> + const char msgfmt[] = "\n%s %d (exception %s)\n"; > > This is not a good idea, because it defeats translation. For > starters, this format string will not be caught by xgettext and won't > be in the message catalog. Moreover, ... Changed accordingly. I also adjusted MI output to better fit into breakpoint pattern. New diff attached. Now as you will see, there is an issue with the MI output (scroll down): there is no difference between a normal breakpoint and a catchpoint hit. For now, I would leave it for future and view it as a separate issue (if it is an issue at all). Thanks! 2008-05-27 Aleksandar Ristovski * breakpoint.c (print_exception_catchpoint): In CLI add 'Temporary' for temporary catchpoints. In MI add missing fields 'reason', 'disp', 'bkptno'. (print_mention_exception_catchpoint): Add 'Temporary' for temporary catchpoints. (handle_gnu_v3_exceptions): Use tempflag. Sample output - CLI: (gdb) tcatch catch Temporary catchpoint 1 (catch) (gdb) tcatch throw Temporary catchpoint 2 (throw) (gdb) catch catch Note: breakpoint 1 also set at pc 0x8048764. Catchpoint 3 (catch) (gdb) catch throw Note: breakpoint 2 also set at pc 0x8048724. Catchpoint 4 (throw) (gdb) info b Num Type Disp Enb Address What 1 breakpoint del y 0x08048764 exception catch 2 breakpoint del y 0x08048724 exception throw 3 breakpoint keep y 0x08048764 exception catch 4 breakpoint keep y 0x08048724 exception throw (gdb) r Starting program: /home/src/gdbcvs2/srcrw/src/build/gdb/main Temporary catchpoint 2 (thrown), 0xb7eec455 in __cxa_throw () from /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6 (gdb) c Continuing. Temporary catchpoint 1 (caught), 0xb7eeb896 in __cxa_begin_catch () from /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6 (gdb) c Program exited normally. (gdb) r Starting program: /home/src/gdbcvs2/srcrw/src/build/gdb/main Catchpoint 4 (thrown), 0xb7f8a455 in __cxa_throw () from /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6 (gdb) c Continuing. Catchpoint 3 (caught), 0xb7f89896 in __cxa_begin_catch () from /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6 Sample output - MI: (gdb) catch catch &"catch catch\n" ~"Catchpoint 1 (catch)\n" ^done (gdb) catch throw &"catch throw\n" ~"Catchpoint 2 (throw)\n" ^done (gdb) tcatch catch &"tcatch catch\n" ~"Note: breakpoint 1 also set at pc 0x8048764.\n" ~"Temporary catchpoint 3 (catch)\n" ^done (gdb) tcatch throw &"tcatch throw\n" ~"Note: breakpoint 2 also set at pc 0x8048724.\n" ~"Temporary catchpoint 4 (throw)\n" ^done (gdb) -exec-run ^running (gdb) =thread-created,id="1" *stopped,reason="breakpoint-hit",disp="keep",bkptno="2",thread-id="1",frame={addr="0xb7ee6455",func="__cxa_throw",args=[],from="/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6"} (gdb) -exec-continue ^running (gdb) *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="1",frame={addr="0xb7ee5896",func="__cxa_begin_catch",args=[],from="/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6"} (gdb) -exec-continue ^running (gdb) *stopped,reason="exited-normally" (gdb) (gdb) -exec-run ^running (gdb) =thread-created,id="1" *stopped,reason="breakpoint-hit",disp="keep",bkptno="2",thread-id="1",frame={addr="0xb7efb455",func="__cxa_throw",args=[],from="/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6"} (gdb) -exec-continue ^running (gdb) *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="1",frame={addr="0xb7efa896",func="__cxa_begin_catch",args=[],from="/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6"} (gdb) -exec-continue ^running (gdb) *stopped,reason="exited-normally" (gdb)