From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23037 invoked by alias); 15 Jun 2007 22:13:04 -0000 Received: (qmail 23020 invoked by uid 22791); 15 Jun 2007 22:13:03 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Jun 2007 22:12:59 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5FMCuG7020394 for ; Fri, 15 Jun 2007 22:12:56 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 l5FMCuEb2314272 for ; Sat, 16 Jun 2007 00:12:56 +0200 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 l5FMCuJb002459 for ; Sat, 16 Jun 2007 00:12:56 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l5FMCtfO002456; Sat, 16 Jun 2007 00:12:55 +0200 Message-Id: <200706152212.l5FMCtfO002456@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sat, 16 Jun 2007 00:12:55 +0200 Subject: Re: [rfc] Eliminate write_register from solib-sunos.c To: drow@false.org (Daniel Jacobowitz) Date: Fri, 15 Jun 2007 22:13:00 -0000 From: "Ulrich Weigand" Cc: mark.kettenis@xs4all.nl (Mark Kettenis), gdb-patches@sourceware.org In-Reply-To: <20070615212838.GA5986@caradoc.them.org> from "Daniel Jacobowitz" at Jun 15, 2007 05:28:38 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-06/txt/msg00304.txt.bz2 Daniel Jacobowitz wrote: > On Fri, Jun 15, 2007 at 06:58:29PM +0200, Ulrich Weigand wrote: > > So, if that's OK with you, I'd like to commit my original patch > > that leaves the "if (DECR_PC_AFTER_BREAK)" block in, and simply > > replaces the write_register call with write_pc. I've now tested > > that patch on my i386-openbsd3.3 setup with no regressions. > > If you have a moment, could you add an explanation of why this is > necessary to the code? Certainly. I've committed the following patch. Bye, Ulrich ChangeLog: * solib-sunos.c (sunos_solib_create_inferior_hook): Add comment explaining why the PC adjustment code is necessary. diff -urNp gdb-orig/gdb/solib-sunos.c gdb-head/gdb/solib-sunos.c --- gdb-orig/gdb/solib-sunos.c 2007-06-15 21:14:47.675137191 +0200 +++ gdb-head/gdb/solib-sunos.c 2007-06-16 00:07:15.018979384 +0200 @@ -775,7 +775,13 @@ sunos_solib_create_inferior_hook (void) /* We are now either at the "mapping complete" breakpoint (or somewhere else, a condition we aren't prepared to deal with anyway), so adjust the PC as necessary after a breakpoint, disable the breakpoint, and - add any shared libraries that were mapped in. */ + add any shared libraries that were mapped in. + + Note that adjust_pc_after_break did not perform any PC adjustment, + as the breakpoint the inferior just hit was not inserted by GDB, + but by the dynamic loader itself, and is therefore not found on + the GDB software break point list. Thus we have to adjust the + PC here. */ if (gdbarch_decr_pc_after_break (current_gdbarch)) { -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com