From dc7b1dda60ba8c8aa03da26f5555d07074cdce3f Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 12 Jul 2002 12:52:44 +0000 Subject: natThrowable.cc (printRawStackTrace): removed. * java/lang/natThrowable.cc (printRawStackTrace): removed. (getStackTrace0): new method. * java/lang/Throwable.java (CPlusPlusDemangler): removed. (printStackTrace(PrintWriter)): replace with pure java implementation. (printRawStackTrace): removed. (getStackTrace0): new method. * java/lang/StackTraceElement.java (toString): add extra whitespace. * gcj/javaprims.h: regenerate class list. * include/name-finder.h (lookup): new returns StackTraceElement*. (method_name, file_name): fields removed. (pid2, f2_pipe, b2_pipe, b2_pipe_fd): new fields. (~_Jv_name_finder): close new descriptors. * name-finder.cc(_Jv_name_finder): setup c++filt helper process. (createStackTraceElement): new method. (lookup): returns StackTraceElement*, uses createStackTraceElement(). From-SVN: r55424 --- libjava/include/name-finder.h | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'libjava/include') diff --git a/libjava/include/name-finder.h b/libjava/include/name-finder.h index 805725b..67ae058 100644 --- a/libjava/include/name-finder.h +++ b/libjava/include/name-finder.h @@ -29,6 +29,8 @@ details. */ #include #endif +#include + /* _Jv_name_finder is a class wrapper around a mechanism that can convert addresses of methods to their names and the names of files in which they appear. */ @@ -47,12 +49,26 @@ public: if (b_pipe_fd != NULL) fclose (b_pipe_fd); + myclose (f2_pipe[0]); + myclose (f2_pipe[1]); + myclose (b2_pipe[0]); + myclose (b2_pipe[1]); + if (b2_pipe_fd != NULL) + fclose (b2_pipe_fd); + if (pid >= 0) { int wstat; // We don't care about errors here. waitpid (pid, &wstat, 0); } + + if (pid2 >= 0) + { + int wstat; + // We don't care about errors here. + waitpid (pid2, &wstat, 0); + } #endif } @@ -60,25 +76,21 @@ public: name and the appropriate line and source file. The caller passes the code pointer in p. - Returns false if the lookup fails. Even if this happens, the field - hex will have been correctly filled in with the pointer. + Returns NULL if the lookup fails. Even if this happens, the field + hex will have been correctly filled in with the pointer. */ - The other fields are method_name and file_name, which lookup will - attempt to fill appropriately. If the lookup has failed, these - fields contain garbage.*/ - bool lookup (void *p); + java::lang::StackTraceElement* lookup (void *p); - char method_name[1024]; - char file_name[1024]; char hex[sizeof (void *) * 2 + 5]; private: void toHex (void *p); + java::lang::StackTraceElement* createStackTraceElement(char *s, char *f); #if defined (HAVE_PIPE) && defined (HAVE_FORK) - pid_t pid; - int f_pipe[2], b_pipe[2]; - FILE *b_pipe_fd; - int error; + pid_t pid, pid2; + int f_pipe[2], b_pipe[2], f2_pipe[2], b2_pipe[2]; + FILE *b_pipe_fd, *b2_pipe_fd; + int demangling_error, lookup_error; // Close a descriptor only if it has not been closed. void myclose (int fd) -- cgit v1.1