Bug 5107 - testAccessRegisterRead(frysk.stack.TestRegs)junit.framework.AssertionFailedError: esi: expected <0x1bc5daed> but was <0x457319f3>
Summary: testAccessRegisterRead(frysk.stack.TestRegs)junit.framework.AssertionFailedEr...
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Mark Wielaard
URL:
Keywords:
Depends on:
Blocks: 3076
  Show dependency treegraph
 
Reported: 2007-10-04 16:58 UTC by Andrew Cagney
Modified: 2007-10-26 15:19 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2007-10-04 16:58:52 UTC
testAccessRegisterRead(frysk.stack.TestRegs)junit.framework.AssertionFailedError:
esi: expected <0x1bc5daed> but was <0x457319f3>
   at frysk.junit.TestCase.assertEquals(TestRunner)
   at frysk.testbed.RegsCase.testAccessRegisterRead(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
Comment 1 Andrew Cagney 2007-10-04 19:09:54 UTC
suspect line:
src/x86/init.h:39:  c->dwarf.loc[ESI] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EDI);
Comment 2 Andrew Cagney 2007-10-04 21:21:36 UTC
This failure also appears to be fixed by tweaking the above:

testFhpdVirtualStackTrace(frysk.hpd.TestStackCommands)frysk.expunit.TimeoutException:
Timeout of 5 expired
   at frysk.expunit.Expect.expectMilliseconds(TestRunner)
   at frysk.expunit.Expect.expect(TestRunner)
   at frysk.expunit.Expect.expect(TestRunner)
   at frysk.expunit.Expect.expect(TestRunner)
   at frysk.expunit.Expect.expect(TestRunner)
   at frysk.hpd.TestStackCommands.testFhpdVirtualStackTrace(TestRunner)
   at frysk.junit.Runner.runCases(TestRunner)
   at frysk.junit.Runner.runArchCases(TestRunner)
   at frysk.junit.Runner.runTestCases(TestRunner)
   at TestRunner.main(TestRunner)
Comment 3 Mark Wielaard 2007-10-10 14:53:33 UTC
The change in comment #2 is obviously the right thing. I'll commit it and push
it upstream. The failure in comment #3 might be related to bug #4985 ? (It
doesn't fail for me.)
Comment 4 Mark Wielaard 2007-10-10 15:17:44 UTC
OK, there is one failure with checking the eflags.
Depending on the machine they might have status that seems unpredictable (like
whether or not the CPU supports the CPUID setting... sigh).

Hopefully we can somehow get funit-regs.S to set the flags register explictly to
some value we can deterministicaly check. For now I'll disable it, but keep this
bug open.

diff -u -r1.3 RegsCase.java
--- frysk-core/frysk/testbed/RegsCase.java      5 Oct 2007 23:08:34 -0000      1.3
+++ frysk-core/frysk/testbed/RegsCase.java      10 Oct 2007 15:17:25 -0000
@@ -180,7 +180,9 @@
              new byte[] { (byte)0xf3, 0x19, 0x73, 0x45 })
         .put(IA32Registers.EBP, // 0xcbfed73c
              new byte[] { 0x3c, (byte)0xd7, (byte)0xfe, (byte)0xcb })
-        .put(IA32Registers.EFLAGS, BigInteger.valueOf(0x10246L))
+        // eflags depend partly on hardware (like the ID flag)
+        // so don't test for now... BigInteger.valueOf(0x200246))
+        .put(IA32Registers.EFLAGS, null)
         .put(IA32Registers.ESP, // 0x93d4a6ed
              new byte[] { (byte)0xed, (byte)0xa6, (byte)0xd4, (byte)0x93 })
        .put(IA32Registers.EIP, null)
Comment 5 Andrew Cagney 2007-10-15 19:02:08 UTC
I added a mask.
Comment 6 Mark Wielaard 2007-10-26 15:19:01 UTC
Masked is now properly used:

2007-10-15  Andrew Cagney  <cagney@redhat.com>

        * RegsCase.java (taskObject(Task)): Delete.
        (access(Register,int,int,byte[],int,boolean)): Relace
        accessRegister(Object,Register,int,int,byte[],int,boolean).
        (Value, ByteValue, BigIntegerValue, MaskedValue, SymbolValue)
        (NoValue): New.
        (Values): Replace ValueMap.
        (IA32): Provide values for EIP and maksed EFLAGS.
        * TestRegs.java: Update.

2007-10-26  Mark Wielaard  <mwielaard@redhat.com>

        * RegsCase.java (IA32): Don't subtract one from EFLAGS bit mask.