[kaffe] Re: Re: NetworkInterface problem

2005-04-24 Thread Riccardo
In <[EMAIL PROTECTED]> Dalibor Topic  wrote:
> p.s. I hope the recent iconv changes work for you on freebsd. Riccardo 
> seems to be having some problems, we're debugging them on IRC.

unfortunately adding /usr/local/lib to iconv-libraries didn't help. 
still the same stupid error.

_R


___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Status of m68k/{linux, netbsd}

2005-04-24 Thread Dalibor Topic

So, I plan to put the compilation flag back to '-O2' (eventually, just
remove '-O0' from config.frag), but it may make jit useless. Is it better
to keep some documentation for this in somewhere?
Thanks for keeping the m68k port alive, Kiyo! We could have a FAQ.m68k 
for the m68k specific docs.

One additional note, for m68k/netbsd '-O1' is faster than '-O2' (or
very close), and as I reported before, jit is faster than jit3. This
is another issue what should be mentioned.
Any comments?
I've just received some patches to make kaffe build fine on 
i386-netbsd2-cvs-head. I'll try to make them work on netbsd1.6 and 2.0, 
they may be useful as a template for other netbsd architectures as well.

Kiyo
P.S. When testing m68k becomes more stabilized, I will restart sh3/jit3
 project :-)
great!
cheers,
dalibor topic
___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] Re: NetworkInterface problem

2005-04-24 Thread Dalibor Topic
Ito Kazumitsu wrote:
From: Ito Kazumitsu <[EMAIL PROTECTED]>
Subject: NetworkInterface problem (Re: [kaffe] freebsd 5.3 failed regression)
Date: Sun, 24 Apr 2005 23:07:48 +0900 (JST)

The problem seems to appear when a network interface has more than
one addresses.

The differnce between Kaffe's java.net.NetworkInterface and
that of GNU classpath is that Kaffe's has a private method
"condense" which condenses the output from
VMNetworkInterface.getInterfaces().
The output from VMNetworkInterface.getInterfaces() may be
something like this.
   ((name1 addr11) (name1 addr12) (name1 addr13)
(name2 addr21) (name2 addr22))
condense condenses this into
   ((name1 (addr11 addr12 addr13))
(name2 (addr21 addr22)))

 (1) NetworkInterface returned by NetworkInterface.getNetworkInterfaces()
 contains all addresses of that interface.

NetworkInterface.getNetworkInterfaces() returns the the condensed
result.
 

 (2) NetworkInterface returned by NetworkInterface.getByName(name) or
 NetworkInterface.getByInetAddress(addr) contains only one of the
 addresses of that interface.

Until recently, these methods used getNetworkInterfaces() which
returned a condensed result.  But now they do not call
getNetworkInterfaces() but calls VMNetworkInterface.getInterfaces()
which may return one of uncondensed raw results.
The fix may be either
  (a) To modify java.net.NetworkInterface so that getByName or
  getByInetAddress calls getNetworkInterfaces() as before.
Thanks for the fast analysis, Ito!
I'd say let's do a) as it is simpler & faster. We need to push the 
condensing code upstream into classpath anyway for IPv6 support, I think.

Could you write a patch?
cheers,
dalibor topic
p.s. I hope the recent iconv changes work for you on freebsd. Riccardo 
seems to be having some problems, we're debugging them on IRC.

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] Re: NetworkInterface problem

2005-04-24 Thread Ito Kazumitsu
From: Ito Kazumitsu <[EMAIL PROTECTED]>
Subject: NetworkInterface problem (Re: [kaffe] freebsd 5.3 failed regression)
Date: Sun, 24 Apr 2005 23:07:48 +0900 (JST)

> The problem seems to appear when a network interface has more than
> one addresses.

The differnce between Kaffe's java.net.NetworkInterface and
that of GNU classpath is that Kaffe's has a private method
"condense" which condenses the output from
VMNetworkInterface.getInterfaces().

The output from VMNetworkInterface.getInterfaces() may be
something like this.

   ((name1 addr11) (name1 addr12) (name1 addr13)
(name2 addr21) (name2 addr22))

condense condenses this into

   ((name1 (addr11 addr12 addr13))
(name2 (addr21 addr22)))

>   (1) NetworkInterface returned by NetworkInterface.getNetworkInterfaces()
>   contains all addresses of that interface.

NetworkInterface.getNetworkInterfaces() returns the the condensed
result.
 
>   (2) NetworkInterface returned by NetworkInterface.getByName(name) or
>   NetworkInterface.getByInetAddress(addr) contains only one of the
>   addresses of that interface.

Until recently, these methods used getNetworkInterfaces() which
returned a condensed result.  But now they do not call
getNetworkInterfaces() but calls VMNetworkInterface.getInterfaces()
which may return one of uncondensed raw results.

The fix may be either

  (a) To modify java.net.NetworkInterface so that getByName or
  getByInetAddress calls getNetworkInterfaces() as before.

or

  (b) To modify libraries/clib/net/NetworkInterface.c so that
  java_net_VMNetworkInterface_getInterfaces returns already
  condensed results.

(a) is easier, but the difference between Kaffe and GNU Classpath
remains.  (b) is harder, but we will be able to  synchronize
java.net.NetworkInterface with GNU Classpath.

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (guilhem): Warning fixes.

2005-04-24 Thread Kaffe CVS
PatchSet 6420 
Date: 2005/04/24 15:10:43
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Warning fixes.

2005-04-24  Eric Anholt <[EMAIL PROTECTED]>

* kaffe/kaffevm/exception.c,
kaffe/kaffevm/locks.c,
kaffe/kaffevm/locks.h,
kaffe/kaffevm/string.c,
kaffe/kaffevm/intrp/checks.h,
kaffe/kaffevm/intrp/icode.h,
kaffe/kaffevm/jni/jni-base.c,
kaffe/kaffevm/jni/jni-helpers.c,
kaffe/kaffevm/jni/jni.c
kaffe/kaffevm/jni/jni_funcs.h
kaffe/kaffevm/kaffe-gc/gc-mem.c:
Fixed a few warnings.

Members: 
ChangeLog:1.3948->1.3949 
kaffe/kaffevm/exception.c:INITIAL->1.96 
kaffe/kaffevm/locks.c:INITIAL->1.62 
kaffe/kaffevm/locks.h:INITIAL->1.30 
kaffe/kaffevm/string.c:INITIAL->1.43 
kaffe/kaffevm/intrp/checks.h:1.4->1.5 
kaffe/kaffevm/jni/jni-base.c:1.17->1.18 
kaffe/kaffevm/jni/jni-helpers.c:1.4->1.5 
kaffe/kaffevm/jni/jni.c:1.23->1.24 
kaffe/kaffevm/jni/jni_funcs.h:1.7->1.8 
kaffe/kaffevm/kaffe-gc/gc-mem.c:1.26->1.27 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3948 kaffe/ChangeLog:1.3949
--- kaffe/ChangeLog:1.3948  Sun Apr 24 13:46:01 2005
+++ kaffe/ChangeLog Sun Apr 24 15:10:43 2005
@@ -1,3 +1,18 @@
+2005-04-24  Eric Anholt <[EMAIL PROTECTED]>
+
+   * kaffe/kaffevm/exception.c,
+   kaffe/kaffevm/locks.c,
+   kaffe/kaffevm/locks.h,
+   kaffe/kaffevm/string.c,
+   kaffe/kaffevm/intrp/checks.h,
+   kaffe/kaffevm/intrp/icode.h,
+   kaffe/kaffevm/jni/jni-base.c,
+   kaffe/kaffevm/jni/jni-helpers.c,
+   kaffe/kaffevm/jni/jni.c
+   kaffe/kaffevm/jni/jni_funcs.h
+   kaffe/kaffevm/kaffe-gc/gc-mem.c:
+   Fixed a few warnings.
+
 2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
 
* config/i386/netbsd1/md.h:
===
Checking out kaffe/kaffe/kaffevm/exception.c
RCS:  /home/cvs/kaffe/kaffe/kaffe/kaffevm/exception.c,v
VERS: 1.96
***
--- /dev/null   Sun Aug  4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/exception.c Sun Apr 24 15:15:29 2005
@@ -0,0 +1,689 @@
+/*
+ * exception.c
+ * Handle exceptions for the interpreter or translator.
+ *
+ * Copyright (c) 1996, 1997, 2004
+ * Transvirtual Technologies, Inc.  All rights reserved.
+ * Copyright (c) 2003
+ * Mark J. Wielaard <[EMAIL PROTECTED]>
+ * Copyright (c) 2004
+ *  Kaffe.org contributors. See ChangeLogs for details. All rights 
reserved.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ */
+
+#if defined(HAVE_STDARG_H)
+#include 
+#endif /* defined(HAVE_STDARG_H) */
+
+#include 
+
+#include "config.h"
+#include "debug.h"
+#include "config-std.h"
+#include "config-signal.h"
+#include "config-mem.h"
+#include "config-setjmp.h"
+#include "config-hacks.h"
+#include "kaffe/jni_md.h"
+#include "gtypes.h"
+#include "access.h"
+#include "object.h"
+#include "constants.h"
+#include "md.h"
+#include "callKaffeException.h"
+#include "classMethod.h"
+#include "code.h"
+#include "exception.h"
+#include "baseClasses.h"
+#include "lookup.h"
+#include "thread.h"
+#include "thread-impl.h"
+#include "errors.h"
+#include "itypes.h"
+#include "external.h"
+#include "soft.h"
+#include "locks.h"
+#include "stackTrace.h"
+#include "machine.h"
+#include "slots.h"
+#include "gcj/gcj.h"
+
+#include "java_lang_Throwable.h"
+#include "java_lang_VMThrowable.h"
+
+#if defined(INTERPRETER)
+
+static struct Hjava_lang_Object*
+vmExcept_getSyncObj(VmExceptHandler* eh)
+{
+   assert(eh != NULL);
+   assert(eh->meth != NULL);
+   assert(eh->meth != VMEXCEPTHANDLER_KAFFEJNI_HANDLER);
+   return eh->frame.intrp.syncobj;
+}
+
+#define FRAMEOBJECT(O, F, E)(O) = 
vmExcept_getSyncObj((VmExceptHandler*)(F))
+
+
+#define DISPATCH_EXCEPTION(F, H, E) vmExcept_setPC((VmExceptHandler *)(F), 
(H));  \
+vmExcept_jumpToHandler((VmExceptHandler 
*)(F)); /* Does not return */
+#else
+
+#define DISPATCH_EXCEPTION(F,H,E) thread_data->exceptObj = NULL;\
+  CALL_KAFFE_EXCEPTION((F),(H),(E));
+
+#endif /* TRANSLATOR */
+
+static void nullException(struct _exceptionFrame *);
+static void floatingException(struct _exceptionFrame *);
+static void stackOverflowException(struct _exceptionFrame *);
+static void dispatchException(Hjava_lang_Throwable*, stackTraceInfo*);
+
+static bool findExceptionBlockInMethod(uintp, Hjava_lang_Class*, Method*, 
uintp*);
+
+bool
+vmExcept_isJNIFrame(VmExceptHandler* eh)
+{
+   assert(eh != NULL);
+   return (eh->meth == VMEXCEPTHANDLER_KAFFEJNI_HANDLER);
+}
+
+static bool
+vmExcept_JNIContains(VmExceptHandler* eh, JNIFrameAddress fp)
+{
+   assert(eh != NULL);
+   assert(eh->meth == VMEXCEPTHANDLER_KAFFEJNI_HANDLER);
+   assert(fp != (JNIFrameAddress)0);
+
+   return (eh->frame.jni.fp == fp);
+}
+
+void 
+vmExcept_setJNIFrame(Vm

NetworkInterface problem (Re: [kaffe] freebsd 5.3 failed regression)

2005-04-24 Thread Ito Kazumitsu
> From: Riccardo <[EMAIL PROTECTED]>
> Subject: [kaffe] freebsd 5.3 failed regression
> Date: Fri, 22 Apr 2005 11:38:06 + (UTC)
> 
> > on 18 april, freebsd 5.3 passed all tests, today it fails one:
> 
> In my case, also on FreeBSD 5.3-RELEASE, compilation failes
> before going to the regression test.

Now Kaffe's CVS version compiles fine, and I am experiencing
the same problem reported by Riccardo.

The problem seems to appear when a network interface has more than
one addresses.

Attached is a program copied from test/regression/NetworkInterfaceTest.java.
According to this,

  (1) NetworkInterface returned by NetworkInterface.getNetworkInterfaces()
  contains all addresses of that interface.

  (2) NetworkInterface returned by NetworkInterface.getByName(name) or
  NetworkInterface.getByInetAddress(addr) contains only one of the
  addresses of that interface.

Test program:
import java.util.Enumeration;

import java.net.InetAddress;
import java.net.SocketException;
import java.net.NetworkInterface;

public class TestNetworkInterface
{

private static void showNetworkInterface(NetworkInterface ni)
{
System.out.println("  showNetworkInterface: " + ni + "{");
System.out.println("  Name: " + ni.getName());
System.out.println("  Display Name: "
   + ni.getDisplayName());
Enumeration ips = ni.getInetAddresses();
while( ips.hasMoreElements() )
{
InetAddress ia;
ia = (InetAddress)ips.nextElement();
System.out.println("  Address: " + ia);
}
System.out.println("  }");
}


public static void main(String args[])
{
try
{
Enumeration enum;
int lpc;

enum = NetworkInterface.getNetworkInterfaces();
for( lpc = 0; enum.hasMoreElements(); lpc++ )
{
NetworkInterface ni, ni2;
Enumeration ips;

ni = (NetworkInterface)enum.nextElement();
System.out.println("Detected interface #" + lpc);
showNetworkInterface(ni);

ni2 = NetworkInterface.getByName(ni.getName());
System.out.println("getByName(" + ni.getName() + ")");
showNetworkInterface(ni2);

ips = ni.getInetAddresses();
while( ips.hasMoreElements() )
{
InetAddress ia;

ia = (InetAddress)ips.nextElement();
System.out.println("getByInetAddress(" + ia + ")");
ni2 = NetworkInterface.getByInetAddress(ia);
showNetworkInterface(ni2);
}
}
}
catch(SocketException e)
{
e.printStackTrace();
System.exit(77);
}
catch(kaffe.util.NotImplemented e)
{
e.printStackTrace();
System.exit(77);
}
}
}

Result:
Detected interface #0
  showNetworkInterface: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
::1/0:0:0:0:0:0:0:1;
fe80:3::1/fe80:3:0:0:0:0:0:1;
{
  Name: lo0
  Display Name: lo0
  Address: 127.0.0.1/127.0.0.1
  Address: ::1/0:0:0:0:0:0:0:1
  Address: fe80:3::1/fe80:3:0:0:0:0:0:1
  }
getByName(lo0)
  showNetworkInterface: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
{
  Name: lo0
  Display Name: lo0
  Address: 127.0.0.1/127.0.0.1
  }
getByInetAddress(127.0.0.1/127.0.0.1)
  showNetworkInterface: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
{
  Name: lo0
  Display Name: lo0
  Address: 127.0.0.1/127.0.0.1
  }
getByInetAddress(::1/0:0:0:0:0:0:0:1)
  showNetworkInterface: name: lo0 (lo0) addresses:
::1/0:0:0:0:0:0:0:1;
{
  Name: lo0
  Display Name: lo0
  Address: ::1/0:0:0:0:0:0:0:1
  }
getByInetAddress(fe80:3::1/fe80:3:0:0:0:0:0:1)
  showNetworkInterface: name: lo0 (lo0) addresses:
fe80:3::1/fe80:3:0:0:0:0:0:1;
{
  Name: lo0
  Display Name: lo0
  Address: fe80:3::1/fe80:3:0:0:0:0:0:1
  }
Detected interface #1
  showNetworkInterface: name: fxp0 (fxp0) addresses:
192.168.0.3/192.168.0.3;
fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05;
{
  Name: fxp0
  Display Name: fxp0
  Address: 192.168.0.3/192.168.0.3
  Address: fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05
  }
getByName(fxp0)
  showNetworkInterface: name: fxp0 (fxp0) addresses:
192.168.0.3/192.168.0.3;
{
  Name: fxp0
  Display Name: fxp0
  Address: 192.168.0.3/192.168.0.3
  }
getByInetAddress(192.168.0.3/192.168.0.3)
  showNetworkInterface: name: fxp0 (fxp0) addresses:
192.168.0.3/192.168.0.3;
{
  Name: fxp0
  Display Name: fxp0
  Address: 192.168.0.3/192.168.0.3
  }
getByInetAddress(fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05)
  showNetworkInterface: name: fxp0 (fxp0) addresses:
fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05;
{
  Name: fxp0
  Display Name: fxp0
  Address: fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab0

[kaffe] CVS kaffe (robilad): Small cleanups for NetBSD

2005-04-24 Thread Kaffe CVS
PatchSet 6419 
Date: 2005/04/24 13:46:01
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Small cleanups for NetBSD

2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>

* config/i386/netbsd1/md.h:
Include  for sigcontext on NetBSD CVS head.

* kaffe/kaffevm/systems/unix-pthreads/signal.c:
Include jit-md.h to make sure that exceptionFrame is defined.

Members: 
ChangeLog:1.3947->1.3948 
config/i386/netbsd1/md.h:INITIAL->1.10 
kaffe/kaffevm/systems/unix-pthreads/signal.c:1.20->1.21 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3947 kaffe/ChangeLog:1.3948
--- kaffe/ChangeLog:1.3947  Sun Apr 24 13:27:20 2005
+++ kaffe/ChangeLog Sun Apr 24 13:46:01 2005
@@ -1,5 +1,13 @@
 2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
 
+   * config/i386/netbsd1/md.h:
+   Include  for sigcontext on NetBSD CVS head.
+
+   * kaffe/kaffevm/systems/unix-pthreads/signal.c:
+   Include jit-md.h to make sure that exceptionFrame is defined.
+
+2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
+
* kaffe/kaffevm/systems/unix-pthreads/signal.c 
(nullException, floatingException): Removed prototypes 
that were confusing the compiler on NetBSD CVS HEAD.
===
Checking out kaffe/config/i386/netbsd1/md.h
RCS:  /home/cvs/kaffe/kaffe/config/i386/netbsd1/md.h,v
VERS: 1.10
***
--- /dev/null   Sun Aug  4 19:57:58 2002
+++ kaffe/config/i386/netbsd1/md.h  Sun Apr 24 13:53:15 2005
@@ -0,0 +1,50 @@
+/*
+ * i386/netbsd1/md.h
+ * NetBSD i386 configuration information.
+ *
+ * Copyright (c) 1996, 1997
+ * Transvirtual Technologies, Inc.  All rights reserved.
+ *
+ * Copyright (c) 2003, 2004, 2005
+ *  Kaffe.org contributors. See ChangeLog for details.
+ *
+ * See the file "license.terms" for information on usage and redistribution 
+ * of this file. 
+ */
+
+#ifndef __i386_netbsd1_md_h
+#define __i386_netbsd1_md_h
+
+#include "i386/common.h"
+#include "i386/threads.h"
+
+#if defined(HAVE_SYS_RESOURCE_H)
+#include 
+#endif
+#if defined(HAVE_SYS_SIGNAL_H)
+#include 
+#endif
+#if defined(HAVE_UNISTD_H)
+#include 
+#endif
+
+/*
+ * Redefine stack pointer offset.
+ */
+#undef SP_OFFSET
+#define SP_OFFSET 2
+
+#define SIGNAL_ARGS(sig, sc) int sig, int __code, struct sigcontext *sc
+#define SIGNAL_CONTEXT_POINTER(scp) struct sigcontext *scp
+#define GET_SIGNAL_CONTEXT_POINTER(sc) (sc)
+#define SIGNAL_PC(scp) (scp)->sc_pc
+#define STACK_POINTER(scp) (scp)->sc_sp
+
+#if defined(TRANSLATOR)
+#include "jit-md.h"
+#endif
+
+#include "kaffe-unix-stack.h"
+
+#endif
+
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.20 
kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.21
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.20 Sun Apr 24 
13:27:23 2005
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c  Sun Apr 24 13:46:09 2005
@@ -33,6 +33,7 @@
 #defineEXCEPTIONFRAME(f, c)/* Does nothing */
 #defineEXCEPTIONFRAMEPTR   0
 #elif defined(TRANSLATOR)
+#include "jit-md.h"
 #defineDEFINEFRAME()   exceptionFrame frame
 #defineEXCEPTIONFRAMEPTR   &frame
 #endif /* TRANSLATOR */

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (robilad): Small cleanup in signal.c

2005-04-24 Thread Kaffe CVS
PatchSet 6418 
Date: 2005/04/24 13:27:20
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Small cleanup in signal.c

2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>

* kaffe/kaffevm/systems/unix-pthreads/signal.c
(nullException, floatingException): Removed prototypes
that were confusing the compiler on NetBSD CVS HEAD.
(jthread_initexceptions): Moved further to the back
to make sure it picks up the declarations of
nullException and floatingException.

Members: 
ChangeLog:1.3946->1.3947 
kaffe/kaffevm/systems/unix-pthreads/signal.c:INITIAL->1.20 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3946 kaffe/ChangeLog:1.3947
--- kaffe/ChangeLog:1.3946  Sun Apr 24 12:36:55 2005
+++ kaffe/ChangeLog Sun Apr 24 13:27:20 2005
@@ -1,5 +1,14 @@
 2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
 
+   * kaffe/kaffevm/systems/unix-pthreads/signal.c 
+   (nullException, floatingException): Removed prototypes 
+   that were confusing the compiler on NetBSD CVS HEAD.
+   (jthread_initexceptions): Moved further to the back 
+   to make sure it picks up the declarations of 
+   nullException and floatingException.
+   
+2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
+
Resynced with GNU Classpath:
 
2005-04-23  Tom Tromey  <[EMAIL PROTECTED]>
===
Checking out kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c
RCS:  /home/cvs/kaffe/kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c,v
VERS: 1.20
***
--- /dev/null   Sun Aug  4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c  Sun Apr 24 13:33:56 2005
@@ -0,0 +1,519 @@
+/*
+ * signal.c
+ * Implement signal-based exception handling
+ *
+ * Copyright (c) 1996, 1997, 1998, 1999
+ * Transvirtual Technologies, Inc.  All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and redistribution 
+ * of this file. 
+ */
+
+#include "config.h"
+#include "debug.h"
+#include "config-std.h"
+#include "config-signal.h"
+#include "config-mem.h"
+#include "config-setjmp.h"
+#include "gtypes.h"
+#include "jsignal.h"
+#include "md.h"
+#include "stackTrace-impl.h"
+#include "thread-internal.h"
+#include "files.h"
+#include "kaffe/jmalloc.h"
+#include 
+#ifdef KAFFE_BOEHM_GC
+#include "boehm-gc/boehm/include/gc.h"
+#endif
+
+#if defined(INTERPRETER)
+#defineDEFINEFRAME()   /* Does nothing */
+#defineEXCEPTIONPROTO  int sig
+#defineEXCEPTIONFRAME(f, c)/* Does nothing */
+#defineEXCEPTIONFRAMEPTR   0
+#elif defined(TRANSLATOR)
+#defineDEFINEFRAME()   exceptionFrame frame
+#defineEXCEPTIONFRAMEPTR   &frame
+#endif /* TRANSLATOR */
+
+#ifndef STACK_STRUCT
+#define STACK_STRUCT stack_t
+#endif
+
+#if defined(__WIN32__)
+#define SIG_T   void(*)()
+#else
+#define SIG_T   void*
+#endif
+
+static void ignoreSignal(int sig);
+
+static exchandler_t nullHandler;
+static exchandler_t floatingHandler;
+static exchandler_t stackOverflowHandler;
+
+/*
+ * Null exception - catches bad memory accesses.
+ */
+static void
+nullException(SIGNAL_ARGS(sig, ctx))
+{
+void *stackptr;
+   jthread_t current_thread;
+
+   DEFINEFRAME();
+
+   /* Restore the signal handler if necessary */
+   restoreSyncSignalHandler(sig, nullException);
+
+   /* Clean up the synchronous signal state (just unblock this signal) */
+   unblockSignal(sig);
+
+   EXCEPTIONFRAME(frame, ctx);
+#if defined(STACK_POINTER)
+   current_thread = jthread_current();
+   stackptr = (void *)STACK_POINTER(GET_SIGNAL_CONTEXT_POINTER(ctx));
+   /* Here we have a stupid heuristic which may not work rightfully
+* if kaffe allocates a big buffer using alloca (in that case we
+* will get an NPE). But it is better than the previous case which was
+* heating nearly all NPEs on Darwin.
+*/
+#if defined(STACK_GROWS_UP)
+   if (current_thread != NULL && stackptr >= current_thread->stackMax &&
+   stackptr <= (void *)((uintp)current_thread->stackMax+1024))
+#else
+   if (current_thread != NULL && stackptr <= current_thread->stackMin &&
+   stackptr >= (void *)((uintp)current_thread->stackMax-1024))
+#endif
+ stackOverflowHandler(EXCEPTIONFRAMEPTR);
+   else
+#endif // STACK_POINTER
+ nullHandler(EXCEPTIONFRAMEPTR);
+}
+
+/*
+ * Division by zero.
+ */
+static void
+floatingException(EXCEPTIONPROTO)
+{
+   DEFINEFRAME();
+
+   /* Restore the signal handler if necessary */
+   restoreSyncSignalHandler(sig, floatingException);
+
+   /* Clean up the synchronous signal state (just unblock this signal) */
+   unblockSignal(sig);
+
+   EXCEPTIONFRAME(frame, ctx);
+   floatingHandler(EXCEPTIONFRAMEPTR);
+}
+
+/*
+ * Setup the internal exceptions.
+ */
+void
+jthread_initexceptions(exchandler_t _nullHandler,
+  exchandler_t _floatingHandler,
+  

[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: swing fixlet

2005-04-24 Thread Kaffe CVS
PatchSet 6417 
Date: 2005/04/24 12:36:55
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: swing fixlet

2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>

Resynced with GNU Classpath:

2005-04-23  Tom Tromey  <[EMAIL PROTECTED]>

* javax/swing/text/StyleConstants.java (StyleConstants): Now
package-private.

Members: 
ChangeLog:1.3945->1.3946 
libraries/javalib/javax/swing/text/StyleConstants.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3945 kaffe/ChangeLog:1.3946
--- kaffe/ChangeLog:1.3945  Sun Apr 24 12:34:27 2005
+++ kaffe/ChangeLog Sun Apr 24 12:36:55 2005
@@ -2,6 +2,15 @@
 
Resynced with GNU Classpath:
 
+   2005-04-23  Tom Tromey  <[EMAIL PROTECTED]>
+
+* javax/swing/text/StyleConstants.java (StyleConstants): Now
+package-private.
+
+2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
+
+   Resynced with GNU Classpath:
+
2005-04-23  Mark Wielaard  <[EMAIL PROTECTED]>
 
 * java/net/URL.java (URL(URL,String,URLStreamHandler)): Add spec
Index: kaffe/libraries/javalib/javax/swing/text/StyleConstants.java
diff -u kaffe/libraries/javalib/javax/swing/text/StyleConstants.java:1.3 
kaffe/libraries/javalib/javax/swing/text/StyleConstants.java:1.4
--- kaffe/libraries/javalib/javax/swing/text/StyleConstants.java:1.3Mon Oct 
25 19:12:13 2004
+++ kaffe/libraries/javalib/javax/swing/text/StyleConstants.javaSun Apr 
24 12:36:57 2005
@@ -1,5 +1,5 @@
 /* StyleConstants.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -83,8 +83,10 @@
   public static final Object ResolveAttribute = new StyleConstants("resolver");
 
   String keyname;
-  
-  private StyleConstants(String k) 
+
+  // Package-private to avoid accessor constructor for use by
+  // subclasses.
+  StyleConstants(String k) 
   {
 keyname = k;
   }

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (robilad): resynced with GNU Classpath: URL fixlet

2005-04-24 Thread Kaffe CVS
PatchSet 6416 
Date: 2005/04/24 12:34:27
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced with GNU Classpath: URL fixlet

2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>

Resynced with GNU Classpath:

2005-04-23  Mark Wielaard  <[EMAIL PROTECTED]>

* java/net/URL.java (URL(URL,String,URLStreamHandler)): Add spec
to MalformedURLException.

Members: 
ChangeLog:1.3944->1.3945 
libraries/javalib/java/net/URL.java:1.55->1.56 
test/regression/URLTest.java:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3944 kaffe/ChangeLog:1.3945
--- kaffe/ChangeLog:1.3944  Sun Apr 24 10:08:08 2005
+++ kaffe/ChangeLog Sun Apr 24 12:34:27 2005
@@ -2,6 +2,15 @@
 
Resynced with GNU Classpath:
 
+   2005-04-23  Mark Wielaard  <[EMAIL PROTECTED]>
+
+* java/net/URL.java (URL(URL,String,URLStreamHandler)): Add spec
+to MalformedURLException.
+
+2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
+
+   Resynced with GNU Classpath:
+
2005-04-23  Michael Koch  <[EMAIL PROTECTED]>
 
 * java/net/ServerSocket.java
Index: kaffe/libraries/javalib/java/net/URL.java
diff -u kaffe/libraries/javalib/java/net/URL.java:1.55 
kaffe/libraries/javalib/java/net/URL.java:1.56
--- kaffe/libraries/javalib/java/net/URL.java:1.55  Sat Apr 23 10:35:18 2005
+++ kaffe/libraries/javalib/java/net/URL.java   Sun Apr 24 12:34:31 2005
@@ -430,7 +430,8 @@
authority = context.authority;
   }
 else // Protocol NOT specified in spec. and no context available.
-  throw new MalformedURLException("Absolute URL required with null 
context");
+  throw new MalformedURLException("Absolute URL required with null"
+ + " context: " + spec);
 
 protocol = protocol.trim();
 
Index: kaffe/test/regression/URLTest.java
diff -u kaffe/test/regression/URLTest.java:1.5 
kaffe/test/regression/URLTest.java:1.6
--- kaffe/test/regression/URLTest.java:1.5  Sat Dec 27 21:16:02 2003
+++ kaffe/test/regression/URLTest.java  Sun Apr 24 12:34:31 2005
@@ -64,7 +64,7 @@
"foo/bar",
 // This testcase is too strict. I use here the message sent by classpath.
 // "java.net.MalformedURLException: Protocol handler not found: foo/bar"
-   "java.net.MalformedURLException: Absolute URL required with null 
context"
+   "java.net.MalformedURLException: Absolute URL required with null 
context: foo/bar"
 ),
 
 new TestCase(
@@ -120,7 +120,7 @@
"foo/bar",
 // This testcase is too strict. I use here the message sent by classpath.
 // "java.net.MalformedURLException: Protocol handler not found: foo/bar"
-   "java.net.MalformedURLException: Absolute URL required with null 
context"
+   "java.net.MalformedURLException: Absolute URL required with null 
context: foo/bar"
 ),
 
 new TestCase(
@@ -134,7 +134,7 @@
"jar:abc!/eat/me",
 // This testcase is too strict. I use here the message sent by classpath.
 // "java.net.MalformedURLException: invalid inner URL: Protocol handler 
not found: abc"
-   "java.net.MalformedURLException: invalid inner URL: Absolute URL 
required with null context"
+   "java.net.MalformedURLException: invalid inner URL: Absolute URL 
required with null context: abc"
 ),
 
   };

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: doc improvements

2005-04-24 Thread Kaffe CVS
PatchSet 6415 
Date: 2005/04/24 10:08:08
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: doc improvements

2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>

Resynced with GNU Classpath:

2005-04-23  Michael Koch  <[EMAIL PROTECTED]>

* java/net/ServerSocket.java
(getChannel): Improved javadoc comment.

Members: 
ChangeLog:1.3943->1.3944 
libraries/javalib/java/net/ServerSocket.java:INITIAL->1.30 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3943 kaffe/ChangeLog:1.3944
--- kaffe/ChangeLog:1.3943  Sun Apr 24 09:57:31 2005
+++ kaffe/ChangeLog Sun Apr 24 10:08:08 2005
@@ -1,5 +1,14 @@
 2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
 
+   Resynced with GNU Classpath:
+
+   2005-04-23  Michael Koch  <[EMAIL PROTECTED]>
+
+* java/net/ServerSocket.java
+(getChannel): Improved javadoc comment.
+
+2005-04-24  Dalibor Topic  <[EMAIL PROTECTED]>
+
 * include/Makefile.am:
Don't generate JNI headers for removed files.
 
===
Checking out kaffe/libraries/javalib/java/net/ServerSocket.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/java/net/ServerSocket.java,v
VERS: 1.30
***
--- /dev/null   Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/java/net/ServerSocket.java  Sun Apr 24 10:12:24 2005
@@ -0,0 +1,610 @@
+/* ServerSocket.java -- Class for implementing server side sockets
+   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.net;
+
+import gnu.java.net.PlainSocketImpl;
+
+import java.io.IOException;
+import java.nio.channels.IllegalBlockingModeException;
+import java.nio.channels.ServerSocketChannel;
+
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  I believe all methods are implemented.
+ */
+
+/**
+ * This class models server side sockets.  The basic model is that the
+ * server socket is created and bound to some well known port.  It then
+ * listens for and accepts connections.  At that point the client and
+ * server sockets are ready to communicate with one another utilizing
+ * whatever application layer protocol they desire.
+ *
+ * As with the Socket class, most instance methods of this class
+ * simply redirect their calls to an implementation class.
+ *
+ * @author Aaron M. Renn ([EMAIL PROTECTED])
+ * @author Per Bothner ([EMAIL PROTECTED])
+ */
+public class ServerSocket
+{
+  /**
+   * This is the user defined SocketImplFactory, if one is supplied
+   */
+  private static SocketImplFactory factory;
+
+  /**
+   * This is the SocketImp object to which most instance methods in this
+   * class are redirected
+   */
+  private SocketImpl impl;
+
+  /**
+   * True if socket is bound.
+   */
+  private boolean bound;
+
+  /*
+   * This constructor is only used by java.nio.
+   */
+
+  // FIXME: Workaround a bug in gcj.
+  //ServerSocket (PlainSocketImpl impl) throws IOException
+  ServerSocket(SocketImpl impl) throws IOException
+  {
+if (impl == null)
+  throw new NullPointerException("impl may not be null");
+
+this.impl = impl;
+this.impl.create(true);
+  }
+
+  /*
+   * This method is only used by java.nio.
+   */
+
+  // FIXME: Workaround a bug in gcj.
+

[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: better swing text api docs

2005-04-24 Thread Kaffe CVS
PatchSet 6414 
Date: 2005/04/23 20:56:01
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: better swing text api docs

2005-04-23  Dalibor Topic  <[EMAIL PROTECTED]>

Resynced with GNU Classpath:

2005-04-23  Roman Kennke  <[EMAIL PROTECTED]>

* javax/swing/text/Document.java:
Added API documentation comments.

Members: 
ChangeLog:1.3937->1.3938 
libraries/javalib/javax/swing/text/Document.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3937 kaffe/ChangeLog:1.3938
--- kaffe/ChangeLog:1.3937  Sat Apr 23 12:53:58 2005
+++ kaffe/ChangeLog Sat Apr 23 12:56:01 2005
@@ -4,6 +4,15 @@
 
2005-04-23  Roman Kennke  <[EMAIL PROTECTED]>
 
+* javax/swing/text/Document.java:
+Added API documentation comments.
+
+2005-04-23  Dalibor Topic  <[EMAIL PROTECTED]>
+
+   Resynced with GNU Classpath:
+
+   2005-04-23  Roman Kennke  <[EMAIL PROTECTED]>
+
 * javax/swing/text/AbstractDocument.java
 (getDocumentProperties): Implemented.
 (setDocumentProperties): Implemented.
Index: kaffe/libraries/javalib/javax/swing/text/Document.java
diff -u kaffe/libraries/javalib/javax/swing/text/Document.java:1.3 
kaffe/libraries/javalib/javax/swing/text/Document.java:1.4
--- kaffe/libraries/javalib/javax/swing/text/Document.java:1.3  Sun Oct 24 
13:39:22 2004
+++ kaffe/libraries/javalib/javax/swing/text/Document.java  Sat Apr 23 
12:56:02 2005
@@ -40,48 +40,182 @@
 import javax.swing.event.DocumentListener;
 import javax.swing.event.UndoableEditListener;
 
-
+/**
+ * A Document is the model that backs up all text components in Swing.
+ * This interface supports different kinds of implementations, from
+ * simple plain text model up to complex styled HTML or RTF models.
+ */
 public interface Document
 {
+  /**
+   * The key for the property that describes the source of a document.
+   */
   String StreamDescriptionProperty = "stream";
+
+  /**
+   * The key for the property that is the title of a document.
+   */
   String TitleProperty = "title";
 
+  /**
+   * Adds a [EMAIL PROTECTED] DocumentListener} to this document.
+   *
+   * @param listener the DocumentListener to add
+   */
   void addDocumentListener(DocumentListener listener);
 
+  /**
+   * Adds an [EMAIL PROTECTED] UndoableEditListener} to this document.
+   *
+   * @param listener the UndoableEditListener to add
+   */
   void addUndoableEditListener(UndoableEditListener listener);
 
+  /**
+   * Creates a mark in the character content at the specified offset.
+   *
+   * @param offs the offset where to place the mark
+   *
+   * @return the created Position object
+   *
+   * @throws BadLocationException of the specified offset is not a valid
+   * position in the documents content
+   */
   Position createPosition(int offs)
 throws BadLocationException;
 
+  /**
+   * Returns the default root element. Views should be using this element
+   * unless other mechanisms for assigning views to element structure is
+   * provided.
+   *
+   * @return the default root element
+   */
   Element getDefaultRootElement();
 
+  /**
+   * Returns the position that marks the end of the document.
+   *
+   * @return the position that marks the end of the document
+   */
   Position getEndPosition();
 
+  /**
+   * Returns the length of the document content.
+   *
+   * @return the length of the document content
+   */
   int getLength();
 
+  /**
+   * Returns a document property with the specified key.
+   *
+   * @param key the (non-null) key for the property to fetch
+   *
+   * @return the property for key or null if no such property
+   * is stored
+   */
   Object getProperty(Object key);
 
+  /**
+   * Returns the root elements of the document content.
+   *
+   * @return the root elements of the document content
+   */
   Element[] getRootElements();
 
+  /**
+   * Returns the position that marks the beginning of the document
+   * content.
+   *
+   * @return the start position
+   */
   Position getStartPosition();
 
+  /**
+   * Returns the textual content starting at offset with
+   * a length of length.
+   *
+   * @param offset the beginning of the text fragment to fetch
+   * @param length the length of the text fragment to fetch
+   *
+   * @return the text fragment starting at offset with
+   * a length of length
+   *
+   * @throws BadLocationException if offset or length
+   * are no valid locations in the document content
+   */
   String getText(int offset, int length)
 throws BadLocationException;
 
+  /**
+   * Fetch the textual content starting at offset with
+   * a length of length and store it in txt.
+   *
+   * @param offset the beginning of the text fragment to fetch
+   * @param length the length of the text fragment to fetch
+   * @param txt the Segment where to store the text fragment
+   *
+   * @throws BadLocationException if offset or length
+   * are no