From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30591 invoked by alias); 16 Dec 2013 23:12:00 -0000 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 Received: (qmail 30582 invoked by uid 89); 16 Dec 2013 23:11:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT autolearn=no version=3.3.2 X-HELO: mailhost.u-strasbg.fr Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.222.215) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Dec 2013 23:11:59 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 68AF2A0175; Tue, 17 Dec 2013 00:11:56 +0100 (CET) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 59962A0192; Tue, 17 Dec 2013 00:11:56 +0100 (CET) Received: from md16.u-strasbg.fr (md16.u-strasbg.fr [130.79.200.206]) by mr5.u-strasbg.fr (Postfix) with ESMTP id 2FCB0A0175; Tue, 17 Dec 2013 00:11:52 +0100 (CET) Received: from ms15.u-strasbg.fr (ms15.u-strasbg.fr [130.79.204.115]) by md16.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id rBGNBqXF016966 ; Tue, 17 Dec 2013 00:11:52 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (Authenticated sender: mullerp) by ms15.u-strasbg.fr (Postfix) with ESMTPSA id 7D21C1FD8A; Tue, 17 Dec 2013 00:11:48 +0100 (CET) From: "Pierre Muller" To: "'Tom Tromey'" Cc: References: <37888.8297280811$1386971648@news.gmane.org> <87mwk0pix6.fsf@fleche.redhat.com> In-Reply-To: <87mwk0pix6.fsf@fleche.redhat.com> Subject: RE: [RFC] pascal: also handle Free Pascal longjump function. Date: Mon, 16 Dec 2013 23:12:00 -0000 Message-ID: <00d101cefab4$347170b0$9d545210$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-12/txt/msg00610.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Tom Tromey > Envoy=E9=A0: lundi 16 d=E9cembre 2013 22:48 > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFC] pascal: also handle Free Pascal longjump function. >=20 > >>>>> "Pierre" =3D=3D Pierre Muller > writes: >=20 > Pierre> - Where is this internal long jump breakpoint really used in > the code? >=20 > Search infrun.c for BPSTAT_WHAT_SET_LONGJMP_RESUME. Thanks for the information.=20 > Pierre> - Is this kind of patch likely to be accepted? >=20 > Sure. OK, great! =20 > Pierre> I would perfectly understand that it would be not acceptable as > is, > Pierre> but maybe some language specific version of the > Pierre> longjmp name would be useful, no? >=20 > I don't think it makes sense to be language-dependent here, because > then this makes mixed-language debugging harder. >=20 > I do wonder whether gdb will really be able to understand this function. > Does it make jmp_bufs compatible with the arch support already in gdb? I checked the i386 case, which seems indeed quite bad: 1) the fpc_setjmp fpc_longjmp function seem to use the register call ABI... So the jump buffer is passed in register eax. By the way, did Jonas Maebe attempt to add i386 register call convention to dwarf standard complete? =20 2) the jump buffer is much smaller than the cygwin case for instance... The buffer only saves the registers that are preserved on function calls according to that ABI, i.e. ebx, esi and edi, the stack registers esp and ebp and the return pc address. This put the return address at offset 20 inside the jump buffer. I suspect that it would at least require some init_abi function to set this... But then the question is, how do we recognize=20 such executables... > What about PC mangling?=20 I am not sure what you mean here... There is no operation on pc value. > What defines fpc_longjmp It is defined in the Free Pascal RTL (Run Time Library) which can be considered as a pascal base library. It is used internally by the compiler to generate the long jumps. > and why is it not just > a simple wrapper for the C library longjmp? Because, by default, Free Pascal compiler generates code that is independent of any library (static code on Linux for instance) with only direct calls to System Calls. Pierre