From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12929 invoked by alias); 1 Mar 2008 19:56:59 -0000 Received: (qmail 12904 invoked by uid 9112); 1 Mar 2008 19:56:59 -0000 Date: Sat, 01 Mar 2008 19:56:00 -0000 Message-ID: <20080301195659.12889.qmail@sourceware.org> From: mark@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Pretty print set output. Fixes bug #5731. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: beb160770d5b41afd0f2dcf839c11a1a8d16b5e1 X-Git-Newrev: 44abf8cd504efe2e07b0f5b47bc24306b2a3ff52 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00297.txt.bz2 The branch, master has been updated via 44abf8cd504efe2e07b0f5b47bc24306b2a3ff52 (commit) from beb160770d5b41afd0f2dcf839c11a1a8d16b5e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 44abf8cd504efe2e07b0f5b47bc24306b2a3ff52 Author: Mark Wielaard Date: Sat Mar 1 20:56:02 2008 +0100 Pretty print set output. Fixes bug #5731. frysk-core/frysk/hpd/ChangeLog 2008-03-01 Tom Tromey Bugzilla 5731 * DbgVariableCommands.java (Set.interpret): Use DbgVariables.print. * DbgVariables.java (print): New method. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/hpd/ChangeLog | 7 +++++++ frysk-core/frysk/hpd/DbgVariableCommands.java | 4 ++-- frysk-core/frysk/hpd/DbgVariables.java | 13 ++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) First 500 lines of diff: diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 68eaa90..cae852a 100644 --- a/frysk-core/frysk/hpd/ChangeLog +++ b/frysk-core/frysk/hpd/ChangeLog @@ -1,3 +1,10 @@ +2008-03-01 Tom Tromey + + Bugzilla 5731 + * DbgVariableCommands.java (Set.interpret): Use + DbgVariables.print. + * DbgVariables.java (print): New method. + 2008-02-29 Stan Cox * LoadCommand.java (load): Add no sysroot variant. diff --git a/frysk-core/frysk/hpd/DbgVariableCommands.java b/frysk-core/frysk/hpd/DbgVariableCommands.java index f893422..443c21e 100644 --- a/frysk-core/frysk/hpd/DbgVariableCommands.java +++ b/frysk-core/frysk/hpd/DbgVariableCommands.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2005, 2006, 2007 Red Hat Inc. +// Copyright 2005, 2006, 2007, 2008 Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -75,7 +75,7 @@ abstract class DbgVariableCommands extends ParameterizedCommand { throw new InvalidCommandException ("wrong number of parameters"); case 0: - cli.outWriter.println(cli.dbgvars.toString()); + cli.dbgvars.print(cli.outWriter); break; case 1: String var = input.parameter(0); diff --git a/frysk-core/frysk/hpd/DbgVariables.java b/frysk-core/frysk/hpd/DbgVariables.java index 9516abc..950d356 100644 --- a/frysk-core/frysk/hpd/DbgVariables.java +++ b/frysk-core/frysk/hpd/DbgVariables.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2006, 2007, Red Hat Inc. +// Copyright 2006, 2007, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -40,12 +40,14 @@ package frysk.hpd; import java.util.SortedMap; +import java.util.Map; import java.util.TreeMap; import java.util.LinkedList; import java.util.Arrays; import java.lang.Integer; import java.util.Iterator; import java.util.List; +import java.io.PrintWriter; /** * Debugger variable accessible through the "set" command. @@ -184,4 +186,13 @@ public class DbgVariables { CompletionFactory.padSingleCandidate(candidates); return 0; } + + public void print(PrintWriter out) { + for (Iterator i = vars.entrySet().iterator(); i.hasNext(); ) { + Map.Entry e = (Map.Entry) i.next(); + out.print(e.getKey()); + out.print("="); + out.println(((Value) e.getValue()).getValue()); + } + } } hooks/post-receive -- frysk system monitor/debugger