This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for bug#2999


Checked in. Thanks for the patch!!

Rick

Yao Qi wrote:
In frysk-import/lib/dw/tests/cni/TestLib.cxx, getFuncAddr() wants to get the function address via its function name in source code, but it is not true on PPC64. According to PowerPC 64-bit ABI, function name is only a function descriptor, not entry address,
and the first doubleword of function descriptor contains the address of the entry point of the function.


2006-08-07 Yao Qi <qiyaoltc@cn.ibm.com>

	* lib/dw/tests/cni/TestLib.cxx (getFuncAddr): Return function
	address instead of function descriptor on PPC64.
	* lib/dw/tests/TestDwfl.java: Take powerpc into account, and
	change the expected line numbers.

Rebuild frysk on X86, X86_64, and PPC64, and no FAIL any more in
lib.dw.tests.TestDwfl after this patch applied.

OK to commit? Thanks!
------------------------------------------------------------------------


Index: frysk-imports/lib/dw/tests/TestDwfl.java
===================================================================
RCS file: /cvs/frysk/frysk-imports/lib/dw/tests/TestDwfl.java,v
retrieving revision 1.10
diff -u -r1.10 TestDwfl.java
--- frysk-imports/lib/dw/tests/TestDwfl.java 31 Jul 2006 19:05:13 -0000 1.10
+++ frysk-imports/lib/dw/tests/TestDwfl.java 7 Aug 2006 06:51:09 -0000
@@ -78,10 +78,14 @@
String filename = line.getSourceFile();
assertEquals("TestLib.cxx",
filename.substring(filename.lastIndexOf("/") + 1));
- if(Build.BUILD_ARCH.indexOf("_64") == -1)
- assertEquals(51, line.getLineNum());
+
+ if(Build.BUILD_ARCH.indexOf("x86_64") != -1)
+ assertEquals(55, line.getLineNum());
+ else if (Build.BUILD_ARCH.indexOf("powerpc") != -1)
+ assertEquals(53, line.getLineNum());
else
- assertEquals(52, line.getLineNum());
+ assertEquals(51, line.getLineNum());
+
assertEquals(0, line.getColumn());
}
Index: frysk-imports/lib/dw/tests/cni/TestLib.cxx
===================================================================
RCS file: /cvs/frysk/frysk-imports/lib/dw/tests/cni/TestLib.cxx,v
retrieving revision 1.2
diff -u -r1.2 TestLib.cxx
--- frysk-imports/lib/dw/tests/cni/TestLib.cxx 6 Jun 2006 18:35:11 -0000 1.2
+++ frysk-imports/lib/dw/tests/cni/TestLib.cxx 7 Aug 2006 06:51:09 -0000
@@ -44,10 +44,14 @@
jint
lib::dw::tests::TestLib::getPid(){
- return (jint) getpid();
+ return (jint) getpid();
}
jlong
lib::dw::tests::TestLib::getFuncAddr(){
- return (jlong) &getFuncAddr;
+#ifdef __powerpc64__
+ return *((jlong*) &getFuncAddr);
+#else
+ return (jlong) &getFuncAddr;
+#endif
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]