Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 04/18] gdbserver crash running gdb.threads/non-ldr-exc-1.exp
Date: Tue, 24 Nov 2015 16:34:00 -0000	[thread overview]
Message-ID: <565491A1.8020408@redhat.com> (raw)
In-Reply-To: <86mvv52920.fsf@gmail.com>

On 10/26/2015 10:55 AM, Yao Qi wrote:

> I do something similar in AArch64 GDBserver backend to fix the crash.
> Could you include this patch in your series if it is OK to you?  My
> patch depends on your patch 04/18.
> Note that I didn't add "set_general_process" as you suggested, because I
> am not 100% sure the rules of switching current_thread.
> 

Hmm, using one of the new Aarch64 machines on the GCC compile farm, I see
that the crash comes from here:

(gdb) bt
#0  0x0000000000408074 in inferior_regcache_data (inferior=0x0) at ../../../src/gdb/gdbserver/inferiors.c:281
#1  0x000000000040840c in get_thread_regcache (thread=0x0, fetch=0) at ../../../src/gdb/gdbserver/regcache.c:31
#2  0x000000000042fb14 in is_64bit_tdesc () at ../../../src/gdb/gdbserver/linux-aarch64-low.c:84
#3  0x0000000000430098 in aarch64_supports_z_point_type (z_type=48 '0') at ../../../src/gdb/gdbserver/linux-aarch64-low.c:264
#4  0x00000000004422cc in linux_supports_z_point_type (z_type=48 '0') at ../../../src/gdb/gdbserver/linux-low.c:5629
#5  0x000000000041a0e8 in z_type_supported (z_type=48 '0') at ../../../src/gdb/gdbserver/mem-break.c:930
#6  0x000000000041a234 in check_gdb_bp_preconditions (z_type=48 '0', err=0x7fc1dcccb8) at ../../../src/gdb/gdbserver/mem-break.c:1021
#7  0x000000000041a380 in delete_gdb_breakpoint (z_type=48 '0', addr=4196520, kind=4) at ../../../src/gdb/gdbserver/mem-break.c:1093
#8  0x000000000041650c in process_serial_event () at ../../../src/gdb/gdbserver/server.c:4193
#9  0x000000000041690c in handle_serial_event (err=0, client_data=0x0) at ../../../src/gdb/gdbserver/server.c:4323
#10 0x000000000041e74c in handle_file_event (event_file_desc=4) at ../../../src/gdb/gdbserver/event-loop.c:428
#11 0x000000000041dbf8 in process_event () at ../../../src/gdb/gdbserver/event-loop.c:184
#12 0x000000000041eb64 in start_event_loop () at ../../../src/gdb/gdbserver/event-loop.c:547
#13 0x0000000000415204 in captured_main (argc=4, argv=0x7fc1dcd0e8) at ../../../src/gdb/gdbserver/server.c:3688
#14 0x0000000000415434 in main (argc=4, argv=0x7fc1dcd0e8) at ../../../src/gdb/gdbserver/server.c:3773

And that is_64bit_tdesc call was added by 6085d6f6:

--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -364,6 +364,22 @@ aarch64_supports_z_point_type (char z_type)
   switch (z_type)
     {
     case Z_PACKET_SW_BP:
+      {
+       if (!extended_protocol && is_64bit_tdesc ())
+         {
+           /* Only enable Z0 packet in non-multi-arch debugging.  If
+              extended protocol is used, don't enable Z0 packet because
+              GDBserver may attach to 32-bit process.  */
+           return 1;
+         }
+       else
+         {
+           /* Disable Z0 packet so that GDBserver doesn't have to handle
+              different breakpoint instructions (aarch64, arm, thumb etc)
+              in multi-arch debugging.  */
+           return 0;
+         }
+      }


Now that Antoine's series that teaches gdbserver about different breakpoint
kinds is in, perhaps we could just revert 6085d6f6 now?

Thanks,
Pedro Alves


  reply	other threads:[~2015-11-24 16:34 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 15:28 [PATCH 00/18] Remote all-stop on top of non-stop Pedro Alves
2015-10-14 15:28 ` [PATCH 02/18] Remote all-stop-on-top-of-non-stop Pedro Alves
2015-10-24 22:39   ` Yao Qi
2015-11-23 15:40     ` Pedro Alves
2015-11-23 18:39       ` Pedro Alves
2015-11-26 15:53         ` Yao Qi
2015-10-14 15:28 ` [PATCH 15/18] gdbserver:prepare_access_memory: pick another thread Pedro Alves
2015-10-14 15:28 ` [PATCH 18/18] remote: enable "maint set target-non-stop" by default Pedro Alves
2015-10-14 15:28 ` [PATCH 01/18] Fix mi-nonstop.exp with extended-remote Pedro Alves
2015-10-14 15:28 ` [PATCH 13/18] infrun: Fix TARGET_WAITKIND_NO_RESUMED handling in non-stop mode Pedro Alves
2015-10-14 15:28 ` [PATCH 03/18] attach + target always in non-stop mode: stop all threads Pedro Alves
2015-10-26 13:22   ` Yao Qi
2015-11-23 18:15     ` Pedro Alves
2015-11-23 18:42       ` Pedro Alves
2015-11-26 16:12       ` Yao Qi
2015-11-26 16:23         ` Pedro Alves
2015-11-27  9:33           ` Yao Qi
2015-10-14 15:33 ` [PATCH 05/18] remote: stop reason and watchpoint data address per thread Pedro Alves
2015-10-14 15:33 ` [PATCH 10/18] Remote thread create/exit events Pedro Alves
2015-10-14 16:35   ` Eli Zaretskii
2015-10-26 16:50   ` Yao Qi
2015-11-23 15:41     ` Pedro Alves
2015-12-01 15:12   ` Ulrich Weigand
2015-12-01 16:06     ` Pedro Alves
2015-12-01 17:10       ` Ulrich Weigand
2015-10-14 15:36 ` [PATCH 11/18] gdbserver: fix killed-outside.exp Pedro Alves
2015-10-27 12:02   ` Yao Qi
2015-11-25 15:06     ` Pedro Alves
2015-11-26 16:51       ` Yao Qi
2015-11-26 17:56         ` Pedro Alves
2015-10-14 15:36 ` [PATCH 17/18] gdbserver: don't exit until GDB disconnects Pedro Alves
2015-10-14 15:36 ` [PATCH 12/18] testsuite: Range stepping and non-stop mode Pedro Alves
2015-10-14 15:36 ` [PATCH 04/18] gdbserver crash running gdb.threads/non-ldr-exc-1.exp Pedro Alves
2015-10-26 13:54   ` Yao Qi
2015-11-24 16:34     ` Pedro Alves [this message]
2015-11-26 16:23       ` Yao Qi
2015-11-30 14:53         ` Pedro Alves
2015-10-14 15:36 ` [PATCH 06/18] New vCtrlC packet, non-stop mode equivalent of \003 Pedro Alves
2015-10-26 14:11   ` Yao Qi
2015-11-30 18:25     ` Pedro Alves
2015-10-14 15:36 ` [PATCH 14/18] Implement TARGET_WAITKIND_NO_RESUMED in the remote protocol Pedro Alves
2015-10-14 16:36   ` Eli Zaretskii
2015-10-19 16:21   ` Yao Qi
2015-10-19 16:48     ` Pedro Alves
2015-10-14 15:37 ` [PATCH 09/18] Make dprintf-non-stop.exp cope with remote testing Pedro Alves
2015-10-14 15:37 ` [PATCH 16/18] gdbserver/linux: Always wake up event loop after resume Pedro Alves
2015-10-26 17:28   ` Yao Qi
2015-11-25 15:31     ` Pedro Alves
2015-10-14 15:37 ` [PATCH 07/18] gdbserver crash if gdb attaches too fast Pedro Alves
2015-10-14 15:38 ` [PATCH 08/18] gdbserver resume_stop handling bug Pedro Alves
2015-10-14 16:37   ` Eli Zaretskii
2015-11-25 15:12     ` Pedro Alves
2015-11-25 17:53       ` Eli Zaretskii
2015-10-15 10:46 ` [PATCH 00/18] Remote all-stop on top of non-stop Pedro Alves
2015-10-16 16:47 ` Yao Qi
2015-10-19 11:48   ` Yao Qi
2015-10-19 15:28     ` Pedro Alves
2015-10-19 15:47       ` Yao Qi
2015-10-27 13:11 ` Yao Qi
2015-11-30 19:59   ` Pedro Alves

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=565491A1.8020408@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.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