This is the mail archive of the
frysk-cvs@sources.redhat.com
mailing list for the frysk project.
[SCM] master: frysk-core/frysk/hpd/TaskData only print task id if more than one task
- From: npremji at sourceware dot org
- To: frysk-cvs at sourceware dot org
- Date: 24 Jan 2008 22:47:11 -0000
- Subject: [SCM] master: frysk-core/frysk/hpd/TaskData only print task id if more than one task
- Reply-to: frysk at sourceware dot org
The branch, master has been updated
via 7a7b1daa37efb9051540f89f92b27e4ed04d6f30 (commit)
from 731d52ca58b0f4fff40f44af122e7e7cd700d9b4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 7a7b1daa37efb9051540f89f92b27e4ed04d6f30
Author: Nurdin Premji <nurdin@localhost.localdomain>
Date: Thu Jan 24 17:43:07 2008 -0500
frysk-core/frysk/hpd/TaskData only print task id if more than one task
-----------------------------------------------------------------------
Summary of changes:
frysk-core/frysk/hpd/ChangeLog | 13 +++++++++++++
frysk-core/frysk/hpd/EvalCommands.java | 3 +--
frysk-core/frysk/hpd/StackCommands.java | 6 ++----
frysk-core/frysk/hpd/TaskData.java | 27 ++++++++++++++++++---------
4 files changed, 34 insertions(+), 15 deletions(-)
First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index db01d4f..d521c46 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,14 @@
+2008-01-24 Nurdin Premji <npremji@redhat.com>
+
+ * TaskData.java (toPrint): Renamed to ...
+ (printHeader): also removed boolean parameter
+ Was always set to true anyway.
+ Only print header if process has more than one task. bug #5417
+ Move extra println into this method, rather than after all calls to this function.
+ * EvalCommands.java (eval): Updated due to TaskData.printHeader name change.
+ * StackCommands.java (select): Ditto.
+ (Where.interpret): Ditto.
+
2008-01-24 Stan Cox <scox@redhat.com>
* AttachCommand.java (Options): New. Add -sysroot option.
@@ -30,6 +41,8 @@
* TestCoreCommand.java: Replace TestLinuxCore with
CoreFileAtSignal.
+=======
+>>>>>>> frysk-core/frysk/hpd/TaskData only print task id if more than one task:frysk-core/frysk/hpd/ChangeLog
2008-01-23 Rick Moseley <rmoseley@redhat.com>
* TestRunCommand.java (testRunCommandParamter): New.
diff --git a/frysk-core/frysk/hpd/EvalCommands.java b/frysk-core/frysk/hpd/EvalCommands.java
index cdf6c9a..e796acc 100644
--- a/frysk-core/frysk/hpd/EvalCommands.java
+++ b/frysk-core/frysk/hpd/EvalCommands.java
@@ -154,8 +154,7 @@ abstract class EvalCommands extends ParameterizedCommand {
if (taskDataIter.hasNext()) {
TaskData td = (TaskData)taskDataIter.next();
task = td.getTask();
- td.toPrint(cli.outWriter, true);
- cli.outWriter.println();
+ td.printHeader(cli.outWriter);
}
Expression result;
try {
diff --git a/frysk-core/frysk/hpd/StackCommands.java b/frysk-core/frysk/hpd/StackCommands.java
index 80093e9..989e5b7 100644
--- a/frysk-core/frysk/hpd/StackCommands.java
+++ b/frysk-core/frysk/hpd/StackCommands.java
@@ -83,8 +83,7 @@ abstract class StackCommands extends ParameterizedCommand {
for (Iterator i = ptset.getTaskData(); i.hasNext(); ) {
TaskData td = (TaskData)i.next();
Task task = td.getTask();
- td.toPrint(cli.outWriter, true);
- cli.outWriter.println();
+ td.printHeader(cli.outWriter);
DebugInfoFrame currentFrame = cli.getTaskFrame(task);
// Where to?
int newLevel;
@@ -218,8 +217,7 @@ abstract class StackCommands extends ParameterizedCommand {
TaskData td = (TaskData)i.next();
Task task = td.getTask();
DebugInfoFrame currentFrame = cli.getTaskFrame(task);
- td.toPrint(cli.outWriter, true);
- cli.outWriter.println();
+ td.printHeader(cli.outWriter);
// XXX: How come the pt set code didn't sort this out;
// filtering out running tasks???
if (cli.getSteppingEngine() == null
diff --git a/frysk-core/frysk/hpd/TaskData.java b/frysk-core/frysk/hpd/TaskData.java
index 5f93cf4..d13f80b 100644
--- a/frysk-core/frysk/hpd/TaskData.java
+++ b/frysk-core/frysk/hpd/TaskData.java
@@ -73,16 +73,25 @@ class TaskData
return parentid + "." + id;
}
- public void toPrint(PrintWriter printWriter, boolean brackets) {
- if (brackets)
- printWriter.write("[");
+ /**
+ * If appropriate (more than one task), print this tasks header
+ * (parentId.id tuple)
+ * @param printWriter the PrintWriter to print output to.
+ */
+ public void printHeader(PrintWriter printWriter) {
+
+ //Check the number of tasks,
+ int numTasks = task.getProc().getTasks().size();
+
+ if (numTasks == 1) {
+ //This is the only task, don't bother printing it's header.
+ return;
+ }
+
+ printWriter.write("[");
printWriter.write(toString());
- if (brackets)
- printWriter.write("]");
- }
-
- public void toPrint(PrintWriter printWriter) {
- toPrint(printWriter, false);
+ printWriter.write("]");
+ printWriter.println();
}
/**
hooks/post-receive
--
frysk system monitor/debugger