From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2235 invoked by alias); 8 Sep 2009 18:03:00 -0000 Received: (qmail 1948 invoked by uid 22791); 8 Sep 2009 18:02:57 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Tue, 08 Sep 2009 18:02:48 +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.13.8/8.13.8) with ESMTP id n88I2YA8018136; Tue, 8 Sep 2009 14:02:34 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n88I2WXF028369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Sep 2009 14:02:34 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n88I2VhI007974; Tue, 8 Sep 2009 20:02:31 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n88I2VqR007973; Tue, 8 Sep 2009 20:02:31 +0200 Date: Tue, 08 Sep 2009 18:03:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [patch] [ia64] Fixup breakpoints errors handling Message-ID: <20090908180231.GC3223@host0.dyn.jankratochvil.net> References: <20090905190026.GB16389@host0.dyn.jankratochvil.net> <20090907183259.GH30677@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090907183259.GH30677@adacore.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-IsSubscribed: yes 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: 2009-09/txt/msg00208.txt.bz2 On Mon, 07 Sep 2009 20:32:59 +0200, Joel Brobecker wrote: > > gdb/ > > 2009-09-05 Jan Kratochvil > > > > * ia64-tdep.c (ia64_memory_insert_breakpoint) > > (ia64_memory_remove_breakpoint): Return immediately if any of memory > > reads fail. Do not combine the VAL values. > > The patch is OK. Checked-in. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2009-09/msg00033.html --- src/gdb/ChangeLog 2009/09/08 17:39:19 1.10849 +++ src/gdb/ChangeLog 2009/09/08 17:52:26 1.10850 @@ -1,5 +1,11 @@ 2009-09-08 Jan Kratochvil + * ia64-tdep.c (ia64_memory_insert_breakpoint) + (ia64_memory_remove_breakpoint): Return immediately if any of memory + reads fail. Do not combine the VAL values. + +2009-09-08 Jan Kratochvil + Fix ia64 shadowing of breakpoints in multiple slots of a single bundle. * ia64-tdep.c (ia64_memory_insert_breakpoint): New call of make_show_memory_breakpoints_cleanup with parameter 0. Move the --- src/gdb/ia64-tdep.c 2009/09/08 17:39:21 1.197 +++ src/gdb/ia64-tdep.c 2009/09/08 17:52:27 1.198 @@ -629,6 +629,11 @@ breakpoint instruction bits region. */ cleanup = make_show_memory_breakpoints_cleanup (0); val = target_read_memory (addr, bundle, BUNDLE_LEN); + if (val != 0) + { + do_cleanups (cleanup); + return val; + } /* Slot number 2 may skip at most 2 bytes at the beginning. */ bp_tgt->shadow_len = BUNDLE_LEN - 2; @@ -645,7 +650,12 @@ adjacent placed breakpoints. It is due to our SHADOW_CONTENTS overlapping the real breakpoint instruction bits region. */ make_show_memory_breakpoints_cleanup (1); - val |= target_read_memory (addr, bundle, BUNDLE_LEN); + val = target_read_memory (addr, bundle, BUNDLE_LEN); + if (val != 0) + { + do_cleanups (cleanup); + return val; + } /* Check for L type instruction in slot 1, if present then bump up the slot number to the slot 2. */ @@ -666,9 +676,8 @@ bp_tgt->placed_size = bp_tgt->shadow_len; - if (val == 0) - val = target_write_memory (addr + slotnum, bundle + slotnum, - bp_tgt->shadow_len); + val = target_write_memory (addr + slotnum, bundle + slotnum, + bp_tgt->shadow_len); do_cleanups (cleanup); return val; @@ -695,6 +704,11 @@ breakpoint instruction bits region. */ cleanup = make_show_memory_breakpoints_cleanup (1); val = target_read_memory (addr, bundle_mem, BUNDLE_LEN); + if (val != 0) + { + do_cleanups (cleanup); + return val; + } /* Check for L type instruction in slot 1, if present then bump up the slot number to the slot 2. */ @@ -723,8 +737,7 @@ /* In BUNDLE_MEM be careful to modify only the bits belonging to SLOTNUM and never any other possibly also stored in SHADOW_CONTENTS. */ replace_slotN_contents (bundle_mem, instr_saved, slotnum); - if (val == 0) - val = target_write_memory (addr, bundle_mem, BUNDLE_LEN); + val = target_write_memory (addr, bundle_mem, BUNDLE_LEN); do_cleanups (cleanup); return val;