[PATCH] Remove some unnecessary inferior_ptid setting/restoring when fetching/storing registers

Simon Marchi simon.marchi@polymtl.ca
Wed Mar 22 17:51:00 GMT 2017


On 2017-03-22 13:29, Simon Marchi wrote:
> diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
> index efb3bd0b21..ae9b1411cf 100644
> --- a/gdb/sol-thread.c
> +++ b/gdb/sol-thread.c
> @@ -903,13 +897,9 @@ ps_err_e
>  ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
>  	     const prgregset_t gregset)
>  {
> -  struct cleanup *old_chain;
> -  struct regcache *regcache;
> -
> -  old_chain = save_inferior_ptid ();
> -
> -  inferior_ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
> -  regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch 
> ());
> +  ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
> +  struct regcache *regcache
> +    = get_thread_arch_regcache (ptid, target_gdbarch ());
> 
>    supply_gregset (regcache, (const gdb_gregset_t *) gregset);
>    target_store_registers (regcache, -1);

I actually tried to build sol-thread.o on Solaris and noticed I forgot 
to remove a "do_cleanups (old_chain);" just below here.  I fixed it 
locally.

I couldn't get the whole of GDB to build however:

g++ -std=gnu++11 -g3 -O0   -I. -I. -I./common -I./config 
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H 
-I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I./../zlib 
-I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber 
  -I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  
-I/usr/include/python2.7 -I/usr/include/python2.7 -Wall -Wpointer-arith 
-Wno-unused -Wunused-value -Wunused-function -Wno-switch 
-Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter 
-Wunused-but-set-variable -Wno-sign-compare -Wno-write-strings 
-Wno-narrowing -Wformat-nonliteral -Wno-deprecated-declarations -Werror 
-c -o i386-sol2-nat.o -MT i386-sol2-nat.o -MMD -MP -MF 
.deps/i386-sol2-nat.Tpo i386-sol2-nat.c
In file included from /usr/include/sys/procfs.h:26:0,
                  from i386-sol2-nat.c:23:
/usr/include/sys/old_procfs.h:31:2: error: #error "Cannot use procfs in 
the large file compilation environment"
  #error "Cannot use procfs in the large file compilation environment"
   ^
gmake: *** [i386-sol2-nat.o] Error 1



More information about the Gdb-patches mailing list