diff options
author | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2011-12-16 00:00:43 +0000 |
---|---|---|
committer | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2011-12-16 00:00:43 +0000 |
commit | 1ed753c7d69c8340eebc068b1d5b31d2554ce811 (patch) | |
tree | f16299769978d52cdec478852450851575bca99a /debian/patches/libjava-stacktrace.diff | |
download | gcc-47-1ed753c7d69c8340eebc068b1d5b31d2554ce811.tar.gz |
- create a gcc-4.7 branch
git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.7@5753 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian/patches/libjava-stacktrace.diff')
-rw-r--r-- | debian/patches/libjava-stacktrace.diff | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/debian/patches/libjava-stacktrace.diff b/debian/patches/libjava-stacktrace.diff new file mode 100644 index 0000000..b1e6ab9 --- /dev/null +++ b/debian/patches/libjava-stacktrace.diff @@ -0,0 +1,50 @@ +# DP: libgcj: Lookup source file name and line number in separated +# DP: debug files found in /usr/lib/debug + +--- + libjava/stacktrace.cc | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +--- a/src/libjava/stacktrace.cc ++++ b/src/libjava/stacktrace.cc +@@ -17,6 +17,11 @@ + #include <java-stack.h> + + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#ifdef HAVE_UNISTD_H ++#include <unistd.h> ++#endif + + #include <java/lang/Boolean.h> + #include <java/lang/Class.h> +@@ -260,6 +265,28 @@ + finder->lookup (binaryName, (jlong) offset); + *sourceFileName = finder->getSourceFile(); + *lineNum = finder->getLineNum(); ++ if (*lineNum == -1 && info.file_name[0] == '/') ++ { ++ const char *debugPrefix = "/usr/lib/debug"; ++ char *debugPath = (char *) malloc (strlen(debugPrefix) ++ + strlen(info.file_name) ++ + 2); ++ ++ if (debugPath) ++ { ++ strcpy (debugPath, debugPrefix); ++ strcat (debugPath, info.file_name); ++ //printf ("%s: 0x%x\n", debugPath, offset); ++ if (!access (debugPath, R_OK)) ++ { ++ binaryName = JvNewStringUTF (debugPath); ++ finder->lookup (binaryName, (jlong) offset); ++ *sourceFileName = finder->getSourceFile(); ++ *lineNum = finder->getLineNum(); ++ } ++ free (debugPath); ++ } ++ } + if (*lineNum == -1 && NameFinder::showRaw()) + { + gnu::gcj::runtime::StringBuffer *t = |