Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Steve Ellcey <sellcey@caviumnetworks.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [Patch v2 1/2] Enable ILP32 mode in gdb on aarch64
Date: Tue, 07 Mar 2017 10:20:00 -0000	[thread overview]
Message-ID: <867f41wfph.fsf@gmail.com> (raw)
In-Reply-To: <1488837762.2866.268.camel@caviumnetworks.com> (Steve Ellcey's	message of "Mon, 06 Mar 2017 14:02:42 -0800")

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 (齐尧)


  reply	other threads:[~2017-03-07 10:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 22:03 Steve Ellcey
2017-03-07 10:20 ` Yao Qi [this message]
2017-03-07 19:55   ` Steve Ellcey
2017-03-09 13:24     ` Yao Qi
2017-03-09 17:33       ` Steve Ellcey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867f41wfph.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sellcey@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox