From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28541 invoked by alias); 5 Mar 2007 05:59:06 -0000 Received: (qmail 28528 invoked by uid 22791); 5 Mar 2007 05:59:05 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 05 Mar 2007 05:59:03 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id l255wxEE096506 for ; Mon, 5 Mar 2007 05:58:59 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l255wwRh2179128 for ; Mon, 5 Mar 2007 06:58:58 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l255wwh3013376 for ; Mon, 5 Mar 2007 06:58:58 +0100 Received: from [9.152.248.44] (dyn-9-152-248-44.boeblingen.de.ibm.com [9.152.248.44]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l255wwpP013373; Mon, 5 Mar 2007 06:58:58 +0100 Message-ID: <45EBB15E.4000602@de.ibm.com> Date: Mon, 05 Mar 2007 05:59:00 -0000 From: Markus Deuling User-Agent: Thunderbird 1.5.0.9 (X11/20061215) MIME-Version: 1.0 To: Eli Zaretskii CC: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [Patch]: Little Cleanup References: <45E7CC17.5040304@de.ibm.com> <45E93AE5.5050704@portugalmail.pt> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020608010402030004040804" 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: 2007-03/txt/msg00034.txt.bz2 This is a multi-part message in MIME format. --------------020608010402030004040804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 858 Hi, thank you for your comment. Eli Zaretskii wrote: >> >> Actually, I find your version harder to read for someone not knowing the >> insert_breakpoints API by heart. >> > > FWIW, I agree. The new version requires a comment to be as readable > as the old one. > > (Of course, I'd expect the optimizer to produce the same code from > both old and new versions.) I agree. Comment in insert_breakpoints() says: "Both return zero if successful, or an `errno' value if ..." so "if (insert_breakpoints () != 0)" is more clear and precise. I changed the patch. Ok ? ChangeLog: * infrun.c (breakpoints_failed): Remove unnecessary variable. (handle_inferior_event): Remove unnecessary braces. * breakpoint.c (bpstat_what): Remove wrong comment. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------020608010402030004040804 Content-Type: text/plain; name="cleanup_patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cleanup_patch" Content-length: 1858 diff -urN src/gdb/breakpoint.c dev/gdb/breakpoint.c --- src/gdb/breakpoint.c 2007-02-27 20:46:04.000000000 +0100 +++ dev/gdb/breakpoint.c 2007-03-02 07:29:06.000000000 +0100 @@ -3134,8 +3134,6 @@ /* step_resume entries: a step resume breakpoint overrides another breakpoint of signal handling (see comment in wait_for_inferior at where we set the step_resume breakpoint). */ - /* We handle the through_sigtramp_breakpoint the same way; having both - one of those and a step_resume_breakpoint is probably very rare (?). */ static const enum bpstat_what_main_action table[(int) class_last][(int) BPSTAT_WHAT_LAST] = diff -urN src/gdb/infrun.c dev/gdb/infrun.c --- src/gdb/infrun.c 2007-03-01 06:45:40.000000000 +0100 +++ dev/gdb/infrun.c 2007-03-02 07:28:17.000000000 +0100 @@ -288,10 +288,6 @@ struct regcache *stop_registers; -/* Nonzero if program stopped due to error trying to insert breakpoints. */ - -static int breakpoints_failed; - /* Nonzero after stop if current stack frame should be printed. */ static int stop_print_frame; @@ -1830,7 +1826,6 @@ stop_print_frame = 1; ecs->random_signal = 0; stopped_by_random_signal = 0; - breakpoints_failed = 0; if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected @@ -2126,9 +2121,7 @@ if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_SINGLE\n"); if (breakpoints_inserted) - { - remove_breakpoints (); - } + remove_breakpoints (); breakpoints_inserted = 0; ecs->another_trap = 1; /* Still need to check other stuff, at least the case @@ -2909,8 +2902,7 @@ if (!breakpoints_inserted && !ecs->another_trap) { - breakpoints_failed = insert_breakpoints (); - if (breakpoints_failed) + if (insert_breakpoints () != 0) { stop_stepping (ecs); return; --------------020608010402030004040804--