Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, Richard Henderson <rth@redhat.com>,
		Tobias Klausmann <klausman@schwarzvogel.de>
Subject: Re: [PATCH]: Fix PR19061, gdb hangs/spins-on-cpu when debugging any program on Alpha
Date: Sun, 17 Dec 2017 18:11:00 -0000	[thread overview]
Message-ID: <CAFULd4Z7z2cJESMErDhVX5RfKdmu6iBmrLi=MFEHRxdOy=da7Q@mail.gmail.com> (raw)
In-Reply-To: <f6cb9189-d2c5-7007-bc2d-d42d67b43650@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

On Fri, Dec 15, 2017 at 7:21 PM, Pedro Alves <palves@redhat.com> wrote:
> On 12/15/2017 12:11 PM, Uros Bizjak wrote:
>>
>> Please note that I have no commit access, so if approved, please
>> commit the patch to the source repository for me.
>
> Merged.

Thanks!

Attached, please find a patch for gdb-8.0 branch. The patch is tested
in the same way as the patch for mainline, with native
alphaev68-linux-gnu build and tests and with gcc's guality.exp and
simulate-thread.exp testcases.

Uros.

[-- Attachment #2: gdb.diff.txt --]
[-- Type: text/plain, Size: 1549 bytes --]

--- alpha-tdep.c	2017-12-14 15:56:48.955960647 +0100
+++ alpha-tdep.c.ub	2017-12-14 15:56:33.751806965 +0100
@@ -766,10 +766,8 @@
    the sequence.  */
 
 static VEC (CORE_ADDR) *
-alpha_deal_with_atomic_sequence (struct regcache *regcache)
+alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  CORE_ADDR pc = regcache_read_pc (regcache);
   CORE_ADDR breaks[2] = {-1, -1};
   CORE_ADDR loc = pc;
   CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence.  */
@@ -1721,12 +1719,17 @@
 alpha_software_single_step (struct regcache *regcache)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  CORE_ADDR pc;
-  VEC (CORE_ADDR) *next_pcs = NULL;
+  CORE_ADDR pc, next_pc;
+  VEC (CORE_ADDR) *next_pcs;
 
   pc = regcache_read_pc (regcache);
+  next_pcs = alpha_deal_with_atomic_sequence (gdbarch, pc);
+  if (next_pcs != NULL)
+    return next_pcs;
+
+  next_pc = alpha_next_pc (regcache, pc);
 
-  VEC_safe_push (CORE_ADDR, next_pcs, alpha_next_pc (regcache, pc));
+  VEC_safe_push (CORE_ADDR, next_pcs, next_pc);
   return next_pcs;
 }
 
@@ -1826,7 +1829,7 @@
   set_gdbarch_cannot_step_breakpoint (gdbarch, 1);
 
   /* Handles single stepping of atomic sequences.  */
-  set_gdbarch_software_single_step (gdbarch, alpha_deal_with_atomic_sequence);
+  set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
 
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);

  reply	other threads:[~2017-12-17 18:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 12:11 Uros Bizjak
2017-12-15 18:21 ` Pedro Alves
2017-12-17 18:11   ` Uros Bizjak [this message]
2017-12-17 19:14     ` Uros Bizjak
2018-01-03 16:02       ` Pedro Alves
2018-05-30 18:07 ` Simon Marchi
2018-05-30 18:49   ` Uros Bizjak
2018-05-30 19:04     ` Simon Marchi
2018-05-31 11:10   ` Uros Bizjak
2018-05-31 14:55     ` Simon Marchi
2018-05-31 16:18       ` Simon Marchi

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='CAFULd4Z7z2cJESMErDhVX5RfKdmu6iBmrLi=MFEHRxdOy=da7Q@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=klausman@schwarzvogel.de \
    --cc=palves@redhat.com \
    --cc=rth@redhat.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