X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FLinux.cc;h=37118c3a6e2b7db1e4b7140071788dc52da992ce;hb=ac0b1db223ee818fa2fe812d8d2e18089781ee6a;hp=9a9e324af7cb17105804112f0b1e31f7d7da664b;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104;p=org.ibex.core.git diff --git a/src/org/ibex/plat/Linux.cc b/src/org/ibex/plat/Linux.cc index 9a9e324..37118c3 100644 --- a/src/org/ibex/plat/Linux.cc +++ b/src/org/ibex/plat/Linux.cc @@ -1,21 +1,27 @@ +// IMPORTANT: inclusion order: always include gcjh'ed headers first, then superclass cc's, then system headers +#undef file #include -#include "X11.cc" - +#include +#include +#include #include +#include "X11.cc" +#include // we love libgcj! extern const char **_Jv_argv; extern int _Jv_argc; void org::ibex::plat::Linux::fixEnvironment() { - // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html - const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL"); - if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) { - int result; - printf("respawning self (%s) with LD_ASSUME_KERNEL=2.4.1\n", _Jv_argv[0]); - setenv("LD_ASSUME_KERNEL", "2.4.1", 1); - result = execvp(_Jv_argv[0], (char* const*)((void*)_Jv_argv)); - printf("execvp() failed with error code %d\n", result); - exit(-1); - } + // this wreaks havoc on gdb + // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html + const char* ld_assume_kernel = getenv("LD_ASSUME_KERNEL"); + if (ld_assume_kernel == NULL || strcmp("2.4.1", ld_assume_kernel)) { + int result; + printf("respawning self (%s) with LD_ASSUME_KERNEL=2.4.1\n", _Jv_argv[0]); + setenv("LD_ASSUME_KERNEL", "2.4.1", 1); + result = execvp(_Jv_argv[0], (char* const*)((void*)_Jv_argv)); + printf("execvp() failed with error code %d\n", result); + exit(-1); + } }