From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23595 invoked by alias); 6 Jun 2008 07:18:47 -0000 Received: (qmail 23586 invoked by uid 22791); 6 Jun 2008 07:18:46 -0000 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Jun 2008 07:18:26 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id m567IHe7019391 ; Fri, 6 Jun 2008 09:18:17 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402::142]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id m567IHpd070692 ; Fri, 6 Jun 2008 09:18:17 +0200 (CEST) Received: from d620muller (laocoon.u-strasbg.fr [130.79.112.72]) by mailserver.u-strasbg.fr (8.13.8/jtpda-5.5pre1) with ESMTP id m567IEOp069652 ; Fri, 6 Jun 2008 09:18:17 +0200 (CEST) From: "Pierre Muller" To: "'Mark Kettenis'" , Cc: , References: <004f01c8ac58$06a1ddb0$13e59910$@u-strasbg.fr> <000c01c8c246$de300f50$9a902df0$@u-strasbg.fr> <200805301157.m4UBvOL5009408@brahms.sibelius.xs4all.nl> <001901c8c256$06f8be00$14ea3a00$@u-strasbg.fr> <001a01c8c263$f493b1d0$ddbb1570$@u-strasbg.fr> <200805301457.m4UEvnGD028393@brahms.sibelius.xs4all.nl> <000301c8c2ea$0c2d72a0$248857e0$@u-strasbg.fr> <20080605202640.GL25085@caradoc.them.org> <200806052041.m55Kfneh015684@brahms.sibelius.xs4all.nl> In-Reply-To: <200806052041.m55Kfneh015684@brahms.sibelius.xs4all.nl> Subject: RE: [PING2] : [RFC/RFA] PING: skip __main Date: Fri, 06 Jun 2008 07:18:00 -0000 Message-ID: <002101c8c7a5$8066c850$813458f0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.u-strasbg.fr [IPv6:2001:660:2402::153]); Fri, 06 Jun 2008 09:18:18 +0200 (CEST) X-Virus-Status: Clean 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: 2008-06/txt/msg00105.txt.bz2 I am not sure I understand your question about assembler or linker, but for sure if we call lookup_minimal_symbol_by_pc with a CORE_ADDR outside the 0 to 0xffffffff range, it might fail to find the right location (although I must admit that I didn't try to look inside that code to see if there is a bit truncation there) Anyhow, using extract_signed_integer followed by a "& 0xffffffffU", we should be on the safe side. I will rerun a test a resubmit a modified patch after. Pierre Muller Pascal language support maintainer for GDB =20=20 -----Message d'origine----- De=A0: Mark Kettenis [mailto:mark.kettenis@xs4all.nl]=20 Envoy=E9=A0: Thursday, June 05, 2008 10:42 PM =C0=A0: drow@false.org Cc=A0: muller@ics.u-strasbg.fr; pedro@codesourcery.com; gdb-patches@sourceware.org Objet=A0: Re: [PING2] : [RFC/RFA] PING: skip __main > Date: Thu, 5 Jun 2008 16:26:40 -0400 > From: Daniel Jacobowitz >=20 > On Sat, May 31, 2008 at 08:46:25AM +0200, Pierre Muller wrote: > > Should I use the 32bit typecast strategy: > >=20 > > unsigned int32 pc_after =3D pc + 5;=20 > > unsigned int32 depl =3D extract_unsigned_integer (buf, 4); > >=20=20=20=20 > > unsigned int32 dest =3D pc_after - depl; > > pc =3D dest; > >=20 > > I don't know the checks done in C, > > are there any overflow checks in code like this, > > or is it safe to assume that it will work, > > even on machine that perform their operations > > on more than 32 bits? >=20 > If you use uint32_t, then you are guaranteed wrapping at 32 bits. > So that is probably the best thing to do. See the patch I just posted > to make stdint.h available everywhere. The diff should use extract_signed_integer(). I'm not sure if the wrapping is actually necessary. Does the assembler/linker actually depend on it? Or does it error out on such large jumps? If so, alternatively you could explicity truncate the generated address to 32 bits using & 0xffffffffU.