summaryrefslogtreecommitdiffstats
path: root/libjava/include
diff options
context:
space:
mode:
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-12 12:52:44 +0000
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-12 12:52:44 +0000
commitec6c77248c565ea404891e933f58ecd7909fa674 (patch)
treefd16f76f98f4b5e364614153e8902a370d5f36e2 /libjava/include
parentcb39cd35980128baee5b7a01f68ed21b3f71da4b (diff)
downloadppe42-gcc-ec6c77248c565ea404891e933f58ecd7909fa674.tar.gz
ppe42-gcc-ec6c77248c565ea404891e933f58ecd7909fa674.zip
* 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(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include')
-rw-r--r--libjava/include/name-finder.h36
1 files changed, 24 insertions, 12 deletions
diff --git a/libjava/include/name-finder.h b/libjava/include/name-finder.h
index 805725b4b69..67ae0587fb0 100644
--- a/libjava/include/name-finder.h
+++ b/libjava/include/name-finder.h
@@ -29,6 +29,8 @@ details. */
#include <unistd.h>
#endif
+#include <java/lang/StackTraceElement.h>
+
/* _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)
OpenPOWER on IntegriCloud