Re: [RFA]: TUI documentation

Stephane Carrez
2001-07-23T14:11:00Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 27430 bytes --]

Hi!

Eli Zaretskii a Ã©crit :
> Thanks for working on this
>
> The patch is approved, provided that you fix the following minor
> problems:
>
> > +@set TUI TUI
>
> Why did you need this, and why did you need to use @value{TUI} later,
> instead of the literal "TUI"?
>

I was wondering whether I could use some specific font, specific character
layout and so on. It's probably too much a trouble. I removed it.

> > +@cindex Tui
>
> All the @cindex entries in the GDB manual begin with a lower-case
> letter. So this should either be "TUI" or "tui", but not capitalized.
>
> > +The @value{TUI} is available only when @value{GDBN} is configured
> > +with the @code{--enable-tui} configure option.
>
> A cross-reference to the "Configure Options" node would be useful
> here. Maybe --enable-tui should be mentioned in that node as well, if
> you think it is important enough.

Ok. I added a reference but the "Configure Options" chapter does not speak
about --enable-*. I prefer not to add something there because it would mean
some general description.

>
> > +These three windows are aranged by the @value{TUI} according to several
> ^^^^^^^
> "arranged".
>
> > +@node TUI Keys
> > +@section TUI Key Bindings
>
> Please add a @cindex entry for "TUI key bindings".
>
> > +@table @key
>
> This should be @kbd, not @key. The latter will typeset the key
> sequences in a frame that's intended to produce a picture of a
> keyboard key, which is not what you want, since "C-x C-a" is not a
> single key.
>
> > +@item C-x C-a
> > +@item C-x a
> > +@item C-x A
>
> You cannot have more than one @item in a row; use @itemx for all but
> the first one. Otherwise, the result will look as if the following
> text refers only to the last @item.
>
> Also, these keys (as well as all the other key sequences you mention)
> should all be indexed, like this:
>
> @kindex C-x C-a
> @item C-x C-a
>
> > +Think of this key binding as the Emacs @key{C-x 1} binding.
>
> This should use @kbd as well, not @key.

Ok, it makes sense. The readline manual is using @key for these.

>
> > +@item C-x 2
> > +Use a @value{TUI} layout with at least two windows. When the current
> > +layout shows already two windows, a next layout with two windows is used.
>
> The "next layout" part is confusing, I think. What exactly is the
> meaning of "next" here?
I added the list of layouts in the overview.

>
> > +When a new layout is chosen, there will always be a common window between
> > +the previous layout and the new one.
>
> I suggest to reword (assuming I understood your intent ;-) like this:
>
> When a new layout is chosen, one window will always be common to the
> previous layout and the new one.
>
> > +@node TUI Commands
> > +@section TUI specific commands
>
> Please add "@cindex TUI commands" here.
>
> > +@item layout @var{next | prev | <name>}
>
> @var is not an appropriate markup here. It should be used for
> meta-syntactic variables, which stand for something else. In this
> case, the only part which doesn't stand for itself is "<name>". So
> I'd replace this with
>
> @item layout next | prev | @var{name}
>
> However, I wonder: can `name' really be anything, or only one of the
> fixed number of strings ("src", "asm" "split", and "regs")? If the
> latter, perhaps @var{name} isn't the right thing here.
>
> Also, please add @kindex for each of the individual layout commands
> (as well as all other commands you mention).
>
> > +@item regs
> > +Display the register window together with the source or assembly window.
>
> Is it "regs" or "layout regs"?
yes

>
> > +@item focus @var{next | prev | <win>}
> > +Set the focus to the named window.
> > +This command allows to change the active window so that scrolling keys
> > +can be affected to another window.
>
> Same comments as before about @var. In addition, this doesn't explain
> what can I type instead of <win>.
>
> > +@item winheight @var{name} +@var{count}
> > +@itemx winheight @var{name} -@var{count}
> > +Change the height of a window.
>
> I'd say "Change the height of the window @var{name} by @var{count}
> lines. Positive counts increase the height, while negative counts
> decrease it."
>
> > +@item acs
> > +Use the Alternate Character Set to draw the border.
>
> I think this begs for an explanation of what that ACS is.

Here is the new patch.

Is it ok?

Stephane
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.44
diff -u -p -r1.44 gdb.texinfo
--- gdb.texinfo 2001/07/06 04:07:29 1.44
+++ gdb.texinfo 2001/07/23 21:09:44
@@ -137,6 +137,7 @@ Copyright (C) 1988-2001 Free Software Fo
* Configurations:: Configuration-specific information
* Controlling GDB:: Controlling @value{GDBN}
* Sequences:: Canned sequences of commands
+* TUI:: @value{GDBN} Text User Interface
* Emacs:: Using @value{GDBN} under @sc{gnu} Emacs
* Annotations:: @value{GDBN}'s annotation interface.
* GDB/MI:: @value{GDBN}'s Machine Interface.
@@ -1026,13 +1027,14 @@ Run using @var{device} for your program'
@c FIXME: kingdon thinks there is more to -tty. Investigate.

@c resolve the situation of these eventually
-@c @item -tui
-@c @cindex @code{--tui}
-@c Use a Terminal User Interface. For information, use your Web browser to
-@c read the file @file{TUI.html}, which is usually installed in the
-@c directory @code{/opt/langtools/wdb/doc} on HP-UX systems. Do not use
-@c this option if you run @value{GDBN} from Emacs (see @pxref{Emacs, ,Using
-@c @value{GDBN} under @sc{gnu} Emacs}).
+@item -tui
+@cindex @code{--tui}
+Activate the Terminal User Interface when starting.
+The Terminal User Interface manages several text windows on the terminal,
+showing source, assembly, registers and @value{GDBN} command outputs
+(@pxref{TUI, ,@value{GDBN} Text User Interface}).
+Do not use this option if you run @value{GDBN} from Emacs
+(@pxref{Emacs, ,Using @value{GDBN} under @sc{gnu} Emacs}).

@c @item -xdb
@c @cindex @code{--xdb}
@@ -12973,6 +12975,290 @@ printf "foo, bar-foo = 0x%x, 0x%x\n", fo
The only backslash-escape sequences that you can use in the format
string are the simple ones that consist of backslash followed by a
letter.
+@end table
+
+@node TUI
+@chapter @value{GDBN} Text User Interface
+@cindex TUI
+
+@menu
+* TUI Overview:: TUI overview
+* TUI Keys:: TUI key bindings
+* TUI Commands:: TUI specific commands
+* TUI Configuration:: TUI configuration variables
+@end menu
+
+The @value{GDBN} Text User Interface, TUI in short,
+is a terminal interface which uses the @code{curses} library
+to show the source file, the assembly output, the program registers
+and @value{GDBN} commands in separate text windows.
+The TUI is available only when @value{GDBN} is configured
+with the @code{--enable-tui} configure option (@pxref{Configure Options}).
+
+@node TUI Overview
+@section TUI overview
+
+The TUI has two display modes that can be switched while
+@value{GDBN} runs:
+
+@itemize @bullet
+@item
+A curses (or TUI) mode in which it displays several text
+windows on the terminal.
+
+@item
+A standard mode which corresponds to the @value{GDBN} configured without
+the TUI.
+@end itemize
+
+In the TUI mode, @value{GDBN} can display several text window
+on the terminal:
+
+@table @emph
+@item command
+This window is the @value{GDBN} command window with the @value{GDBN}
+prompt and the @value{GDBN} outputs. The @value{GDBN} input is still
+managed using readline but through the TUI. The @emph{command}
+window is always visible.
+
+@item source
+The source window shows the source file of the program. The current
+line as well as active breakpoints are displayed in this window.
+The current program position is shown with the @samp{>} marker and
+active breakpoints are shown with @samp{*} markers.
+
+@item assembly
+The assembly window shows the disassembly output of the program.
+
+@item register
+This window shows the processor registers. It detects when
+a register is changed and when this is the case, registers that have
+changed are highlighted.
+
+@end table
+
+The source, assembly and register windows are attached to the thread
+and the frame position. They are updated when the current thread
+changes, when the frame changes or when the program counter changes.
+These three windows are arranged by the TUI according to several
+layouts. The layout defines which of these three windows are visible.
+The following layouts are available:
+
+@itemize @bullet
+@item
+source
+
+@item
+assembly
+
+@item
+source and assembly
+
+@item
+source and registers
+
+@item
+assembly and registers
+
+@end itemize
+
+@node TUI Keys
+@section TUI Key Bindings
+@cindex TUI key bindings
+
+The TUI installs several key bindings in the readline keymaps
+(@pxref{Command Line Editing}).
+They allow to leave or enter in the TUI mode or they operate
+directly on the TUI layout and windows. The following key bindings
+are installed for both TUI mode and the @value{GDBN} standard mode.
+
+@table @kbd
+@kindex C-x C-a
+@item C-x C-a
+@kindex C-x a
+@itemx C-x a
+@kindex C-x A
+@itemx C-x A
+Enter or leave the TUI mode. When the TUI mode is left,
+the curses window management is left and @value{GDBN} operates using
+its standard mode writing on the terminal directly. When the TUI
+mode is entered, the control is given back to the curses windows.
+The screen is then refreshed.
+
+@kindex C-x 1
+@item C-x 1
+Use a TUI layout with only one window. The layout will
+either be @samp{source} or @samp{assembly}. When the TUI mode
+is not active, it will switch to the TUI mode.
+
+Think of this key binding as the Emacs @kbd{C-x 1} binding.
+
+@kindex C-x 2
+@item C-x 2
+Use a TUI layout with at least two windows. When the current
+layout shows already two windows, a next layout with two windows is used.
+When a new layout is chosen, one window will always be common to the
+previous layout and the new one.
+
+Think of it as the Emacs @kbd{C-x 2} binding.
+
+@end table
+
+The following key bindings are handled only by the TUI mode:
+
+@table @key
+@kindex PgUp
+@item PgUp
+Scroll the active window one page up.
+
+@kindex PgDn
+@item PgDn
+Scroll the active window one page down.
+
+@kindex Up
+@item Up
+Scroll the active window one line up.
+
+@kindex Down
+@item Down
+Scroll the active window one line down.
+
+@kindex Left
+@item Left
+Scroll the active window one column left.
+
+@kindex Right
+@item Right
+Scroll the active window one column right.
+
+@kindex C-L
+@item C-L
+Refresh the screen.
+
+@end table
+
+In the TUI mode, the arrow keys are used by the active window
+for scrolling. This means they are not available for readline. It is
+necessary to use other readline key bindings such as @key{C-p}, @key{C-n},
+@key{C-b} and @key{C-f}.
+
+@node TUI Commands
+@section TUI specific commands
+@cindex TUI commands
+
+The TUI has specific commands to control the text windows.
+These commands are always available, that is they do not depend on
+the current terminal mode in which @value{GDBN} runs. When @value{GDBN}
+is in the standard mode, using these commands will automatically switch
+in the TUI mode.
+
+@table @code
+@item layout next
+@kindex layout next
+Display the next layout.
+
+@item layout prev
+@kindex layout prev
+Display the previous layout.
+
+@item layout src
+@kindex layout src
+Display the source window only.
+
+@item layout asm
+@kindex layout asm
+Display the assembly window only.
+
+@item layout split
+@kindex layout split
+Display the source and assembly window.
+
+@item layout regs
+@kindex layout regs
+Display the register window together with the source or assembly window.
+
+@item focus next | prev | src | asm | regs | split
+@kindex focus
+Set the focus to the named window.
+This command allows to change the active window so that scrolling keys
+can be affected to another window.
+
+@item refresh
+@kindex refresh
+Refresh the screen. This is similar to using @key{C-L} key.
+
+@item update
+@kindex update
+Update the source window and the current execution point.
+
+@item winheight @var{name} +@var{count}
+@itemx winheight @var{name} -@var{count}
+@kindex winheight
+Change the height of the window @var{name} by @var{count}
+lines. Positive counts increase the height, while negative counts
+decrease it.
+
+@end table
+
+@node TUI Configuration
+@section TUI configuration variables
+@cindex TUI configuration variables
+
+The TUI has several configuration variables that control the
+appearance of windows on the terminal.
+
+@table @code
+@item set tui-border-kind @var{kind}
+@kindex set tui-border-kind
+Select the border appearance for the source, assembly and register windows.
+The possible values are the following:
+@table @code
+@item space
+Use a space character to draw the border.
+
+@item ascii
+Use ascii characters + - and | to draw the border.
+
+@item acs
+Use the Alternate Character Set to draw the border. The border is
+drawn using character line graphics if the terminal supports them.
+
+@end table
+
+@item set tui-active-border-mode @var{mode}
+@kindex set tui-active-border-mode
+Select the attributes to display the border of the active window.
+The possible values are @code{normal}, @code{standout}, @code{reverse},
+@code{half}, @code{half-standout}, @code{bold} and @code{bold-standout}.
+
+@item set tui-border-mode @var{mode}
+@kindex set tui-border-mode
+Select the attributes to display the border of other windows.
+The @var{mode} can be one of the following:
+@table @code
+@item normal
+Use normal attributes to display the border.
+
+@item standout
+Use standout mode.
+
+@item reverse
+Use reverse video mode.
+
+@item half
+Use half bright mode.
+
+@item half-standout
+Use half bright and standout mode.
+
+@item bold
+Use extra bright or bold mode.
+
+@item bold-standout
+Use extra bright or bold and standout mode.
+
+@end table
+
@end table

@node Emacs
From Stephane.Carrez@worldnet.fr Mon Jul 23 14:15:00 2001
From: Stephane Carrez <Stephane.Carrez@worldnet.fr>
To: gdb-patches@sources.redhat.com
Subject: [PATCH]: Fix tui warnings and a readline tty pb
Date: Mon, 23 Jul 2001 14:15:00 -0000
Message-id: <3B5C94F8.E1A359DE@worldnet.fr>
X-SW-Source: 2001-07/msg00583.html
Content-length: 6507

Hi!

Hum... TUI virus is back again...

I've integrated this patch to:

- fix warnings in the tui code,
- add tui_show_source() used by tui-out.c to display the source file
- fix a readline tty problem when we enter/leave tui mode

Stephane

2001-07-23 Stephane Carrez <Stephane.Carrez@worldnet.fr>

* tuiStack.c (tuiUpdateLocatorFilename): Use const char*.
* tuiStack.h (tuiUpdateLocatorFilename): Update prototype.
* tuiWin.c (_initialize_tuiWin): Don't cast table of enum in calls
to add_set_enum_cmd.
* tui.c (tui_show_source): New function.
(tuiGetLowDisassemblyAddress): Use CORE_ADDR for newLow.
(tui_switch_mode): Prep or deprep readline terminal;
make sure the \n we return does not redo the last command.
* tui.h (tui_show_source): Declare.
(tui_out_new, tui_install_hooks, tui_remove_hooks): Likewise.
(tui_active, tui_initialize_io, tui_initialize_readline): Likewise.
Index: tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.12
diff -u -p -r1.12 tui.c
--- tui.c 2001/07/21 22:24:44 1.12
+++ tui.c 2001/07/23 21:11:29
@@ -39,10 +39,12 @@
#include "tuiRegs.h"
#include "tuiStack.h"
#include "tuiWin.h"
+#include "tuiSourceWin.h"
#include "readline/readline.h"
#include "target.h"
#include "frame.h"
#include "breakpoint.h"
+#include "inferior.h"

/* Tells whether the TUI is active or not. */
int tui_active = 0;
@@ -55,10 +57,13 @@ tui_switch_mode (void)
if (tui_active)
{
tui_disable ();
+ rl_prep_terminal (0);
+
printf_filtered ("Left the TUI mode\n");
}
else
{
+ rl_deprep_terminal ();
tui_enable ();
printf_filtered ("Entered the TUI mode\n");
}
@@ -74,6 +79,9 @@ tui_switch_mode (void)
will be able to setup the terminal for its needs. By re-entering
in readline, we also redisplay its prompt in the non-curses mode. */
rl_newline (1, '\n');
+
+ /* Make sure the \n we are returning does not repeat the last command. */
+ dont_repeat ();
return 0;
}

@@ -232,6 +240,9 @@ tui_enable (void)
tui_version = 1;
tui_active = 1;
refresh ();
+
+ /* Update gdb's knowledge of its terminal. */
+ terminal_save_ours ();
}

/* Leave the tui mode.
@@ -254,6 +265,8 @@ tui_disable (void)
so that terminal management with the inferior works. */
tui_setup_io (0);

+ /* Update gdb's knowledge of its terminal. */
+ terminal_save_ours ();
tui_version = 0;
tui_active = 0;
}
@@ -276,7 +289,7 @@ CORE_ADDR
tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
{
int line;
- Opaque newLow;
+ CORE_ADDR newLow;

/* Determine where to start the disassembly so that the pc is about in the
middle of the viewport. */
@@ -385,6 +398,15 @@ _tuiReset (void)
} /* _tuiReset */
#endif

+void
+tui_show_source (const char *file, int line)
+{
+ /* make sure that the source window is displayed */
+ tuiAddWinToLayout (SRC_WIN);
+
+ tuiUpdateSourceWindowsWithLine (current_source_symtab, line);
+ tuiUpdateLocatorFilename (file);
+}

void
tui_show_assembly (CORE_ADDR addr)
Index: tui.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.h,v
retrieving revision 1.9
diff -u -p -r1.9 tui.h
--- tui.h 2001/07/21 22:24:44 1.9
+++ tui.h 2001/07/23 21:11:29
@@ -106,6 +106,19 @@ extern void tui_enable (void);
/* Leave the tui mode. */
extern void tui_disable (void);

+extern void tui_initialize_io (void);
+
+extern void tui_initialize_readline (void);
+
+extern int tui_active;
+
+extern void tui_install_hooks (void);
+extern void tui_remove_hooks (void);
+
+extern void tui_show_source (const char *file, int line);
+
+extern struct ui_out *tui_out_new (struct ui_file *stream);
+
/* tuiDataWin.c */
extern void tui_vCheckDataValues (va_list);

Index: tuiStack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiStack.c,v
retrieving revision 1.10
diff -u -p -r1.10 tuiStack.c
--- tuiStack.c 2001/07/21 20:52:56 1.10
+++ tuiStack.c 2001/07/23 21:11:33
@@ -126,7 +126,7 @@ tuiSetLocatorInfo (char *fname, char *pr
** Update only the filename portion of the locator.
*/
void
-tuiUpdateLocatorFilename (char *fileName)
+tuiUpdateLocatorFilename (const char *fileName)
{
TuiGenWinInfoPtr locator = locatorWinInfoPtr ();

Index: tuiStack.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiStack.h,v
retrieving revision 1.6
diff -u -p -r1.6 tuiStack.h
--- tuiStack.h 2001/07/21 20:52:56 1.6
+++ tuiStack.h 2001/07/23 21:11:33
@@ -27,7 +27,7 @@

extern void tuiSetLocatorInfo (char *, char *, int, CORE_ADDR,
TuiLocatorElementPtr);
-extern void tuiUpdateLocatorFilename (char *);
+extern void tuiUpdateLocatorFilename (const char *);
extern void tuiUpdateLocatorInfoFromFrame
(struct frame_info *, TuiLocatorElementPtr);
extern void tuiUpdateLocatorDisplay (struct frame_info *);
Index: tuiWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiWin.c,v
retrieving revision 1.14
diff -u -p -r1.14 tuiWin.c
--- tuiWin.c 2001/07/21 20:57:17 1.14
+++ tuiWin.c 2001/07/23 21:11:36
@@ -317,7 +317,7 @@ Usage: w <#lines>\n");
/* Define the tui control variables. */
c = add_set_enum_cmd
("tui-border-kind", class_tui,
- tui_border_kind_enums, (char*) &tui_border_kind,
+ tui_border_kind_enums, &tui_border_kind,
"Set the kind of border for TUI windows.\n"
"This variable controls the border of TUI windows:\n"
"space use a white space\n"
@@ -328,7 +328,7 @@ Usage: w <#lines>\n");

c = add_set_enum_cmd
("tui-border-mode", class_tui,
- tui_border_mode_enums, (char*) &tui_border_mode,
+ tui_border_mode_enums, &tui_border_mode,
"Set the attribute mode to use for the TUI window borders.\n"
"This variable controls the attributes to use for the window borders:\n"
"normal normal display\n"
@@ -343,7 +343,7 @@ Usage: w <#lines>\n");

c = add_set_enum_cmd
("tui-active-border-mode", class_tui,
- tui_border_mode_enums, (char*) &tui_active_border_mode,
+ tui_border_mode_enums, &tui_active_border_mode,
"Set the attribute mode to use for the active TUI window border.\n"
"This variable controls the attributes to use for the active window border:\n"
"normal normal display\n"
From Stephane.Carrez@worldnet.fr Mon Jul 23 14:17:00 2001
From: Stephane Carrez <Stephane.Carrez@worldnet.fr>
To: gdb-patches@sources.redhat.com
Subject: [PATCH]: Fix tui refresh after background on Solaris
Date: Mon, 23 Jul 2001 14:17:00 -0000
Message-id: <3B5C9583.BFABFA9F@worldnet.fr>
X-SW-Source: 2001-07/msg00584.html
Content-length: 3272

Hi!

On Solaris when the gdb-tui is restored from background, the screen is
refreshed correctly but the cursor is not put at the correct place.
It should be in the command window at the current readline cursor.
(no such pb on Linux, or with ncurses 5.x).

The following patch solves this by explicitly restoring the cursor
after SIGCONT. I've committed this patch.

Stephane

2001-07-23 Stephane Carrez <Stephane.Carrez@worldnet.fr>

* tuiIO.c (tui_cont_sig): Update cursor position on the screen to
leave it in the command window.
(tui_redisplay_readline): Save cursor position to restore the
cursor after we go back from background.
* tuiData.h (TuiCommandInfo): Add start_line member.
Index: tuiData.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiData.h,v
retrieving revision 1.6
diff -u -p -r1.6 tuiData.h
--- tuiData.h 2001/07/21 20:52:56 1.6
+++ tuiData.h 2001/07/23 21:11:30
@@ -252,6 +252,7 @@ typedef struct _TuiCommandInfo
{
int curLine; /* The current line position */
int curch; /* The current cursor position */
+ int start_line;
}
TuiCommandInfo, *TuiCommandInfoPtr;

Index: tuiIO.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiIO.c,v
retrieving revision 1.9
diff -u -p -r1.9 tuiIO.c
--- tuiIO.c 2001/07/21 22:35:40 1.9
+++ tuiIO.c 2001/07/23 21:11:33
@@ -117,6 +117,7 @@ tui_puts (const char *string)
}
getyx (w, cmdWin->detail.commandInfo.curLine,
cmdWin->detail.commandInfo.curch);
+ cmdWin->detail.commandInfo.start_line = cmdWin->detail.commandInfo.curLine;

/* We could defer the following. */
wrefresh (w);
@@ -144,7 +145,7 @@ tui_redisplay_readline (void)
c_pos = -1;
c_line = -1;
w = cmdWin->generic.handle;
- start_line = cmdWin->detail.commandInfo.curLine;
+ start_line = cmdWin->detail.commandInfo.start_line;
wmove (w, start_line, 0);
prev_col = 0;
height = 1;
@@ -177,7 +178,7 @@ tui_redisplay_readline (void)
}
if (c == '\n')
{
- getyx (w, cmdWin->detail.commandInfo.curLine,
+ getyx (w, cmdWin->detail.commandInfo.start_line,
cmdWin->detail.commandInfo.curch);
}
getyx (w, line, col);
@@ -186,13 +187,16 @@ tui_redisplay_readline (void)
prev_col = col;
}
wclrtobot (w);
- getyx (w, cmdWin->detail.commandInfo.curLine,
+ getyx (w, cmdWin->detail.commandInfo.start_line,
cmdWin->detail.commandInfo.curch);
if (c_line >= 0)
- wmove (w, c_line, c_pos);
+ {
+ wmove (w, c_line, c_pos);
+ cmdWin->detail.commandInfo.curLine = c_line;
+ cmdWin->detail.commandInfo.curch = c_pos;
+ }
+ cmdWin->detail.commandInfo.start_line -= height - 1;

- cmdWin->detail.commandInfo.curLine -= height - 1;
-
wrefresh (w);
fflush(stdout);
}
@@ -307,6 +311,12 @@ tui_cont_sig (int sig)

/* Force a refresh of the screen. */
tuiRefreshAll ();
+
+ /* Update cursor position on the screen. */
+ wmove (cmdWin->generic.handle,
+ cmdWin->detail.commandInfo.start_line,
+ cmdWin->detail.commandInfo.curch);
+ wrefresh (cmdWin->generic.handle);
}
signal (sig, tui_cont_sig);
}
From atmosfear@users.sf.net Mon Jul 23 15:39:00 2001
From: Felix Buenemann <atmosfear@users.sf.net>
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: current CVS gdb and SSE xmm registers don't work
Date: Mon, 23 Jul 2001 15:39:00 -0000
Message-id: <01072400375400.00541@astral>
References: <01071511090404.13471@astral> <0107161721020D.13471@astral> <200107162059.f6GKxr805474@delius.kettenis.local>
X-SW-Source: 2001-07/msg00585.html
Content-length: 2293

Hi,

sorry for the slow answer but I was very busy.

On Monday, 16. July 2001 22:59, Mark Kettenis wrote:
> Now how shall I check if the fetch_fpxregs() funtion is
> disfunctioning? (sorry I'm not so familiar with debugging
> debuggers :) and mostly use gdb to dissassemble and check asm code)
>
> Yes please. From what I see in the backtrace everything is
> functioning OK. It would be interesting to know the value of
> have_ptrace_getfpxregs. It should be 1 on the first entry of
> fetch_fpxregs(). Then it would be interesting to see the result the
> result of the ptrace() call later on in fetch_fpxregs(). Please check
> (with ps) that the program with PID equal to the first argument to
> ptrace() does realy exist. I suspect ptrace() will fail with EIO,
> which GDB interprets as a lack of support for SSE registers in the
> kernel. This makes GDB set have_ptrace_getfpxregs to zero and gives
> you the dummy register values you're seeing. In that case, either
> your kernel doesn't include SSE support, or there is a bug in your
> kernel. In the latter case, please report this to the linux-kernel
> mailing list.
>
hmm the code seems to behave quite strange, I found out the following:
have_ptrace_getfpxregs will be always 1 this means that the ptrace call never
fails (at least not with errno == EIO. On breakpoint trigger for
fetch_fpxregs() I have the following:

Breakpoint 1, fetch_fpxregs (tid=1863) at i386-linux-nat.c:472
1863 is the correct PID of the mplayer process, now when I print out tid I
get:
(gdb) p tid
$4 = 136444668
This is the value that will be passed as second argument to ptrace() call,
but although I think this value is not correct, ptrace call will not fail and
set have_ptrace_getfpxregs or give error message:
483 perror_with_name ("Couldn't read floating-point and SSE
registers");

IMHO tid passed to fetch_fpxregs() and tid passed to ptrace() should be
identical, shouldn't they?

> From your backtrace I deduced that you are debugging multithreaded
> programs. Are you by any chance using an SMP system. I've had a
> recent FPU related bug report that seems to be caused by a SMP kernel
> bug.
No I have no SMP system, this is PIII Coppermine 850 Notebook running Linux
2.4.4 kernel.
--
Best Regards,
Felix