From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10436 invoked by alias); 30 May 2018 18:07:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10410 invoked by uid 89); 30 May 2018 18:07:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*rth, HX-Received:sk:f67-v6m X-HELO: mail-it0-f68.google.com Received: from mail-it0-f68.google.com (HELO mail-it0-f68.google.com) (209.85.214.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 May 2018 18:07:57 +0000 Received: by mail-it0-f68.google.com with SMTP id p3-v6so24300928itc.0 for ; Wed, 30 May 2018 11:07:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vwnc5O4XScbZZC15Qs1tnrMujz/JkKZ64XztqA64KQw=; b=ud+wH9zB6rzIpO/OX7HNYdLZUAE5Acv2sirD6fPjjmZ8/k3vXwCU89ZABv+Ig+YMSF +QwcLyejkzXeJOCuHj37aEck34/Bg7CIeUbvBpq6/CXbjLmdpYCfQvIupNc1ypcVA6EQ gMpKbCdeLAwZEs6P0o3EWUOiQobLXSXQ9qt3RFQ8+fhZwLtwT8XA1ou4BcO6j7ncq3Ox YwbRpCT8Noi86vzH5L85dO6dMxmz0DvQQepAkAGJcn40UPhYFBxlEkTCj4Y6j69BLWyS ZbVaO1zDu18+LfObrwYFtcjF29ESuCbClu+Fa0MCJgRSFUIF2foP6URX4igA2JCEwMKy 8D5A== X-Gm-Message-State: APt69E1Sh2zxbBKHjeNW3Gc06d9wrRVYpdOBgwSXszIqGuWbTVxsBbfr NYLozAvdyE2NUPNx6GANldeYTCwaSgPmgaZzyLs= X-Google-Smtp-Source: ADUXVKIPYpSfrV2OTJQBt7qx8lGEW4oXpCFKo/dUdA325zY4E4XwlU+8MO2g8/MmmeHr95odtAeEeJwfxKNtCr9aS98= X-Received: by 2002:a24:c546:: with SMTP id f67-v6mr2848273itg.118.1527703675377; Wed, 30 May 2018 11:07:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:b815:0:0:0:0:0 with HTTP; Wed, 30 May 2018 11:07:54 -0700 (PDT) In-Reply-To: <56293ba8-f95b-5da1-af14-7500a0f8f892@ericsson.com> References: <56293ba8-f95b-5da1-af14-7500a0f8f892@ericsson.com> From: Uros Bizjak Date: Wed, 30 May 2018 18:49:00 -0000 Message-ID: Subject: Re: [PATCH]: Fix PR19061, gdb hangs/spins-on-cpu when debugging any program on Alpha To: Simon Marchi Cc: gdb-patches@sourceware.org, Tobias Klausmann , rth@twiddle.net Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-05/txt/msg00796.txt.bz2 On Wed, May 30, 2018 at 4:53 PM, Simon Marchi wrote: > 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 >> Richard Henderson >> >> 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). Richard said that: The hardware does not, but the linux kernel pretends. IIRC the number of round-trips and flushes is supposed to be lower doing it from within the kernel. BR, Uros.