Commit Graph

191 Commits

Author SHA1 Message Date
Tom Tromey
a6687ef35c Make tui_register_info::highlight private
This changes tui_register_info::highlight to be private, renaming it
to m_highlight.
2024-06-15 20:54:04 -06:00
Simon Marchi
9102a6c15c gdb/tui: cleanup includes
Remove includes reported as unused by clangd.  Then, add any includes
necessary to get rid of errors (includes possibly relying on previous
includes)..

I didn't remove the includes of gdb-safe-ctypes.h, because it appears to
do some some preprocessor magic, redefining standard macros.  I'm afraid
that removing these includes could change the behavior unintentionally.

Change-Id: I4c5b652355c3bbce022fe0d447a72dc4e1d17d34
Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07 22:54:06 -04:00
Simon Marchi
8a39a981bd gdb/tui: change some macros to functions
Change the `TUI_*` macros to access known windows to functions.  Define
them in their respective files, because trying to define them in
tui-data.h would end up causing include cycles.

This makes static analysis (detection of unused include files in this
case) more accurate, and I think in general we should avoid hiding
code behind macros if not necessary.

Change-Id: I1e38cee843984c48ab34030b19dac0d726f851af
Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07 22:52:54 -04:00
Simon Marchi
5b9707eb87 gdb: remove gdbcmd.h
Most files including gdbcmd.h currently rely on it to access things
actually declared in cli/cli-cmds.h (setlist, showlist, etc).  To make
things easy, replace all includes of gdbcmd.h with includes of
cli/cli-cmds.h.  This might lead to some unused includes of
cli/cli-cmds.h, but it's harmless, and much faster than going through
the 170 or so files by hand.

Change-Id: I11f884d4d616c12c05f395c98bbc2892950fb00f
Approved-By: Tom Tromey <tom@tromey.com>
2024-04-25 12:59:02 -04:00
Simon Marchi
18d2988e5d gdb, gdbserver, gdbsupport: remove includes of early headers
Now that defs.h, server.h and common-defs.h are included via the
`-include` option, it is no longer necessary for source files to include
them.  Remove all the inclusions of these files I could find.  Update
the generation scripts where relevant.

Change-Id: Ia026cff269c1b7ae7386dd3619bc9bb6a5332837
Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26 21:13:22 -04:00
Tom Tromey
a6a3b67fa9 Fix TUI text centering
In a couple of spots, the TUI tries to center some text in the window.
Andrew noticed that the calculation is done strangely and the text
ends up somewhat to the left of center.

This patch fixes the problem.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31355
2024-03-01 18:15:35 -07:00
Simon Marchi
8480a37e14 gdb: pass frames as const frame_info_ptr &
We currently pass frames to function by value, as `frame_info_ptr`.
This is somewhat expensive:

 - the size of `frame_info_ptr` is 64 bytes, which is a bit big to pass
   by value
 - the constructors and destructor link/unlink the object in the global
   `frame_info_ptr::frame_list` list.  This is an `intrusive_list`, so
   it's not so bad: it's just assigning a few points, there's no memory
   allocation as if it was `std::list`, but still it's useless to do
   that over and over.

As suggested by Tom Tromey, change many function signatures to accept
`const frame_info_ptr &` instead of `frame_info_ptr`.

Some functions reassign their `frame_info_ptr` parameter, like:

  void
  the_func (frame_info_ptr frame)
  {
    for (; frame != nullptr; frame = get_prev_frame (frame))
      {
        ...
      }
  }

I wondered what to do about them, do I leave them as-is or change them
(and need to introduce a separate local variable that can be
re-assigned).  I opted for the later for consistency.  It might not be
clear why some functions take `const frame_info_ptr &` while others take
`frame_info_ptr`.  Also, if a function took a `frame_info_ptr` because
it did re-assign its parameter, I doubt that we would think to change it
to `const frame_info_ptr &` should the implementation change such that
it doesn't need to take `frame_info_ptr` anymore.  It seems better to
have a simple rule and apply it everywhere.

Change-Id: I59d10addef687d157f82ccf4d54f5dde9a963fd0
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-20 10:42:25 -05:00
Tom Tromey
66ab1a14e1 Update TUI register window when the inferior exits
When the inferior exits, the TUI register window should clear.

Fixing this was mostly a matter of sticking an assignment into
tui_inferior_exit.  However, some changes to the register window
itself were also needed.

While working on this, I realized that the TUI register window would
not work correctly when moving between frames of different
architectures.  This patch attempts to fix this as well, though I have
no way to test it.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28600
Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:16:07 -07:00
Tom Tromey
09df3a10d9 Rename show_registers -> set_register_group
This renames a method on the TUI register window to reflect its real
purpose.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:16:07 -07:00
Tom Tromey
764593ab5f Simplify tui_data_win::erase_data_content
There's only a single call to tui_data_win::erase_data_content now, so
remove the parameter and make it just render the "empty window" text.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:16:07 -07:00
Tom Tromey
1ad87082ea Remove the TUI register window rerender overload
After these restructurings, it should be clear that the rerender
overload can be removed from the TUI register window.  This is done by
moving a bit more logic from show_registers into update_register_data.
After this, update_register_data simply updates the internal state,
and rerender will write to the screen.  All the actual rendering work
is done, ultimately, by display_registers_from.  This split between
updating the model and rendering makes it clear that the recursive
case can't happen any longer.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:51 -07:00
Tom Tromey
45a57c1ea8 Simplify update_register_data
This changes update_register_data to always update the register data.
The idea here is that this is really only called when either the
desired register group changes, or when gdb transitions from not
having a frame to having a frame.

show_registers is also simplified slightly to account for this.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Tom Tromey
074b58b4dc Move scrollok call in register window
The register window calls scrollok each time a register is written to
the window.  However, we only need to call this once, at the start of
display.  (We could actually call it just once when the window is
made, but that would involve making another method virtual or adding a
new member -- both which I think are worse than this approach.)

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Tom Tromey
7613981036 Change tui_register_info::visible to a method
tui_register_info::visible is redundant with the fact that y==0 means
that the register is not visible.  This patch changes this member in
favor of having a single indication of the register's visibility -- a
method with the same name.  This change makes it clear that
delete_data_content_windows is not needed, so this is removed as well.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Tom Tromey
6b32381343 Rename tui_data_item_window -> tui_register_info
tui_data_item_window used to hold a curses window, but we removed that
ages ago.  Now it just holds information about a single register.
This patch renames the class to make it more clearly reflect its
meaning.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Tom Tromey
b1adacb663 Simplify tui_data_window::show_register_group
This simplifies tui_data_window::show_register_group, renaming it as
well.  The old method had two loops to iterate over all the registers
for the arch, but in the new scheme, the vector is set up when
switching groups, and then updates simply iterate over the vector.

tui_data_item_window is made self-updating, which also clarifies the
code somewhat.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Tom Tromey
1a25967293 Minor C++ cleanups in tui-regs.c
This changes a couple of spots to use nullptr rather than 0, and
changes an int to a bool.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Tom Tromey
32ed168c4d Use pop_back in tui_register_format
tui_register_format can use string::pop_back now.

Tested-By: Tom de Vries <tdevries@suse.de>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-02-08 12:15:39 -07:00
Andrew Burgess
1d506c26d9 Update copyright year range in header of all files managed by GDB
This commit is the result of the following actions:

  - Running gdb/copyright.py to update all of the copyright headers to
    include 2024,

  - Manually updating a few files the copyright.py script told me to
    update, these files had copyright headers embedded within the
    file,

  - Regenerating gdbsupport/Makefile.in to refresh it's copyright
    date,

  - Using grep to find other files that still mentioned 2023.  If
    these files were updated last year from 2022 to 2023 then I've
    updated them this year to 2024.

I'm sure I've probably missed some dates.  Feel free to fix them up as
you spot them.
2024-01-12 15:49:57 +00:00
Tom de Vries
86a6f9a9fb [gdb/tui] Show regs when switching to regs layout
When starting gdb in CLI mode, running to main and switching into the TUI regs
layout:
...
$ gdb -q a.out -ex start -ex "layout regs"
...
we get:
...
+---------------------------------+
|                                 |
| [ Register Values Unavailable ] |
|                                 |
+---------------------------------+
...

Fix this by handling this case in tui_data_window::rerender.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>

PR tui/28600
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28600
2023-12-16 09:31:29 +01:00
Tom de Vries
bebb0dd44b [gdb/tui] Use more box_width in tui-regs.c
While experimenting with can_box () == false by default, I noticed two places
in tui-regs.c where we can replace a hardcoded 1 with box_width ().

It also turned out to be necessary to set scrollok to false, otherwise writing
the last char of the last line with register info will cause a scroll.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-12-16 09:23:38 +01:00
Tom de Vries
d1a912db7f [gdb/tui] Fix wrapping strings
I noticed that after resizing to a narrow window, I got:
...
┌────────────────┐
│                │
│[ No Source Avail
able ]           │
│                │
└────────────────┘
...

Fix this by adding two new functions:
- tui_win_info::display_string (int y, int x, const char *str)
- tui_win_info::display_string (const char *str)
that make sure that borders are not overwritten, which get us instead:
...
┌────────────────┐
│                │
│[ No Source Avai│
│                │
│                │
└────────────────┘
...

Tested on x86_64-linux.
2023-12-04 08:48:48 +01:00
Tom de Vries
ff3c86a844 [gdb/tui] Add tui_win_info::{box_width,box_size}
In tui_source_window::set_contents we have:
...
  /* Take hilite (window border) into account, when
     calculating the number of lines.  */
  int nlines = height - 2;
...

The '2' represents the total size of the window border (or box, in can_box
terms), in this case one line at the top and one line at the bottom.

Likewise, '1' is used to represent the width of the window border.

Introduce new functions:
- tui_win_info::box_width () and
- tui_win_info::box_size ()
that can be used instead instead of these hardcoded constants.

Implement these such that they return 0 when can_box () == false.

Tested patch completeness by making all windows unboxed:
...
@@ -85,7 +85,7 @@ struct tui_win_info
   /* Return true if this window can be boxed.  */
   virtual bool can_box () const
   {
-    return true;
+    return false;
   }

   int box_width () const
...
and test-driving TUI.

This required eliminating an assert in
tui_source_window_base::show_source_content, I've included that part as well.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2023-11-13 21:22:50 +01:00
Andrew Burgess
6c1e84f5c6 gdb/tui: make tui_win_info::title private
This commit builds on this earlier work:

  commit 9fe01a376b
  Date:   Thu Jun 29 11:26:55 2023 -0600

      Update TUI window title when changed

and makes tui_win_info::title private, renaming to m_title at the same
time.  There's a new tui_win_info::title() member function to provide
read-only access to the title.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
2023-07-15 11:40:45 +01:00
Tom de Vries
33b5899fc0 [gdb] Fix typos
Fix a few typos:
- implemention -> implementation
- convertion(s) -> conversion(s)
- backlashes -> backslashes
- signoring -> ignoring
- (un)ambigious -> (un)ambiguous
- occured -> occurred
- hidding -> hiding
- temporarilly -> temporarily
- immediatelly -> immediately
- sillyness -> silliness
- similiar -> similar
- porkuser -> pokeuser
- thats -> that
- alway -> always
- supercede -> supersede
- accomodate -> accommodate
- aquire -> acquire
- priveleged -> privileged
- priviliged -> privileged
- priviledges -> privileges
- privilige -> privilege
- recieve -> receive
- (p)refered -> (p)referred
- succesfully -> successfully
- successfuly -> successfully
- responsability -> responsibility
- wether -> whether
- wich -> which
- disasbleable -> disableable
- descriminant -> discriminant
- construcstor -> constructor
- underlaying -> underlying
- underyling -> underlying
- structureal -> structural
- appearences -> appearances
- terciarily -> tertiarily
- resgisters -> registers
- reacheable -> reachable
- likelyhood -> likelihood
- intepreter -> interpreter
- disassemly -> disassembly
- covnersion -> conversion
- conviently -> conveniently
- atttribute -> attribute
- struction -> struct
- resonable -> reasonable
- popupated -> populated
- namespaxe -> namespace
- intialize -> initialize
- identifer(s) -> identifier(s)
- expection -> exception
- exectuted -> executed
- dungerous -> dangerous
- dissapear -> disappear
- completly -> completely
- (inter)changable -> (inter)changeable
- beakpoint -> breakpoint
- automativ -> automatic
- alocating -> allocating
- agressive -> aggressive
- writting -> writing
- reguires -> requires
- registed -> registered
- recuding -> reducing
- opeartor -> operator
- ommitted -> omitted
- modifing -> modifying
- intances -> instances
- imbedded -> embedded
- gdbaarch -> gdbarch
- exection -> execution
- direcive -> directive
- demanged -> demangled
- decidely -> decidedly
- argments -> arguments
- agrument -> argument
- amespace -> namespace
- targtet -> target
- supress(ed) -> suppress(ed)
- startum -> stratum
- squence -> sequence
- prompty -> prompt
- overlow -> overflow
- memember -> member
- languge -> language
- geneate -> generate
- funcion -> function
- exising -> existing
- dinking -> syncing
- destroh -> destroy
- clenaed -> cleaned
- changep -> changedp (name of variable)
- arround -> around
- aproach -> approach
- whould -> would
- symobl -> symbol
- recuse -> recurse
- outter -> outer
- freeds -> frees
- contex -> context

Tested on x86_64-linux.

Reviewed-By: Tom Tromey <tom@tromey.com>
2023-06-03 22:43:57 +02:00
Tom Tromey
34116a8a2d Remove a use of pagination_enabled
I noticed that the TUI temporarily sets pagination_enabled and
gdb_stdout in one spot.  However, I don't believe these settings are
necessary here, as a ui_file is passed to
gdbarch_print_registers_info.  This patch removes these settings.
2023-02-14 13:54:44 -07:00
Joel Brobecker
213516ef31 Update copyright year range in header of all files managed by GDB
This commit is the result of running the gdb/copyright.py script,
which automated the update of the copyright year range for all
source files managed by the GDB project to be updated to include
year 2023.
2023-01-01 17:01:16 +04:00
Tom Tromey
2f6831b806 Use boolean literals for pagination_enabled
I noticed a couple of spots that used '0' rather than 'false' when
modifying pagination_enabled.  This patch cleans these up.
2022-11-17 09:35:20 -07:00
Tom Tromey
bd2b40ac12 Change GDB to use frame_info_ptr
This changes GDB to use frame_info_ptr instead of frame_info *
The substitution was done with multiple sequential `sed` commands:

sed 's/^struct frame_info;/class frame_info_ptr;/'
sed 's/struct frame_info \*/frame_info_ptr /g' - which left some
    issues in a few files, that were manually fixed.
sed 's/\<frame_info \*/frame_info_ptr /g'
sed 's/frame_info_ptr $/frame_info_ptr/g' - used to remove whitespace
    problems.

The changed files were then manually checked and some 'sed' changes
undone, some constructors and some gets were added, according to what
made sense, and what Tromey originally did

Co-Authored-By: Bruno Larsen <blarsen@redhat.com>
Approved-by: Tom Tomey <tom@tromey.com>
2022-10-10 11:57:10 +02:00
Andrew Burgess
637b2f8613 gdb: update now gdbarch_register_name doesn't return nullptr
After the previous few commit, gdbarch_register_name no longer returns
nullptr.  This commit audits all the calls to gdbarch_register_name
and removes any code that checks the result against nullptr.

There should be no visible change after this commit.
2022-10-02 14:21:25 +01:00
Andrew Burgess
af7ce09b76 gdb: move struct reggroup into reggroups.h header
Move 'struct reggroup' into the reggroups.h header.  Remove the
reggroup_name and reggroup_type accessor functions, and just use the
name/type member functions within 'struct reggroup', update all uses
of these removed functions.

There should be no user visible changes after this commit.
2022-04-07 16:01:18 +01:00
Andrew Burgess
1bca9b1e6b gdb: remove reggroup_next and reggroup_prev
Add a new function gdbarch_reggroups that returns a reference to a
vector containing all the reggroups for an architecture.

Make use of this function throughout GDB instead of the existing
reggroup_next and reggroup_prev functions.

Finally, delete the reggroup_next and reggroup_prev functions.

Most of these changes are pretty straight forward, using range based
for loops instead of the old style look using reggroup_next.  There
are two places where the changes are less straight forward.

In gdb/python/py-registers.c, the register group iterator needed to
change slightly.  As the iterator is tightly coupled to the gdbarch, I
just fetch the register group vector from the gdbarch when needed, and
use an index counter to find the next item from the vector when
needed.

In gdb/tui/tui-regs.c the tui_reg_next and tui_reg_prev functions are
just wrappers around reggroup_next and reggroup_prev respectively.
I've just inlined the logic of the old functions into the tui
functions.  As the tui function had its own special twist (wrap around
behaviour) I think this is OK.

There should be no user visible changes after this commit.
2022-04-07 16:01:18 +01:00
Andrew Burgess
07c316ecaa gdb/tui: fix 'tui reg next/prev' command when data window is hidden
Start GDB like:

  $ gdb -q executable
  (gdb) start
  (gdb) layout src
  ... tui windows are now displayed ...
  (gdb) tui reg next

At this point the data (register) window should be displayed, but will
contain the message 'Register Values Unavailable', and at the console
you'll see the message "unknown register group 'next'".

The same happens with 'tui reg prev' (but the error message is
slightly different).

At this point you can continue to use 'tui reg next' and/or 'tui reg
prev' and you'll keep getting the error message.

The problem is that when the data (register) window is first
displayed, it's current register group is nullptr.  As a consequence
tui_reg_next and tui_reg_prev (tui/tui-regs.c) will always just return
nullptr, which triggers an error in tui_reg_command.

In this commit I change tui_reg_next and tui_reg_prev so that they
instead return the first and last register group respectively if the
current register group is nullptr.

So, after this, using 'tui reg next' will (in the above case) show the
first register group, while 'tui reg prev' will display the last
register group.
2022-04-07 16:01:18 +01:00
Andrew Burgess
5783701b36 gdb/tui: avoid theoretical bug with 'tui reg' command
While looking at the 'tui reg' command as part of another patch, I
spotted a theoretical bug.

The 'tui reg' command takes the name of a register group, but also
handles partial register group matches, though the partial match has to
be unique.  The current command logic goes:

With the code as currently written, if a target description named a
register group either 'prev' or 'next' then GDB would see this as an
ambiguous register name, and refuse to switch groups.

Naming a register group 'prev' or 'next' seems pretty unlikely, but,
by adding a single else block we can prevent this problem.

Now, if there's a 'prev' or 'next' register group, the user will not
be able to select the group directly, the 'prev' and 'next' names will
always iterate through the available groups instead.  But at least the
user could select their groups by iteration, rather than direct
selection.
2022-04-07 16:01:18 +01:00
Andrew Burgess
711898e128 gdb: switch to using 'const reggroup *' in tui-regs.{c,h}
Make uses of 'reggroup *' const throughout tui-regs.{c,h}.

There should be no user visible changes after this commit.
2022-04-07 16:01:17 +01:00
Tom Tromey
6cb06a8cda Unify gdb printf functions
Now that filtered and unfiltered output can be treated identically, we
can unify the printf family of functions.  This is done under the name
"gdb_printf".  Most of this patch was written by script.
2022-03-29 12:46:24 -06:00
Simon Marchi
5d10a2041e gdb: add string_file::release method
A common pattern for string_file is to want to move out the internal
string buffer, because it is the result of the computation that we want
to return.  It is the reason why string_file::string returns a non-const
reference, as explained in the comment.  I think it would make sense to
have a dedicated method for that instead and make string_file::string
return a const reference.

This allows removing the explicit std::move in the typical case.  Note
that compile_program::compute was missing a move, meaning that the
resulting string was copied.  With the new version, it's not possible to
forget to move.

Change-Id: Ieaefa35b73daa7930b2f3a26988b6e3b4121bb79
2022-01-26 10:01:40 -05:00
Tom Tromey
b58f47ab4c Use filtered output in ordinary commands
Many otherwise ordinary commands choose to use unfiltered output
rather than filtered.  I don't think there's any reason for this, so
this changes many such commands to use filtered output instead.

Note that complete_command is not touched due to a comment there
explaining why unfiltered output is believed to be used.
2022-01-05 11:36:33 -07:00
Joel Brobecker
4a94e36819 Automatic Copyright Year update after running gdb/copyright.py
This commit brings all the changes made by running gdb/copyright.py
as per GDB's Start of New Year Procedure.

For the avoidance of doubt, all changes in this commits were
performed by the script.
2022-01-01 19:13:23 +04:00
Hannes Domani
4cf28e918a Don't draw register sub windows outside the visible area
If the regs window is not big enough to show all registers, the
registers whose values changed are always drawn, even if they are not
in the currently visible area.

So this marks the invisible register sub windows with y=0, and skips
their rerender call in check_register_values.

gdb/ChangeLog:

2021-02-07  Hannes Domani  <ssbssa@yahoo.de>

	* tui/tui-regs.c (tui_data_window::display_registers_from):
	Mark invisible register sub windows.
	(tui_data_window::check_register_values): Ignore invisible
	register sub windows.
2021-02-07 19:13:45 +01:00
Hannes Domani
3537bc23d9 Don't fill regs window with a negative number of spaces
Function n_spaces can't handle negative values, and returns an invalid
pointer in this case.

gdb/ChangeLog:

2021-02-07  Hannes Domani  <ssbssa@yahoo.de>

	* tui/tui-regs.c (tui_data_item_window::rerender): Don't call
	n_spaces with a negative value.
2021-02-07 19:11:53 +01:00
Hannes Domani
5fc2d6aa06 Refresh regs window in display_registers_from
Otherwise the register window is redrawn empty when scrolling or
changing its size with winheight.

gdb/ChangeLog:

2021-02-07  Hannes Domani  <ssbssa@yahoo.de>

	* tui/tui-regs.c (tui_data_window::display_registers_from):
	Add refresh_window call.
2021-02-07 19:10:17 +01:00
Joel Brobecker
3666a04883 Update copyright year range in all GDB files
This commits the result of running gdb/copyright.py as per our Start
of New Year procedure...

gdb/ChangeLog

        Update copyright year range in copyright header of all GDB files.
2021-01-01 12:12:21 +04:00
Simon Marchi
dda83cd783 gdb, gdbserver, gdbsupport: fix leading space vs tabs issues
Many spots incorrectly use only spaces for indentation (for example,
there are a lot of spots in ada-lang.c).  I've always found it awkward
when I needed to edit one of these spots: do I keep the original wrong
indentation, or do I fix it?  What if the lines around it are also
wrong, do I fix them too?  I probably don't want to fix them in the same
patch, to avoid adding noise to my patch.

So I propose to fix as much as possible once and for all (hopefully).

One typical counter argument for this is that it makes code archeology
more difficult, because git-blame will show this commit as the last
change for these lines.  My counter counter argument is: when
git-blaming, you often need to do "blame the file at the parent commit"
anyway, to go past some other refactor that touched the line you are
interested in, but is not the change you are looking for.  So you
already need a somewhat efficient way to do this.

Using some interactive tool, rather than plain git-blame, makes this
trivial.  For example, I use "tig blame <file>", where going back past
the commit that changed the currently selected line is one keystroke.
It looks like Magit in Emacs does it too (though I've never used it).
Web viewers of Github and Gitlab do it too.  My point is that it won't
really make archeology more difficult.

The other typical counter argument is that it will cause conflicts with
existing patches.  That's true... but it's a one time cost, and those
are not conflicts that are difficult to resolve.  I have also tried "git
rebase --ignore-whitespace", it seems to work well.  Although that will
re-introduce the faulty indentation, so one needs to take care of fixing
the indentation in the patch after that (which is easy).

gdb/ChangeLog:

	* aarch64-linux-tdep.c: Fix indentation.
	* aarch64-ravenscar-thread.c: Fix indentation.
	* aarch64-tdep.c: Fix indentation.
	* aarch64-tdep.h: Fix indentation.
	* ada-lang.c: Fix indentation.
	* ada-lang.h: Fix indentation.
	* ada-tasks.c: Fix indentation.
	* ada-typeprint.c: Fix indentation.
	* ada-valprint.c: Fix indentation.
	* ada-varobj.c: Fix indentation.
	* addrmap.c: Fix indentation.
	* addrmap.h: Fix indentation.
	* agent.c: Fix indentation.
	* aix-thread.c: Fix indentation.
	* alpha-bsd-nat.c: Fix indentation.
	* alpha-linux-tdep.c: Fix indentation.
	* alpha-mdebug-tdep.c: Fix indentation.
	* alpha-nbsd-tdep.c: Fix indentation.
	* alpha-obsd-tdep.c: Fix indentation.
	* alpha-tdep.c: Fix indentation.
	* amd64-bsd-nat.c: Fix indentation.
	* amd64-darwin-tdep.c: Fix indentation.
	* amd64-linux-nat.c: Fix indentation.
	* amd64-linux-tdep.c: Fix indentation.
	* amd64-nat.c: Fix indentation.
	* amd64-obsd-tdep.c: Fix indentation.
	* amd64-tdep.c: Fix indentation.
	* amd64-windows-tdep.c: Fix indentation.
	* annotate.c: Fix indentation.
	* arc-tdep.c: Fix indentation.
	* arch-utils.c: Fix indentation.
	* arch/arm-get-next-pcs.c: Fix indentation.
	* arch/arm.c: Fix indentation.
	* arm-linux-nat.c: Fix indentation.
	* arm-linux-tdep.c: Fix indentation.
	* arm-nbsd-tdep.c: Fix indentation.
	* arm-pikeos-tdep.c: Fix indentation.
	* arm-tdep.c: Fix indentation.
	* arm-tdep.h: Fix indentation.
	* arm-wince-tdep.c: Fix indentation.
	* auto-load.c: Fix indentation.
	* auxv.c: Fix indentation.
	* avr-tdep.c: Fix indentation.
	* ax-gdb.c: Fix indentation.
	* ax-general.c: Fix indentation.
	* bfin-linux-tdep.c: Fix indentation.
	* block.c: Fix indentation.
	* block.h: Fix indentation.
	* blockframe.c: Fix indentation.
	* bpf-tdep.c: Fix indentation.
	* break-catch-sig.c: Fix indentation.
	* break-catch-syscall.c: Fix indentation.
	* break-catch-throw.c: Fix indentation.
	* breakpoint.c: Fix indentation.
	* breakpoint.h: Fix indentation.
	* bsd-uthread.c: Fix indentation.
	* btrace.c: Fix indentation.
	* build-id.c: Fix indentation.
	* buildsym-legacy.h: Fix indentation.
	* buildsym.c: Fix indentation.
	* c-typeprint.c: Fix indentation.
	* c-valprint.c: Fix indentation.
	* c-varobj.c: Fix indentation.
	* charset.c: Fix indentation.
	* cli/cli-cmds.c: Fix indentation.
	* cli/cli-decode.c: Fix indentation.
	* cli/cli-decode.h: Fix indentation.
	* cli/cli-script.c: Fix indentation.
	* cli/cli-setshow.c: Fix indentation.
	* coff-pe-read.c: Fix indentation.
	* coffread.c: Fix indentation.
	* compile/compile-cplus-types.c: Fix indentation.
	* compile/compile-object-load.c: Fix indentation.
	* compile/compile-object-run.c: Fix indentation.
	* completer.c: Fix indentation.
	* corefile.c: Fix indentation.
	* corelow.c: Fix indentation.
	* cp-abi.h: Fix indentation.
	* cp-namespace.c: Fix indentation.
	* cp-support.c: Fix indentation.
	* cp-valprint.c: Fix indentation.
	* cris-linux-tdep.c: Fix indentation.
	* cris-tdep.c: Fix indentation.
	* darwin-nat-info.c: Fix indentation.
	* darwin-nat.c: Fix indentation.
	* darwin-nat.h: Fix indentation.
	* dbxread.c: Fix indentation.
	* dcache.c: Fix indentation.
	* disasm.c: Fix indentation.
	* dtrace-probe.c: Fix indentation.
	* dwarf2/abbrev.c: Fix indentation.
	* dwarf2/attribute.c: Fix indentation.
	* dwarf2/expr.c: Fix indentation.
	* dwarf2/frame.c: Fix indentation.
	* dwarf2/index-cache.c: Fix indentation.
	* dwarf2/index-write.c: Fix indentation.
	* dwarf2/line-header.c: Fix indentation.
	* dwarf2/loc.c: Fix indentation.
	* dwarf2/macro.c: Fix indentation.
	* dwarf2/read.c: Fix indentation.
	* dwarf2/read.h: Fix indentation.
	* elfread.c: Fix indentation.
	* eval.c: Fix indentation.
	* event-top.c: Fix indentation.
	* exec.c: Fix indentation.
	* exec.h: Fix indentation.
	* expprint.c: Fix indentation.
	* f-lang.c: Fix indentation.
	* f-typeprint.c: Fix indentation.
	* f-valprint.c: Fix indentation.
	* fbsd-nat.c: Fix indentation.
	* fbsd-tdep.c: Fix indentation.
	* findvar.c: Fix indentation.
	* fork-child.c: Fix indentation.
	* frame-unwind.c: Fix indentation.
	* frame-unwind.h: Fix indentation.
	* frame.c: Fix indentation.
	* frv-linux-tdep.c: Fix indentation.
	* frv-tdep.c: Fix indentation.
	* frv-tdep.h: Fix indentation.
	* ft32-tdep.c: Fix indentation.
	* gcore.c: Fix indentation.
	* gdb_bfd.c: Fix indentation.
	* gdbarch.sh: Fix indentation.
	* gdbarch.c: Re-generate
	* gdbarch.h: Re-generate.
	* gdbcore.h: Fix indentation.
	* gdbthread.h: Fix indentation.
	* gdbtypes.c: Fix indentation.
	* gdbtypes.h: Fix indentation.
	* glibc-tdep.c: Fix indentation.
	* gnu-nat.c: Fix indentation.
	* gnu-nat.h: Fix indentation.
	* gnu-v2-abi.c: Fix indentation.
	* gnu-v3-abi.c: Fix indentation.
	* go32-nat.c: Fix indentation.
	* guile/guile-internal.h: Fix indentation.
	* guile/scm-cmd.c: Fix indentation.
	* guile/scm-frame.c: Fix indentation.
	* guile/scm-iterator.c: Fix indentation.
	* guile/scm-math.c: Fix indentation.
	* guile/scm-ports.c: Fix indentation.
	* guile/scm-pretty-print.c: Fix indentation.
	* guile/scm-value.c: Fix indentation.
	* h8300-tdep.c: Fix indentation.
	* hppa-linux-nat.c: Fix indentation.
	* hppa-linux-tdep.c: Fix indentation.
	* hppa-nbsd-nat.c: Fix indentation.
	* hppa-nbsd-tdep.c: Fix indentation.
	* hppa-obsd-nat.c: Fix indentation.
	* hppa-tdep.c: Fix indentation.
	* hppa-tdep.h: Fix indentation.
	* i386-bsd-nat.c: Fix indentation.
	* i386-darwin-nat.c: Fix indentation.
	* i386-darwin-tdep.c: Fix indentation.
	* i386-dicos-tdep.c: Fix indentation.
	* i386-gnu-nat.c: Fix indentation.
	* i386-linux-nat.c: Fix indentation.
	* i386-linux-tdep.c: Fix indentation.
	* i386-nto-tdep.c: Fix indentation.
	* i386-obsd-tdep.c: Fix indentation.
	* i386-sol2-nat.c: Fix indentation.
	* i386-tdep.c: Fix indentation.
	* i386-tdep.h: Fix indentation.
	* i386-windows-tdep.c: Fix indentation.
	* i387-tdep.c: Fix indentation.
	* i387-tdep.h: Fix indentation.
	* ia64-libunwind-tdep.c: Fix indentation.
	* ia64-libunwind-tdep.h: Fix indentation.
	* ia64-linux-nat.c: Fix indentation.
	* ia64-linux-tdep.c: Fix indentation.
	* ia64-tdep.c: Fix indentation.
	* ia64-tdep.h: Fix indentation.
	* ia64-vms-tdep.c: Fix indentation.
	* infcall.c: Fix indentation.
	* infcmd.c: Fix indentation.
	* inferior.c: Fix indentation.
	* infrun.c: Fix indentation.
	* iq2000-tdep.c: Fix indentation.
	* language.c: Fix indentation.
	* linespec.c: Fix indentation.
	* linux-fork.c: Fix indentation.
	* linux-nat.c: Fix indentation.
	* linux-tdep.c: Fix indentation.
	* linux-thread-db.c: Fix indentation.
	* lm32-tdep.c: Fix indentation.
	* m2-lang.c: Fix indentation.
	* m2-typeprint.c: Fix indentation.
	* m2-valprint.c: Fix indentation.
	* m32c-tdep.c: Fix indentation.
	* m32r-linux-tdep.c: Fix indentation.
	* m32r-tdep.c: Fix indentation.
	* m68hc11-tdep.c: Fix indentation.
	* m68k-bsd-nat.c: Fix indentation.
	* m68k-linux-nat.c: Fix indentation.
	* m68k-linux-tdep.c: Fix indentation.
	* m68k-tdep.c: Fix indentation.
	* machoread.c: Fix indentation.
	* macrocmd.c: Fix indentation.
	* macroexp.c: Fix indentation.
	* macroscope.c: Fix indentation.
	* macrotab.c: Fix indentation.
	* macrotab.h: Fix indentation.
	* main.c: Fix indentation.
	* mdebugread.c: Fix indentation.
	* mep-tdep.c: Fix indentation.
	* mi/mi-cmd-catch.c: Fix indentation.
	* mi/mi-cmd-disas.c: Fix indentation.
	* mi/mi-cmd-env.c: Fix indentation.
	* mi/mi-cmd-stack.c: Fix indentation.
	* mi/mi-cmd-var.c: Fix indentation.
	* mi/mi-cmds.c: Fix indentation.
	* mi/mi-main.c: Fix indentation.
	* mi/mi-parse.c: Fix indentation.
	* microblaze-tdep.c: Fix indentation.
	* minidebug.c: Fix indentation.
	* minsyms.c: Fix indentation.
	* mips-linux-nat.c: Fix indentation.
	* mips-linux-tdep.c: Fix indentation.
	* mips-nbsd-tdep.c: Fix indentation.
	* mips-tdep.c: Fix indentation.
	* mn10300-linux-tdep.c: Fix indentation.
	* mn10300-tdep.c: Fix indentation.
	* moxie-tdep.c: Fix indentation.
	* msp430-tdep.c: Fix indentation.
	* namespace.h: Fix indentation.
	* nat/fork-inferior.c: Fix indentation.
	* nat/gdb_ptrace.h: Fix indentation.
	* nat/linux-namespaces.c: Fix indentation.
	* nat/linux-osdata.c: Fix indentation.
	* nat/netbsd-nat.c: Fix indentation.
	* nat/x86-dregs.c: Fix indentation.
	* nbsd-nat.c: Fix indentation.
	* nbsd-tdep.c: Fix indentation.
	* nios2-linux-tdep.c: Fix indentation.
	* nios2-tdep.c: Fix indentation.
	* nto-procfs.c: Fix indentation.
	* nto-tdep.c: Fix indentation.
	* objfiles.c: Fix indentation.
	* objfiles.h: Fix indentation.
	* opencl-lang.c: Fix indentation.
	* or1k-tdep.c: Fix indentation.
	* osabi.c: Fix indentation.
	* osabi.h: Fix indentation.
	* osdata.c: Fix indentation.
	* p-lang.c: Fix indentation.
	* p-typeprint.c: Fix indentation.
	* p-valprint.c: Fix indentation.
	* parse.c: Fix indentation.
	* ppc-linux-nat.c: Fix indentation.
	* ppc-linux-tdep.c: Fix indentation.
	* ppc-nbsd-nat.c: Fix indentation.
	* ppc-nbsd-tdep.c: Fix indentation.
	* ppc-obsd-nat.c: Fix indentation.
	* ppc-ravenscar-thread.c: Fix indentation.
	* ppc-sysv-tdep.c: Fix indentation.
	* ppc64-tdep.c: Fix indentation.
	* printcmd.c: Fix indentation.
	* proc-api.c: Fix indentation.
	* producer.c: Fix indentation.
	* producer.h: Fix indentation.
	* prologue-value.c: Fix indentation.
	* prologue-value.h: Fix indentation.
	* psymtab.c: Fix indentation.
	* python/py-arch.c: Fix indentation.
	* python/py-bpevent.c: Fix indentation.
	* python/py-event.c: Fix indentation.
	* python/py-event.h: Fix indentation.
	* python/py-finishbreakpoint.c: Fix indentation.
	* python/py-frame.c: Fix indentation.
	* python/py-framefilter.c: Fix indentation.
	* python/py-inferior.c: Fix indentation.
	* python/py-infthread.c: Fix indentation.
	* python/py-objfile.c: Fix indentation.
	* python/py-prettyprint.c: Fix indentation.
	* python/py-registers.c: Fix indentation.
	* python/py-signalevent.c: Fix indentation.
	* python/py-stopevent.c: Fix indentation.
	* python/py-stopevent.h: Fix indentation.
	* python/py-threadevent.c: Fix indentation.
	* python/py-tui.c: Fix indentation.
	* python/py-unwind.c: Fix indentation.
	* python/py-value.c: Fix indentation.
	* python/py-xmethods.c: Fix indentation.
	* python/python-internal.h: Fix indentation.
	* python/python.c: Fix indentation.
	* ravenscar-thread.c: Fix indentation.
	* record-btrace.c: Fix indentation.
	* record-full.c: Fix indentation.
	* record.c: Fix indentation.
	* reggroups.c: Fix indentation.
	* regset.h: Fix indentation.
	* remote-fileio.c: Fix indentation.
	* remote.c: Fix indentation.
	* reverse.c: Fix indentation.
	* riscv-linux-tdep.c: Fix indentation.
	* riscv-ravenscar-thread.c: Fix indentation.
	* riscv-tdep.c: Fix indentation.
	* rl78-tdep.c: Fix indentation.
	* rs6000-aix-tdep.c: Fix indentation.
	* rs6000-lynx178-tdep.c: Fix indentation.
	* rs6000-nat.c: Fix indentation.
	* rs6000-tdep.c: Fix indentation.
	* rust-lang.c: Fix indentation.
	* rx-tdep.c: Fix indentation.
	* s12z-tdep.c: Fix indentation.
	* s390-linux-tdep.c: Fix indentation.
	* score-tdep.c: Fix indentation.
	* ser-base.c: Fix indentation.
	* ser-mingw.c: Fix indentation.
	* ser-uds.c: Fix indentation.
	* ser-unix.c: Fix indentation.
	* serial.c: Fix indentation.
	* sh-linux-tdep.c: Fix indentation.
	* sh-nbsd-tdep.c: Fix indentation.
	* sh-tdep.c: Fix indentation.
	* skip.c: Fix indentation.
	* sol-thread.c: Fix indentation.
	* solib-aix.c: Fix indentation.
	* solib-darwin.c: Fix indentation.
	* solib-frv.c: Fix indentation.
	* solib-svr4.c: Fix indentation.
	* solib.c: Fix indentation.
	* source.c: Fix indentation.
	* sparc-linux-tdep.c: Fix indentation.
	* sparc-nbsd-tdep.c: Fix indentation.
	* sparc-obsd-tdep.c: Fix indentation.
	* sparc-ravenscar-thread.c: Fix indentation.
	* sparc-tdep.c: Fix indentation.
	* sparc64-linux-tdep.c: Fix indentation.
	* sparc64-nbsd-tdep.c: Fix indentation.
	* sparc64-obsd-tdep.c: Fix indentation.
	* sparc64-tdep.c: Fix indentation.
	* stabsread.c: Fix indentation.
	* stack.c: Fix indentation.
	* stap-probe.c: Fix indentation.
	* stubs/ia64vms-stub.c: Fix indentation.
	* stubs/m32r-stub.c: Fix indentation.
	* stubs/m68k-stub.c: Fix indentation.
	* stubs/sh-stub.c: Fix indentation.
	* stubs/sparc-stub.c: Fix indentation.
	* symfile-mem.c: Fix indentation.
	* symfile.c: Fix indentation.
	* symfile.h: Fix indentation.
	* symmisc.c: Fix indentation.
	* symtab.c: Fix indentation.
	* symtab.h: Fix indentation.
	* target-float.c: Fix indentation.
	* target.c: Fix indentation.
	* target.h: Fix indentation.
	* tic6x-tdep.c: Fix indentation.
	* tilegx-linux-tdep.c: Fix indentation.
	* tilegx-tdep.c: Fix indentation.
	* top.c: Fix indentation.
	* tracefile-tfile.c: Fix indentation.
	* tracepoint.c: Fix indentation.
	* tui/tui-disasm.c: Fix indentation.
	* tui/tui-io.c: Fix indentation.
	* tui/tui-regs.c: Fix indentation.
	* tui/tui-stack.c: Fix indentation.
	* tui/tui-win.c: Fix indentation.
	* tui/tui-winsource.c: Fix indentation.
	* tui/tui.c: Fix indentation.
	* typeprint.c: Fix indentation.
	* ui-out.h: Fix indentation.
	* unittests/copy_bitwise-selftests.c: Fix indentation.
	* unittests/memory-map-selftests.c: Fix indentation.
	* utils.c: Fix indentation.
	* v850-tdep.c: Fix indentation.
	* valarith.c: Fix indentation.
	* valops.c: Fix indentation.
	* valprint.c: Fix indentation.
	* valprint.h: Fix indentation.
	* value.c: Fix indentation.
	* value.h: Fix indentation.
	* varobj.c: Fix indentation.
	* vax-tdep.c: Fix indentation.
	* windows-nat.c: Fix indentation.
	* windows-tdep.c: Fix indentation.
	* xcoffread.c: Fix indentation.
	* xml-syscall.c: Fix indentation.
	* xml-tdesc.c: Fix indentation.
	* xstormy16-tdep.c: Fix indentation.
	* xtensa-config.c: Fix indentation.
	* xtensa-linux-nat.c: Fix indentation.
	* xtensa-linux-tdep.c: Fix indentation.
	* xtensa-tdep.c: Fix indentation.

gdbserver/ChangeLog:

	* ax.cc: Fix indentation.
	* dll.cc: Fix indentation.
	* inferiors.h: Fix indentation.
	* linux-low.cc: Fix indentation.
	* linux-nios2-low.cc: Fix indentation.
	* linux-ppc-ipa.cc: Fix indentation.
	* linux-ppc-low.cc: Fix indentation.
	* linux-x86-low.cc: Fix indentation.
	* linux-xtensa-low.cc: Fix indentation.
	* regcache.cc: Fix indentation.
	* server.cc: Fix indentation.
	* tracepoint.cc: Fix indentation.

gdbsupport/ChangeLog:

	* common-exceptions.h: Fix indentation.
	* event-loop.cc: Fix indentation.
	* fileio.cc: Fix indentation.
	* filestuff.cc: Fix indentation.
	* gdb-dlfcn.cc: Fix indentation.
	* gdb_string_view.h: Fix indentation.
	* job-control.cc: Fix indentation.
	* signals.cc: Fix indentation.

Change-Id: I4bad7ae6be0fbe14168b8ebafb98ffe14964a695
2020-11-02 10:28:45 -05:00
Tom Tromey
9dccd06e8a Remove target_has_registers macro
This removes the target_has_registers object-like macro, replacing it
with the underlying function.

gdb/ChangeLog
2020-09-28  Tom Tromey  <tom@tromey.com>

	* tui/tui-regs.c (tui_get_register)
	(tui_data_window::show_registers): Update.
	* thread.c (scoped_restore_current_thread::restore)
	(scoped_restore_current_thread::scoped_restore_current_thread):
	Update.
	* regcache-dump.c (regcache_print): Update.
	* python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb):
	Update.
	* mi/mi-main.c (mi_cmd_data_write_register_values): Update.
	* mep-tdep.c (current_me_module, current_options): Update.
	* linux-thread-db.c (thread_db_load): Update.
	* infcmd.c (registers_info, info_vector_command)
	(info_float_command): Update.
	* ia64-tdep.c (ia64_frame_prev_register)
	(ia64_sigtramp_frame_prev_register): Update.
	* ia64-libunwind-tdep.c (libunwind_frame_prev_register): Update.
	* gcore.c (derive_stack_segment): Update.
	* frame.c (get_current_frame, has_stack_frames): Update.
	* findvar.c (language_defn::read_var_value): Update.
	* arm-tdep.c (arm_pc_is_thumb): Update.
	* target.c (target_has_registers): Rename from
	target_has_registers_1.
	* target.h (target_has_registers): Remove macro.
	(target_has_registers): Rename from target_has_registers_1.
2020-09-28 19:52:21 -06:00
Tom Tromey
841de12014 Remove target_has_stack macro
This removes the target_has_stack object-like macro, replacing it with
the underlying function.

gdb/ChangeLog
2020-09-28  Tom Tromey  <tom@tromey.com>

	* windows-tdep.c (tlb_make_value): Update.
	* tui/tui-regs.c (tui_data_window::show_registers): Update.
	* thread.c (scoped_restore_current_thread::restore)
	(scoped_restore_current_thread::scoped_restore_current_thread)
	(thread_command): Update.
	* stack.c (backtrace_command_1, frame_apply_level_command)
	(frame_apply_all_command, frame_apply_command): Update.
	* infrun.c (siginfo_make_value, restore_infcall_control_state):
	Update.
	* gcore.c (derive_stack_segment): Update.
	* frame.c (get_current_frame, has_stack_frames): Update.
	* auxv.c (info_auxv_command): Update.
	* ada-tasks.c (ada_build_task_list): Update.
	* target.c (target_has_stack): Rename from target_has_stack_1.
	* target.h (target_has_stack): Remove macro.
	(target_has_stack): Rename from target_has_stack_1.
2020-09-28 19:52:21 -06:00
Tom Tromey
a739972c7c Remove target_has_memory macro
This removes the target_has_memory object-like macro, replacing it
with the underlying function.

gdb/ChangeLog
2020-09-28  Tom Tromey  <tom@tromey.com>

	* target.c (target_has_memory): Rename from target_has_memory_1.
	* tui/tui-regs.c (tui_data_window::show_registers): Update.
	* thread.c (scoped_restore_current_thread::restore)
	(scoped_restore_current_thread::scoped_restore_current_thread):
	Update.
	* frame.c (get_current_frame, has_stack_frames): Update.
	* target.h (target_has_memory): Remove macro.
	(target_has_memory): Rename from target_has_memory_1.
2020-09-28 19:52:21 -06:00
Tom Tromey
7134f2eb92 Don't derive tui_data_item_window from tui_gen_win_info
There's no deep reason that tui_data_item_window should derive from
tui_gen_win_info -- it currently uses a curses window to render, but
that isn't truly needed, and it adds some hacks to other parts of the
TUI.

This patch changes tui_data_item_window so that it doesn't have a base
class, and updates the register window.  This simplifies the code and
enables a subsequent cleanup.

gdb/ChangeLog
2020-07-01  Tom Tromey  <tom@tromey.com>

	* tui/tui-regs.c (tui_data_window::display_registers_from)
	(tui_data_window::display_registers_from)
	(tui_data_window::first_data_item_displayed)
	(tui_data_window::delete_data_content_windows): Update.
	(tui_data_window::refresh_window, tui_data_window::no_refresh):
	Remove.
	(tui_data_window::check_register_values): Update.
	(tui_data_item_window::rerender): Add parameters.  Update.
	(tui_data_item_window::refresh_window): Remove.
	* tui/tui-data.h (struct tui_gen_win_info) <no_refresh>: No longer
	virtual.
	* tui/tui-regs.h (struct tui_data_item_window): Don't derive from
	tui_gen_win_info.
	<refresh_window, max_height, min_height>: Remove.
	<rerender>: Add parameters.
	<x, y, visible>: New members.
	(struct tui_data_window) <refresh_window, no_refresh>: Remove.
	<m_item_width>: New member.
2020-07-01 21:21:15 -06:00
Tom Tromey
22b7b0412b Rename tui_data_item_window::item_no
tui_data_item_window::item_no is misnamed -- it only can be used for a
register, but it references a "display" number as well.  (Based on
other comments I've seen in the past -- most since deleted -- I think
there were plans at one point to display variables in this window as
well.  However, this was never implemented.)

This patch renames this member to be more correct.

gdb/ChangeLog
2020-07-01  Tom Tromey  <tom@tromey.com>

	* tui/tui-regs.c (tui_data_window::show_register_group)
	(tui_data_window::check_register_values): Update.
	* tui/tui-regs.h (struct tui_data_item_window) <regno>: Rename
	from item_no.
2020-07-01 21:21:15 -06:00
Tom Tromey
c9753adb01 Remove useless "if' from tui-regs.c
tui_data_window::show_register_group had a useless "if" -- the
condition could never be false.  This patch removes it.

gdb/ChangeLog
2020-07-01  Tom Tromey  <tom@tromey.com>

	* tui/tui-regs.c (tui_data_window::show_register_group): Remove
	useless "if".
2020-07-01 21:21:14 -06:00