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]

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



> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé?: Monday, April 19, 2010 8:15 PM
> À?: gdb-patches@sourceware.org
> Cc?: Pierre Muller
> Objet?: 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?

  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  <muller@ics.u-strasbg.fr>

	* windows-tdep.c (windows_get_tlb_type): Change current_seh.handler
	type to void function.

Index: windows-tdep.c
===================================================================
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) = seh_type;
 
   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);
 
   /* struct _PEB_LDR_DATA */
   peb_ldr_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);


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