This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: [MinGW] RFC/RFA: Get Partial Stack Traces on Windows


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Haley wrote:
> Ranjit Mathew writes:
>  > - -      if ((void*)rfp < _esp || diff > 4 * 1024 || diff < 0)
>  > +      if (((unsigned int)rfp & 0x00000003) != 0 || (void*)rfp < _esp
>  > 
>  > > Don't use unsigned int for a pointer; instead use 
>  > > int __attribute__((mode(pointer))).  This is an int that is exactly the
>  > > same size as a pointer.
>  > 
>  > I was just following in the illustrious footsteps of Bryce. ;-)
> 
> Everything can be improved, y'know!

I was just kidding.


>  > Considering that this file (sysdep/i386/backtrace.h) is x86-specific
>  > and is anyway full of otherwise utterly-non-portable-C stuff, does
>  > it matter?
> 
> It deson't affect correctness, it's just a matter of clarity.  It's
> effectively saying "this is a pointer that holds an int."

Should I add something like the following for use everywhere or
do you prefer something more localised to "sysdep/i386/backtrace.h"?
- ---------------------------- 8< ----------------------------
Index: gcj/javaprims.h
===================================================================
- --- gcj/javaprims.h	(revision 115032)
+++ gcj/javaprims.h	(working copy)
@@ -623,6 +623,8 @@ extern "C" void _Jv_RegisterClassHookDef
 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
 typedef unsigned int _Jv_ulong __attribute__((__mode__(__DI__)));
+typedef int _Jv_intptr __attribute__((mode(pointer)));
+typedef unsigned int _Jv_uintptr __attribute__((mode(pointer)));

 class _Jv_Utf8Const
 {
- ---------------------------- 8< ----------------------------

Thanks,
Ranjit.

- --
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://rmathew.com/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEoPYYYb1hx2wRS48RAir0AJ9x8+yJAmVdUuxJc1B31cVx338zUQCfZWiQ
h54R+/XAyAXxs316yqRr6dw=
=KEl+
-----END PGP SIGNATURE-----


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