From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14512 invoked by alias); 10 Aug 2007 01:49:56 -0000 Received: (qmail 14070 invoked by uid 22791); 10 Aug 2007 01:49:53 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,FORGED_RCVD_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Aug 2007 01:49:50 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7A1nmA1011736 for ; Thu, 9 Aug 2007 21:49:48 -0400 Received: from pobox.hsv.redhat.com (pobox.hsv.redhat.com [172.16.16.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7A1njMU030008; Thu, 9 Aug 2007 21:49:46 -0400 Received: from localhost.localdomain (vpn-14-13.rdu.redhat.com [10.11.14.13]) by pobox.hsv.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l7A1nfHR025556; Thu, 9 Aug 2007 21:49:43 -0400 Message-ID: <46BBC434.3080708@redhat.com> Date: Fri, 10 Aug 2007 01:49:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 2.0.0.5 (X11/20070719) MIME-Version: 1.0 To: frysk@sourceware.org, Tim Moore Subject: Re: frysk-core/frysk hpd/AllPTSet.java hpd/CLI.jav ... References: <20070809170656.7895.qmail@sourceware.org> <46BB9ED1.40100@redhat.com> <46BBAB69.8050008@redhat.com> In-Reply-To: <46BBAB69.8050008@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00288.txt.bz2 Think I fixed it. The below patch returns the correct ArrayList iterator in StaticPTSet. Tasks are now returned over TaskData. Index: StaticPTSet.java =================================================================== RCS file: /cvs/frysk/frysk-core/frysk/hpd/StaticPTSet.java,v retrieving revision 1.1 diff -u -p -r1.1 StaticPTSet.java --- StaticPTSet.java 25 Jul 2007 00:37:25 -0000 1.1 +++ StaticPTSet.java 10 Aug 2007 01:48:05 -0000 @@ -98,7 +98,7 @@ class StaticPTSet implements PTSet result.add( ((TaskData) temp.get(j)).getTask() ); } - return temp.iterator(); + return result.iterator(); } public Iterator getTaskData() Phil Muldoon wrote: > I did a simple adjustment here > > [pmuldoon@localhost hpd]$ cvs diff WhereCommand.java > Index: WhereCommand.java > =================================================================== > RCS file: /cvs/frysk/frysk-core/frysk/hpd/WhereCommand.java,v > retrieving revision 1.4 > diff -u -p -r1.4 WhereCommand.java > --- WhereCommand.java 9 Aug 2007 17:13:49 -0000 1.4 > +++ WhereCommand.java 9 Aug 2007 23:50:07 -0000 > @@ -69,7 +69,7 @@ class WhereCommand > level = Integer.parseInt((String)params.get(0)); > Iterator taskIter = ptset.getTasks(); > while (taskIter.hasNext()) { > - Task task = (Task)taskIter.next(); > + Task task = ((TaskData)taskIter.next()).getTask(); > DebugInfoFrame tmpFrame = null; > int l = cli.getTaskStackLevel(task); > int stopLevel; > > And that makes it work for corefile tasks, but fail for live tasks > with the exception: > > [pmuldoon@localhost bindir]$ ./fhpd 15630 > Attached to process 15630 > (fhpd) where > Inside where command > java.lang.ClassCastException: frysk.proc.live.LinuxTask cannot be cast > to frysk.hpd.TaskData > at frysk.hpd.WhereCommand.handle(WhereCommand.java:74) > at frysk.hpd.CLI.execCommand(CLI.java:436) > at frysk.bindir.fhpd.main(fhpd.java:148) > Internal debugger error: frysk.proc.live.LinuxTask cannot be cast to > frysk.hpd.TaskData > > > Could be a case of weak typing? Plugged green wire into red jack and > all that ;) > > > Regards > > Phil > > Phil Muldoon wrote: >> Tim >> >> At first glance, and I could be wrong, but this commit appears to have >> broken all core file operations in fhpd. >> >> [pmuldoon@localhost bindir]$ ./fhpd core.3260 /bin/bash >> Attached to core file: >> /home/pmuldoon/frysk_bin/frysk-core/frysk/bindir/core.3260 >> (fhpd) where >> java.lang.ClassCastException: frysk.hpd.TaskData cannot be cast to >> frysk.proc.Task > >> at frysk.hpd.WhereCommand.handle(WhereCommand.java:72) >> at frysk.hpd.CLI.execCommand(CLI.java:436) >> at frysk.bindir.fhpd.main(fhpd.java:148) >> Internal debugger error: frysk.hpd.TaskData cannot be cast to >> frysk.proc.Task >> (fhpd) quit >> java.lang.ClassCastException: frysk.hpd.TaskData cannot be cast to >> frysk.proc.Task >> at frysk.hpd.DetachCommand.handle(DetachCommand.java:68) >> at frysk.hpd.QuitCommand.handle(QuitCommand.java:67) >> at frysk.hpd.CLI.execCommand(CLI.java:436) >> at frysk.bindir.fhpd.main(fhpd.java:148) >> Quitting... >> Internal debugger error: frysk.hpd.TaskData cannot be cast to >> frysk.proc.Task >> >> >> moore@sourceware.org wrote: >>> CVSROOT: /cvs/frysk >>> Module name: frysk-core >>> Changes by: moore@sourceware.org 2007-08-09 17:06:56 >>> >>> Modified files: >>> frysk/hpd : AllPTSet.java CLI.java ChangeLog >>> frysk/rt : ChangeLog Added files: >>> frysk/rt : ProcTaskIDManager.java Removed files: >>> frysk/hpd : TestSetCreation.java >>> Log message: >>> Infrastructure for ptsets based on real processes and tasks >>> frysk-core/frysk/hpd/ChangeLog >>> 2007-08-08 Tim Moore >>> * AllPTSet.java: Complete rewrite to reference active Procs and >>> Tasks via the ProcTaskIDManager. >>> * CLI.java (idManager): New variable, reference to >>> ProcTaskIDManager. >>> (startAttach): Only initialize steppingEngine once. >>> (CLI): Initialize idManager. >>> (getCommandPTSet): New method. >>> * TestSetCreation.java: Remove file because AllPTSet doesn't >>> support creation of random proc/task numbers anymore. >>> frysk-core/frysk/rt/ChangeLog >>> 2007-08-08 Tim Moore >>> * ProcTaskIDManager.java: New file. >>> >>> Patches: >>> http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/hpd/AllPTSet.java.diff?cvsroot=frysk&r1=1.1&r2=1.2 >>> >>> http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/hpd/CLI.java.diff?cvsroot=frysk&r1=1.7&r2=1.8 >>> >>> http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/hpd/ChangeLog.diff?cvsroot=frysk&r1=1.27&r2=1.28 >>> >>> http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/hpd/TestSetCreation.java.diff?cvsroot=frysk&r1=1.1&r2=NONE >>> >>> http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/rt/ProcTaskIDManager.java.diff?cvsroot=frysk&r1=NONE&r2=1.1 >>> >>> http://sourceware.org/cgi-bin/cvsweb.cgi/frysk-core/frysk/rt/ChangeLog.diff?cvsroot=frysk&r1=1.352&r2=1.353 >>> >>> >>> >> >> >