aboutsummaryrefslogtreecommitdiff
path: root/libjava/include/name-finder.h
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/include/name-finder.h')
-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 805725b..67ae058 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)