This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/Windows] Change type of handler field of current_seh in windows-tdep.c
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Date: Mon, 19 Apr 2010 19:15:14 +0100
- Subject: Re: [RFA/Windows] Change type of handler field of current_seh in windows-tdep.c
- References: <000c01cadf9b$dad07560$90716020$@muller@ics-cnrs.unistra.fr>
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 <ValidateLocale+688>}
>
> 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