This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] windows-nat.c: Copy console information for new console
- From: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: gdb-patches at sourceware dot org, Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Date: Tue, 25 May 2010 16:52:41 -0400
- Subject: Re: [RFA] windows-nat.c: Copy console information for new console
- References: <001901caf934$fd580460$f8080d20$@muller@ics-cnrs.unistra.fr>
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 <muller@ics.u-strasbg.fr>
>
> * 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