public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Uros Bizjak <ubizjak@gmail.com>, <gdb-patches@sourceware.org>
Cc: 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: Wed, 30 May 2018 18:07:00 -0000	[thread overview]
Message-ID: <56293ba8-f95b-5da1-af14-7500a0f8f892@ericsson.com> (raw)
In-Reply-To: <CAFULd4ZGUgGneAb9m_Z=9HeKjjcXpv4mtp=uWbf98-XH43ptxA@mail.gmail.com>

On 2017-12-15 07:11 AM, Uros Bizjak wrote:
> Hello!
> 
> Attached patch fixes PR19061, where gdb hangs/spins-on-cpu when
> debugging any program on Alpha. The patch is effectively a forward
> port of Richard's patch from the Comment #5 of the PR [1].
> 
> 
> 2017-12-15  Uros Bizjak  <ubizjak@gmail.com>
>         Richard Henderson  <rth@redhat.com>
> 
>     PR gdb/19061
>     * alpha-tdep.c (alpha_software_single_step): Call
>     alpha_deal_with_atomic_sequence here.
>     (set_gdbarch_software_single_step): Set to alpha_software_single_step.
>     * nat/linux-ptrace.h [__alpha__]: Define GDB_ARCH_IS_TRAP_BRKPT
>     and GDB_ARCH_IS_TRAP_HWBKPT.
> 
> Patch was tested on alphaev68-linux-gnu, also tested with gcc's
> testsuite, where it fixed all hangs in guality.exp and
> simulate-thread.exp testcases.
> 
> Please note that I have no commit access, so if approved, please
> commit the patch to the source repository for me. I also have
> functionally equivalent patch for gdb-8 branch which I plan to submit
> later.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=19061#c5
> 
> Uros.
> 

Hi Uros and Richard,

I would need your input.  Using this cross-compiler:

alphaev67-unknown-linux-gnu-gcc (crosstool-NG crosstool-ng-1.22.0-677-ga3dd55b9) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I get this error:

  CXX    linux-nat.o
/home/simark/src/binutils-gdb/gdb/linux-nat.c: In function 'void save_stop_reason(lwp_info*)':
/home/simark/src/binutils-gdb/gdb/linux-nat.c:2718:9: error: duplicated 'if' condition [-Werror=duplicated-cond]
    else if (GDB_ARCH_IS_TRAP_HWBKPT (siginfo.si_code))
         ^~
In file included from /home/simark/src/binutils-gdb/gdb/linux-nat.c:31:0:
/home/simark/src/binutils-gdb/gdb/nat/linux-ptrace.h:173:41: note: previously used here
 # define GDB_ARCH_IS_TRAP_BRKPT(X) ((X) == TRAP_BRKPT)
                                    ~~~~~^~~~~~~~~~~~~~
/home/simark/src/binutils-gdb/gdb/linux-nat.c:2709:13: note: in expansion of macro 'GDB_ARCH_IS_TRAP_BRKPT'
    else if (GDB_ARCH_IS_TRAP_BRKPT (siginfo.si_code))
             ^~~~~~~~~~~~~~~~~~~~~~

Does Alpha even have hardware breakpoints?  If not, I would suggest
defining GDB_ARCH_IS_TRAP_HWBKPT to 0 for __alpha__.  It would get
rid of the error, and be more exact (no si_code can mean "hardware
breakpoint" on alpha).

Simon

  parent reply	other threads:[~2018-05-30 14:54 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
2017-12-17 19:14     ` Uros Bizjak
2018-01-03 16:02       ` Pedro Alves
2018-05-30 18:07 ` Simon Marchi [this message]
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=56293ba8-f95b-5da1-af14-7500a0f8f892@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=klausman@schwarzvogel.de \
    --cc=rth@redhat.com \
    --cc=ubizjak@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).