From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12863 invoked by alias); 19 Apr 2010 18:15:22 -0000 Received: (qmail 12855 invoked by uid 22791); 19 Apr 2010 18:15:22 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Apr 2010 18:15:18 +0000 Received: (qmail 7514 invoked from network); 19 Apr 2010 18:15:16 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 19 Apr 2010 18:15:16 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA/Windows] Change type of handler field of current_seh in windows-tdep.c Date: Mon, 19 Apr 2010 18:15:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: "Pierre Muller" References: <000c01cadf9b$dad07560$90716020$@muller@ics-cnrs.unistra.fr> In-Reply-To: <000c01cadf9b$dad07560$90716020$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004191915.14556.pedro@codesourcery.com> 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: 2010-04/txt/msg00568.txt.bz2 On Monday 19 April 2010 09:39:41, Pierre Muller wrote: > (top-gdb) p *$_tlb.current_seh > $1 = {next_seh = 0x15dffe0, handler = 0x61018970} > (top-gdb) p *$_tlb.current_seh.next_seh > $2 = {next_seh = 0xffffffff, handler = 0x7c839ad8} > (top-gdb) > > > After this patch, the handler field also displays the > function corresponding to that pointer. > > > (top-gdb) p *$_tlb.current_seh > $2 = {next_seh = 0x15dffe0, > handler = 0x61018970 <_cygtls::handle_exceptions(_EXCEPTION_RECORD*, > _exceptio > n_list*, _CONTEXT*, void*)>} > (top-gdb) p *$_tlb.current_seh .next_seh > $3 = {next_seh = 0xffffffff, handler = 0x7c839ad8 } > > This make it much more readable, no? Yeah. Why not just use builtin_func_ptr though? > + struct type *seh_handler_type, *seh_handler_ptr_type; > > dword_ptr_type = arch_integer_type (gdbarch, gdbarch_ptr_bit (gdbarch), > 1, "DWORD_PTR"); > @@ -125,6 +126,13 @@ windows_get_tlb_type (struct gdbarch *gd > > /* Structured Exception Handler */ > > + seh_handler_type = arch_type (gdbarch, TYPE_CODE_FUNC, 0, NULL); > + TYPE_TARGET_TYPE (seh_handler_type) = builtin_type > (gdbarch)->builtin_void; > + > + seh_handler_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR, > + TYPE_LENGTH (void_ptr_type), NULL); > + TYPE_TARGET_TYPE (seh_handler_ptr_type) = seh_handler_type; > + -- Pedro Alves