public inbox for frysk-cvs@sourceware.org help / color / mirror / Atom feed
From: rmoseley@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Added output to kill command and added unload command. Date: Mon, 11 Feb 2008 23:27:00 -0000 [thread overview] Message-ID: <20080211232718.29822.qmail@sourceware.org> (raw) The branch, master has been updated via 63b760ae473b2baa4b520bcbc5e0f725a5e6d7a8 (commit) from fe1332147611ba2f06e3f5ad38339c2763847dc2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 63b760ae473b2baa4b520bcbc5e0f725a5e6d7a8 Author: Rick Moseley <rmoseley@localhost.localdomain> Date: Mon Feb 11 17:27:04 2008 -0600 Added output to kill command and added unload command. * KillCommand.java: Added path-to-proc to the output info. * TopLevelCommand.java: Added UnloadCommand.java. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 2 ++ frysk-core/frysk/hpd/KillCommand.java | 28 +++++++++++++++++----------- frysk-core/frysk/hpd/TopLevelCommand.java | 1 + 3 files changed, 20 insertions(+), 11 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 18c0667..0f710d5 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -3,6 +3,8 @@ * UnloadCommand.java: New to unload loaded processes. * LoadCommand.java: Add capability to list loaded procs. * TestLoadCommand.java: Test above. + * KillCommand.java: Added path-to-proc to the output info. + * TopLevelCommand.java: Added UnloadCommand.java. 2008-02-08 Stan Cox <scox@redhat.com> diff --git a/frysk-core/frysk/hpd/KillCommand.java b/frysk-core/frysk/hpd/KillCommand.java index 66fc1f4..5291c87 100644 --- a/frysk-core/frysk/hpd/KillCommand.java +++ b/frysk-core/frysk/hpd/KillCommand.java @@ -39,8 +39,11 @@ package frysk.hpd; -import java.util.ArrayList; +//import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; import frysk.proc.Proc; import frysk.proc.Task; import java.util.List; @@ -60,18 +63,20 @@ public class KillCommand extends ParameterizedCommand { public void interpret(CLI cli, Input cmd, Object options) { - ArrayList saveProcs = new ArrayList(); + Map saveProcs = new HashMap(); + saveProcs = new TreeMap(); int procPID = 0; - Iterator foo = cli.targetset.getTasks(); + Iterator foo = cli.targetset.getTaskData(); while (foo.hasNext()) { - Task task = (Task) foo.next(); + TaskData taskData = (TaskData) foo.next(); + Task task = taskData.getTask(); Proc proc = task.getProc(); if (proc.getPid() != procPID) { - cli.addMessage("Killing process " + proc.getPid(), - // " that was created from " + proc.getExe(), + cli.addMessage("Killing process " + proc.getPid() + + " that was created from " + proc.getExe(), Message.TYPE_NORMAL); // Save the procs we are killing so we can re-load them later - saveProcs.add(proc.getExe()); + saveProcs.put(new Integer(taskData.getParentID()), proc.getExe()); procPID = proc.getPid(); // Now, call the Proc object to kill off the executable(s) proc.requestKill(); @@ -81,19 +86,20 @@ public class KillCommand extends ParameterizedCommand { synchronized (cli) { // Clear the running procs set cli.runningProcs.clear(); - // Clear the current targetset - cli.idManager.clearProcIDs(); // Clear the stepping engine structures cli.steppingEngine.clear(); // Add back in the stepping observer for cli cli.steppingEngine.addObserver(cli.steppingObserver); } // Now loop through and re-load all of the killed procs - Iterator bar = saveProcs.iterator(); + Iterator bar = saveProcs.keySet().iterator(); while (bar.hasNext()) { - String cmdline = (String) bar.next(); + Integer procId = (Integer) bar.next(); + String cmdline = (String) saveProcs.get(procId); + cli.taskID = procId.intValue(); cli.execCommand("load " + cmdline + "\n"); } + cli.taskID = -1; } int completer(CLI cli, Input input, int cursor, List completions) { diff --git a/frysk-core/frysk/hpd/TopLevelCommand.java b/frysk-core/frysk/hpd/TopLevelCommand.java index af6e2b4..78c226b 100644 --- a/frysk-core/frysk/hpd/TopLevelCommand.java +++ b/frysk-core/frysk/hpd/TopLevelCommand.java @@ -114,6 +114,7 @@ public class TopLevelCommand extends MultiLevelCommand { add(new StepInstructionCommand(), "stepi"); add(new StepNextCommand(), "n|ext"); add(new StepNextiCommand(), "nexti"); + add(new UnloadCommand(), "un|load"); add(new WhatCommand(), "what"); add(new WhichsetsCommand(), "whichsets"); add(new ViewsetCommand(), "viewset"); hooks/post-receive -- frysk system monitor/debugger
reply other threads:[~2008-02-11 23:27 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080211232718.29822.qmail@sourceware.org \ --to=rmoseley@sourceware.org \ --cc=frysk-cvs@sourceware.org \ --cc=frysk@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).