From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16870 invoked by alias); 25 May 2010 20:52:50 -0000 Received: (qmail 16861 invoked by uid 22791); 25 May 2010 20:52:49 -0000 X-Spam-Check-By: sourceware.org Received: from pool-173-76-55-5.bstnma.fios.verizon.net (HELO cgf.cx) (173.76.55.5) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Tue, 25 May 2010 20:52:43 +0000 Received: from ednor.cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 9271813C061; Tue, 25 May 2010 16:52:41 -0400 (EDT) Received: by ednor.cgf.cx (Postfix, from userid 201) id 8F75F2B352; Tue, 25 May 2010 16:52:41 -0400 (EDT) Date: Tue, 25 May 2010 21:01:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Pierre Muller Subject: Re: [RFA] windows-nat.c: Copy console information for new console Message-ID: <20100525205241.GA5298@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Pierre Muller References: <001901caf934$fd580460$f8080d20$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001901caf934$fd580460$f8080d20$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00580.txt.bz2 On Sat, May 22, 2010 at 12:28:51AM +0200, Pierre Muller wrote: > Using >(gdb) set new-console on >on Windows native is nice for some features but is >also terribly annoying sometimes. > Especially on nice big displays, because >the newly created console is 25 lines times 80 columns >by default which is really not much when you usually work on >60 or more lines. > This patch copies the values of the current console >(if it exists) and uses the same parameters to start >the new-console. I copied both the window and the buffer >size (having a long buffer allows to see history of output...). > > I did, on purpose not set the same position for the new >console, which results in a usual shift to the left and down >avoid a complete overlap of the windows. > > This make using new-console much easier to use. >A possible extension would be to be able to >specify these parameters with something like >(gdb) set w32 console lines 45 > There is apparently no way to specify the >font. This might lead to windows size that are not optimal >for the buffer size used, and it is calculated on the current >console font which might not be the default font. But I don't know >how to find out what the default font is. > I tested this patch on Windows XP and on >Windows 2008 64-bit run mingw64 GDB. > > >Pierre Muller >Pascal language support maintainer for GDB > >2010-05-21 Pierre Muller > > * windows-nat.c (GetConsoleFontSize, GetCurrentConsoleFont): > New macros. > (windows_create_inferior): Copy current console information > into SI structure if on a console if new-console is on. > (bad_GetCurrentConsoleFont, bad_GetConsoleFontSize): New functions. > (_initialize_loadable): Initialize GetConsoleFontSize and > GetCurrentConsoleFont. I don't mind the concept but this function is becoming pretty big so I would appreciate it if you would move all of the logic into a function. Maybe call it "set_console_info()" and pass it &flags, &si. cgf