Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFA 2/5] New patches to support --enable-targets=all for mingw64
       [not found] <21924.6809640483$1284127133@news.gmane.org>
@ 2010-09-10 16:09 ` Tom Tromey
  2010-09-10 19:02   ` Pierre Muller
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2010-09-10 16:09 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:

Pierre> 2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>

Pierre> 	* alpha-mdebug-tdep.c (find_proc_desc): Cast SYMBOL_VALUE result to
Pierre> 	uintptr_t before cast to pointer to avoid warning.

I think it is better to use SYMBOL_VALUE_BYTES here.
See how this field is set in mdebugread.c:

	  e = ((struct mdebug_extra_func_info *)
	       obstack_alloc (&current_objfile->objfile_obstack,
			      sizeof (struct mdebug_extra_func_info)));
	  memset (e, 0, sizeof (struct mdebug_extra_func_info));
	  SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;

This is ok with that change.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [RFA 2/5] New patches to support --enable-targets=all for mingw64
  2010-09-10 16:09 ` [RFA 2/5] New patches to support --enable-targets=all for mingw64 Tom Tromey
@ 2010-09-10 19:02   ` Pierre Muller
  2010-09-13 18:34     ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Muller @ 2010-09-10 19:02 UTC (permalink / raw)
  To: 'Tom Tromey'; +Cc: gdb-patches

> I think it is better to use SYMBOL_VALUE_BYTES here.
> See how this field is set in mdebugread.c:
> 
> 	  e = ((struct mdebug_extra_func_info *)
> 	       obstack_alloc (&current_objfile->objfile_obstack,
> 			      sizeof (struct mdebug_extra_func_info)));
> 	  memset (e, 0, sizeof (struct mdebug_extra_func_info));
> 	  SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
> 
> This is ok with that change.

OK, this way, no need for unitptr_t, as gdb_byte * 
is already a host pointer.

This is what I checked in,
thanks for the approval,

Pierre

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.12167
diff -u -p -r1.12167 ChangeLog
--- ChangeLog   9 Sep 2010 23:04:46 -0000       1.12167
+++ ChangeLog   10 Sep 2010 16:03:15 -0000
@@ -1,3 +1,8 @@
+2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+       * alpha-mdebug-tdep.c (find_proc_desc): Use SYMBOL_VALUE_BYTES macro
+       before cast to pointer to avoid warning.
+
 2010-09-09  Kevin Buettner  <kevinb@redhat.com>

        * v850-tdep.c (v850_gdbarch_init): Change the v850's `char'
Index: alpha-mdebug-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-mdebug-tdep.c,v
retrieving revision 1.25
diff -u -p -r1.25 alpha-mdebug-tdep.c
--- alpha-mdebug-tdep.c 23 Apr 2010 15:14:22 -0000      1.25
+++ alpha-mdebug-tdep.c 10 Sep 2010 16:03:15 -0000
@@ -115,7 +115,7 @@ find_proc_desc (CORE_ADDR pc)

   if (sym)
     {
-      proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE (sym);
+      proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (sym);

       /* Correct incorrect setjmp procedure descriptor from the library
          to make backtrace through setjmp work.  */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA 2/5] New patches to support --enable-targets=all for mingw64
  2010-09-10 19:02   ` Pierre Muller
@ 2010-09-13 18:34     ` Joel Brobecker
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2010-09-13 18:34 UTC (permalink / raw)
  To: Pierre Muller; +Cc: 'Tom Tromey', gdb-patches

> +2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>
> +
> +       * alpha-mdebug-tdep.c (find_proc_desc): Use SYMBOL_VALUE_BYTES macro
> +       before cast to pointer to avoid warning.

And I confirm that this should be the correct fix. If you look at
the code in mdebugread.c, where we create the procedure descriptor
data, we store it with:

          SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;

Thanks for fixing this.
-- 
Joel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFA 2/5] New patches to support --enable-targets=all for mingw64
@ 2010-09-10 14:11 Pierre Muller
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Muller @ 2010-09-10 14:11 UTC (permalink / raw)
  To: gdb-patches

  I tried to compile GDB with
--enable-targets=all for x86_64-w64-mingw32 
target.
  As 'long' type is 4-byte while pointer type is 8-byte,
this target is quite sensitive to so 'dirty' code
lying around like casting 'long' or 'unsigned long' to pointers...

  I had to fix several sources to be able to 
successfully compile GDB with those configuration options.

2) Add intermediate typecast to uintptr_t to avoid
compilation warnings.
in alpha-mdebug-tdep.c

Note: this is a simple compilation failure fix,
I suspect that those kind of assignments might not work correctly
in not on a native configuration...

Pierre Muller
Pascal language support maintainer for GDB

2010-09-10  Pierre Muller  <muller@ics.u-strasbg.fr>

	* alpha-mdebug-tdep.c (find_proc_desc): Cast SYMBOL_VALUE result to
	uintptr_t before cast to pointer to avoid warning.

Index: src/gdb/alpha-mdebug-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-mdebug-tdep.c,v
retrieving revision 1.25
diff -u -p -r1.25 alpha-mdebug-tdep.c
--- src/gdb/alpha-mdebug-tdep.c	23 Apr 2010 15:14:22 -0000	1.25
+++ src/gdb/alpha-mdebug-tdep.c	9 Sep 2010 16:39:57 -0000
@@ -115,7 +115,7 @@ find_proc_desc (CORE_ADDR pc)
 
   if (sym)
     {
-      proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE (sym);
+      proc_desc = (struct mdebug_extra_func_info *) (uintptr_t) SYMBOL_VALUE (sym);
 
       /* Correct incorrect setjmp procedure descriptor from the library
          to make backtrace through setjmp work.  */



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-13 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <21924.6809640483$1284127133@news.gmane.org>
2010-09-10 16:09 ` [RFA 2/5] New patches to support --enable-targets=all for mingw64 Tom Tromey
2010-09-10 19:02   ` Pierre Muller
2010-09-13 18:34     ` Joel Brobecker
2010-09-10 14:11 Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox