This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/TileGX 2/2] fix gdbserver runtime crash


> TileGX is always 64bit, ptrace always return 64bit data,  tilegx32
> is just an ABI.
> 
> So the regset size should be regnum * 8 instead of regnum * 4. The
> latter cause gdbserver crash.
> 
> gdbserver/ChangeLog:
> 
>   * linux-tile-low.c (tile_regsets): Modify the size field as 64bit
> for each register.

I will trust you on this one, but how did this even work at all
prior to your change???

> diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
> index 8963b9a..8efb34e 100644
> --- a/gdb/gdbserver/linux-tile-low.c
> +++ b/gdb/gdbserver/linux-tile-low.c
> @@ -124,7 +124,7 @@ tile_store_gregset (struct regcache *regcache, const void *buf)
>  
>  static struct regset_info tile_regsets[] =
>  {
> -  { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 4,
> +  { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 8,
>      GENERAL_REGS, tile_fill_gregset, tile_store_gregset },
>    { 0, 0, 0, -1, -1, NULL, NULL }
>  };


-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]