From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3761 invoked by alias); 19 Apr 2010 23:14:48 -0000 Received: (qmail 3750 invoked by uid 22791); 19 Apr 2010 23:14:48 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.156) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Apr 2010 23:14:43 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3JNEaVX085522 ; Tue, 20 Apr 2010 01:14:37 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o3JNEaQl034737 ; Tue, 20 Apr 2010 01:14:36 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3JNEZQm094304 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Tue, 20 Apr 2010 01:14:36 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Pedro Alves'" , References: <000c01cadf9b$dad07560$90716020$@muller@ics-cnrs.unistra.fr> <201004191915.14556.pedro@codesourcery.com> In-Reply-To: <201004191915.14556.pedro@codesourcery.com> Subject: [RFA/Windows-v2] Change type of handler field of current_seh in windows-tdep.c Date: Mon, 19 Apr 2010 23:14:00 -0000 Message-ID: <001b01cae016$1d6178f0$58246ad0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: 2010-04/txt/msg00585.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pedro Alves > Envoy=E9=A0: Monday, April 19, 2010 8:15 PM > =C0=A0: gdb-patches@sourceware.org > Cc=A0: Pierre Muller > Objet=A0: Re: [RFA/Windows] Change type of handler field of current_seh > in windows-tdep.c >=20 > On Monday 19 April 2010 09:39:41, Pierre Muller wrote: >=20 > > (top-gdb) p *$_tlb.current_seh > > $1 =3D {next_seh =3D 0x15dffe0, handler =3D 0x61018970} > > (top-gdb) p *$_tlb.current_seh.next_seh > > $2 =3D {next_seh =3D 0xffffffff, handler =3D 0x7c839ad8} > > (top-gdb) > > > > > > After this patch, the handler field also displays the > > function corresponding to that pointer. > > > > > > (top-gdb) p *$_tlb.current_seh > > $2 =3D {next_seh =3D 0x15dffe0, > > handler =3D 0x61018970 > <_cygtls::handle_exceptions(_EXCEPTION_RECORD*, > > _exceptio > > n_list*, _CONTEXT*, void*)>} > > (top-gdb) p *$_tlb.current_seh .next_seh > > $3 =3D {next_seh =3D 0xffffffff, handler =3D 0x7c839ad8 > } > > > > This make it much more readable, no? >=20 > Yeah. Why not just use builtin_func_ptr though? This is much better... of course. The only reason is that I never used that builtin type, and didn't know about it! This make the patch much simpler, with the same result. Thanks, Pedro Pierre 2010-04-19 Pierre Muller * windows-tdep.c (windows_get_tlb_type): Change current_seh.handler type to void function. Index: windows-tdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/windows-tdep.c,v retrieving revision 1.6 diff -u -p -r1.6 windows-tdep.c --- windows-tdep.c 16 Apr 2010 07:49:35 -0000 1.6 +++ windows-tdep.c 19 Apr 2010 23:11:44 -0000 @@ -133,7 +133,8 @@ windows_get_tlb_type (struct gdbarch *gd TYPE_TARGET_TYPE (seh_ptr_type) =3D seh_type; =20 append_composite_type_field (seh_type, "next_seh", seh_ptr_type); - append_composite_type_field (seh_type, "handler", void_ptr_type); + append_composite_type_field (seh_type, "handler", + builtin_type (gdbarch)->builtin_func_ptr); =20 /* struct _PEB_LDR_DATA */ peb_ldr_type =3D arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);