This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/Windows] Change type of handler field of current_seh in windows-tdep.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]