You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2006/09/28 08:06:05 UTC
svn commit: r450714 - in /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore:
include/ src/jvmti/ src/kernel_classes/native/ src/stack/
Author: geirm
Date: Wed Sep 27 23:06:04 2006
New Revision: 450714
URL: http://svn.apache.org/viewvc?view=rev&rev=450714
Log:
HARMONY-1602
fix incorrect line numbers in stack trace
Ubuntu 6 - smoke,c-unit. I'm not convinced that this
change was tested as to what it intended tofix, but
it seems to have done no harm
Modified:
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h?view=diff&rev=450714&r1=450713&r2=450714
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_trace.h Wed Sep 27 23:06:04 2006
@@ -136,7 +136,7 @@
* @param[out] file - the pointer to the file reference to be filled by this function
* @param[out] line - the pointer to the line number to be filled by this function
*/
-VMEXPORT void get_file_and_line(Method_Handle method, void *ip, const char **file, int *line);
+VMEXPORT void get_file_and_line(Method_Handle method, void *ip, bool is_ip_past, const char **file, int *line);
#ifdef __cplusplus
}
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h?view=diff&rev=450714&r1=450713&r2=450714
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h Wed Sep 27 23:06:04 2006
@@ -17,6 +17,6 @@
#ifndef _VERSION_SVN_TAG_
#define _VERSION_SVN_TAG_
-#define VERSION_SVN_TAG "450012"
+#define VERSION_SVN_TAG "450693"
#endif // _VERSION_SVN_TAG_
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp?view=diff&rev=450714&r1=450713&r2=450714
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp Wed Sep 27 23:06:04 2006
@@ -217,6 +217,10 @@
jit->get_bc_location_for_native(
inlined_method, ip, &bc);
assert(result == EXE_ERROR_NONE);
+
+ if (0 < stack_depth - iii) {
+ bc--;
+ }
frame_buffer[count].location = bc;
frame_buffer[count].method =
reinterpret_cast<jmethodID>(method);
@@ -232,6 +236,10 @@
jit->get_bc_location_for_native(
method, ip, &bc);
assert(result == EXE_ERROR_NONE);
+
+ if (0 < stack_depth - inlined_depth) {
+ bc--;
+ }
frame_buffer[count].location = bc;
}
}
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp?view=diff&rev=450714&r1=450713&r2=450714
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp Wed Sep 27 23:06:04 2006
@@ -319,7 +319,7 @@
int lineNumber;
const char* fileName;
- get_file_and_line(method, ip, &fileName, &lineNumber);
+ get_file_and_line(method, ip, true, &fileName, &lineNumber);
jstring strFileName;
if (fileName != NULL) {
strFileName = jenv->NewStringUTF(fileName);
@@ -441,7 +441,7 @@
int lineNumber;
const char* fileName;
- get_file_and_line(method, ip, &fileName, &lineNumber);
+ get_file_and_line(method, ip, true, &fileName, &lineNumber);
if (fileName == NULL) fileName = "";
jstring strFileName = jenv->NewStringUTF(fileName);
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp?view=diff&rev=450714&r1=450713&r2=450714
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp Wed Sep 27 23:06:04 2006
@@ -164,7 +164,7 @@
#endif
}
-static void st_get_java_method_info(MethodInfo* info, Method* m, void* ip) {
+static void st_get_java_method_info(MethodInfo* info, Method* m, void* ip, bool is_ip_past) {
info->file_name = NULL;
info->line = -1;
info->method_name = NULL;
@@ -191,7 +191,7 @@
info->method_name[clen + mlen + dlen + 1] = '\0';
const char* f;
- get_file_and_line(m, ip, &f, &info->line);
+ get_file_and_line(m, ip, is_ip_past, &f, &info->line);
}
static void st_print_line(int count, MethodInfo* m) {
@@ -234,10 +234,10 @@
uint32 offset = (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr();
for (uint32 j = 0; j < inlined_depth; j++) {
Method *real_method = cci->get_jit()->get_inlined_method(cci->get_inline_info(), offset, j);
- st_get_java_method_info(&m, real_method, frames[i].ip);
+ st_get_java_method_info(&m, real_method, frames[i].ip, 0 == i);
st_print_line(++count, &m);
}
- st_get_java_method_info(&m, cci->get_method(), frames[i].ip);
+ st_get_java_method_info(&m, cci->get_method(), frames[i].ip, 0 == i);
}
si_goto_previous(si);
}
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp?view=diff&rev=450714&r1=450713&r2=450714
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp Wed Sep 27 23:06:04 2006
@@ -27,7 +27,7 @@
#include "method_lookup.h"
-void get_file_and_line(Method_Handle mh, void *ip, const char **file, int *line) {
+void get_file_and_line(Method_Handle mh, void *ip, bool is_ip_past, const char **file, int *line) {
Method *method = (Method*)mh;
*file = class_get_source_file_name(method_get_class(method));
@@ -62,6 +62,10 @@
//
return;
}
+
+ if (is_ip_past) {
+ bcOffset--;
+ }
*line = method->get_line_number(bcOffset);
#endif
}
@@ -188,7 +192,7 @@
buf->AppendFormatBlock("\tat %s.%s%s", cname, mname, dname);
const char *file;
int line;
- get_file_and_line(stf->method, stf->ip, &file, &line);
+ get_file_and_line(stf->method, stf->ip, false, &file, &line);
if (line==-2)
// Native method