From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26538 invoked by alias); 4 Apr 2011 15:22:45 -0000 Received: (qmail 26528 invoked by uid 22791); 4 Apr 2011 15:22:43 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Apr 2011 15:22:39 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p34FMcEX027044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Apr 2011 11:22:39 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p34FMcOi005998; Mon, 4 Apr 2011 11:22:38 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p34FMbaO026079; Mon, 4 Apr 2011 11:22:38 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 728F337848E; Mon, 4 Apr 2011 09:22:36 -0600 (MDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: FYI: small simplification in breakpoint.c Date: Mon, 04 Apr 2011 15:22:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00056.txt.bz2 I'm checking this in on the trunk. This patch is just a little cleanup to replace a call to catch_exception (and associated helper function and argument struct) with a direct use of TRY_CATCH. Built and regtested on x86-64 (compile farm). Tom 2011-04-04 Tom Tromey * breakpoint.c (struct captured_parse_breakpoint_args): Remove. (do_captured_parse_breakpoint): Remove. (create_breakpoint): `e' is now volatile. Remove `parse_args'. Use TRY_CATCH directly. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.562 diff -u -r1.562 breakpoint.c --- breakpoint.c 1 Apr 2011 16:59:57 -0000 1.562 +++ breakpoint.c 4 Apr 2011 15:21:05 -0000 @@ -6066,14 +6066,6 @@ delete_breakpoint (b); } -struct captured_parse_breakpoint_args - { - char **arg_p; - struct symtabs_and_lines *sals_p; - struct linespec_result *canonical_p; - int *not_found_ptr; - }; - struct lang_and_radix { enum language lang; @@ -7774,15 +7766,6 @@ } } -static void -do_captured_parse_breakpoint (struct ui_out *ui, void *data) -{ - struct captured_parse_breakpoint_args *args = data; - - parse_breakpoint_sals (args->arg_p, args->sals_p, args->canonical_p, - args->not_found_ptr); -} - /* Given TOK, a string specification of condition and thread, as accepted by the 'break' command, extract the condition string and thread number and set *COND_STRING and *THREAD. @@ -7918,7 +7901,7 @@ struct breakpoint_ops *ops, int from_tty, int enabled, int internal) { - struct gdb_exception e; + volatile struct gdb_exception e; struct symtabs_and_lines sals; struct symtab_and_line pending_sal; char *copy_arg; @@ -7926,7 +7909,6 @@ struct linespec_result canonical; struct cleanup *old_chain; struct cleanup *bkpt_chain = NULL; - struct captured_parse_breakpoint_args parse_args; int i; int pending = 0; int not_found = 0; @@ -7937,11 +7919,6 @@ sals.nelts = 0; init_linespec_result (&canonical); - parse_args.arg_p = &arg; - parse_args.sals_p = &sals; - parse_args.canonical_p = &canonical; - parse_args.not_found_ptr = ¬_found; - if (type_wanted == bp_static_tracepoint && is_marker_spec (arg)) { int i; @@ -7955,8 +7932,10 @@ goto done; } - e = catch_exception (uiout, do_captured_parse_breakpoint, - &parse_args, RETURN_MASK_ALL); + TRY_CATCH (e, RETURN_MASK_ALL) + { + parse_breakpoint_sals (&arg, &sals, &canonical, ¬_found); + } /* If caller is interested in rc value from parse, set value. */ switch (e.reason)