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: [Patch v2 1/2] Enable ILP32 mode in gdb on aarch64


Steve Ellcey <sellcey@caviumnetworks.com> writes:

> I believe most of the new failures are due to two problems.  One is
> unwinding through signal handlers and the other is accessing thread

Do the answers in this thread help?
https://sourceware.org/ml/gdb/2017-02/msg00056.html

> local data.  I think the thread problem may be due to a version
> mismatch between the thread_db library that gdb (a 64 bit process)
> is using and a newer thread_db library that the 32 bit executables

Do you mean libpthread?  thread_db is only used in with gdb.  It can be
the issue you described but could you provide more information?  Just
make sure ptrace NT_ARM_TLS is right on ILP32 between user space and
kernel.

> I am working on the signal unwinding problem but I was hoping that
> the part that is already working is sufficiently useful to check in
> while I work on fixing this problem.  The current code handles the
> usual gdb functionality of breakpoints, stepping, printing variables,
> etc.

The patch can be pushed in after all questions/issues are resolved (I still
have one question asked above) and after ILP32 kernel patches are merged.

> diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
> index 0d472e2..0caac7f 100644
> --- a/gdb/aarch64-linux-nat.c
> +++ b/gdb/aarch64-linux-nat.c
> @@ -49,6 +49,9 @@
>  #define TRAP_HWBKPT 0x0004
>  #endif
>  
> +/* Check if we are on arm (as opposed to aarch64).  */
> +#define IS_ARM32(gdbarch) (gdbarch_bfd_arch_info(gdbarch)->arch == bfd_arch_arm)
> +

This line is too long.

> @@ -460,8 +463,7 @@ ps_err_e
>  ps_get_thread_area (struct ps_prochandle *ph,
>  		    lwpid_t lwpid, int idx, void **base)
>  {
> -  int is_64bit_p
> -    = (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 64);
> +  int is_64bit_p = !IS_ARM32 (target_gdbarch ());
>  
>    return aarch64_ps_get_thread_area (ph, lwpid, idx, base,
>    is_64bit_p);

Can you rename the variable to "is_aarch64_p"?

-- 
Yao (齐尧)


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