]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Minor reorganization of fetch_registers/store_registers in windows-nat.c
authorJoel Brobecker <brobecker@adacore.com>
Tue, 26 Jun 2018 21:38:32 +0000 (14:38 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 26 Jun 2018 21:38:32 +0000 (14:38 -0700)
commit9a325b7b3ff056647de536941eaba911d1d794ad
tree58dac3d149206c855105e76e2c1e475910e1d15a
parenta33ccfc7afd9e32dd310f54d04719efeec8df342
Minor reorganization of fetch_registers/store_registers in windows-nat.c

This patch is a small reorganizational patch that splits
do_windows_fetch_inferior_registers into two parts:

  (a) One part that first reloads the thread's context when needed,
      and then decides based on the given register number whether
      one register needs to be fetched or all of them.

      This part is moved to windows_nat_target::fetch_registers.

  (b) The rest of the code, which actually fetches the register value
      and supplies it to the regcache.

A similar treatment is applied to do_windows_store_inferior_registers.

This change is preparation work for changing the way we calculate
the location of a given register in the thread context structure,
and should be a no op.

gdb/ChangeLog:

        * windows-nat.c (do_windows_fetch_inferior_registers): Rename
        to windows_fetch_one_register, and only handle the case of
        fetching one register.  Move the code that reloads the context
        and iterates over all registers if R is negative to...
        (windows_nat_target::fetch_registers): ... here.
        (do_windows_store_inferior_registers): Rename to
        windows_store_one_register, and only handle the case of storing
        one register.  Move the code that handles the case where r is
        negative to...
        (windows_nat_target::store_registers) ... here.

Tested on x86-windows and x86_64-windows using AdaCore's testsuite.
gdb/ChangeLog
gdb/windows-nat.c