From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16239 invoked by alias); 1 Mar 2008 17:56:53 -0000 Received: (qmail 16224 invoked by uid 22791); 1 Mar 2008 17:56:53 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,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; Sat, 01 Mar 2008 17:56:24 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m21HuM5O016602 for ; Sat, 1 Mar 2008 12:56:22 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m21HuMHH006725 for ; Sat, 1 Mar 2008 12:56:22 -0500 Received: from opsy.redhat.com (vpn-14-173.rdu.redhat.com [10.11.14.173]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m21HuLkW024678; Sat, 1 Mar 2008 12:56:22 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id C40173780C7; Sat, 1 Mar 2008 10:06:10 -0700 (MST) To: Frysk List Subject: Patch: bug 5731 From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Sat, 01 Mar 2008 17:56:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 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: 2008-q1/txt/msg00090.txt.bz2 This fixes bug 5731, which is that the output of plain "set" is ugly. Previously I "washed" the ChangeLog entry when sending a patch. I don't know if that is what you want or not. This time I didn't. Tom diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog index 7aba61e..7832a4d 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 Tom Tromey * ParameterizedCommand.java (help): Use getWordWrapWriter. Set 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()); + } + } }