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: step-by-step


Yong,

I've been waiting for you to notice this ;-) As Roland points out this is the PPC sequence:

    load word and reserve
    modify
    store word conditional on still being reserved

that is used to implement locking. It isn't possible to single step this sequence since the step-instruction trap will clear the reservation resulting in the store-word-conditional always failing.

Something more complicated is needed - a step object implemented using frysk.proc's instruction-step and breakpoint primitives, switching between each as needed. This more complicated object could also be expanded to implement operations such as step-until-branch-or-out-of-range.

Andrew

Yong Zheng wrote:
On Fri, 2006-10-13 at 10:18 -0400, Andrew Cagney wrote:
fstep is more than a toy. Having been reduced to using an instruction tracing simulator to track down an SMP races, this forms the foundation of an extremely wicked tool!


Unfortunately, fstep doesnot work well for both 64-bit and 32-bit applications on our PPC64 box(with 4 processors). When we use fstep to step one applications, the application will run into never-ending loop like the following:

0xfe78cb8 (steps: 60000)
        0xfe78cb8       lwarx   r9,0,r31
        0xfe78cbc       cmpw    r9,r11
        0xfe78cc0       bne-    0xfe78ccc
        0xfe78cc4       stwcx.  r0,0,r31
        0xfe78cc8       bne-    0xfe78cb8
0xfe78cb8 (steps: 70000)
        0xfe78cb8       lwarx   r9,0,r31
        0xfe78cbc       cmpw    r9,r11
        0xfe78cc0       bne-    0xfe78ccc
        0xfe78cc4       stwcx.  r0,0,r31
        0xfe78cc8       bne-    0xfe78cb8
0xfe78cb8 (steps: 80000)
        0xfe78cb8       lwarx   r9,0,r31
        0xfe78cbc       cmpw    r9,r11
        0xfe78cc0       bne-    0xfe78ccc
        0xfe78cc4       stwcx.  r0,0,r31
        0xfe78cc8       bne-    0xfe78cb8

The instruction at 0xfe78cb8 is located in libc-2.4.so. The process of
fstep may break down the lwarx/stwcx operations on PPC64.

I created http://sourceware.org/bugzilla/show_bug.cgi?id=3364
Fstep works well on our X86/X86_64 box(of course only with one
processor). So I add our mail addresses in CC list.


Best regards
Yong Zheng



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