From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38713 invoked by alias); 9 Apr 2015 09:26:32 -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 38698 invoked by uid 89); 9 Apr 2015 09:26:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 09 Apr 2015 09:26:31 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t399QSMl007848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 9 Apr 2015 05:26:28 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t399QRkE020638; Thu, 9 Apr 2015 05:26:27 -0400 Message-ID: <552645C2.6080004@redhat.com> Date: Thu, 09 Apr 2015 09:26:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] gdbserver gnu/linux: stepping over breakpoint References: <1428569112-18004-1-git-send-email-qiyaoltc@gmail.com> In-Reply-To: <1428569112-18004-1-git-send-email-qiyaoltc@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00320.txt.bz2 On 04/09/2015 09:45 AM, Yao Qi wrote: > From: Yao Qi > > Hi, > I see the following error on arm linux gdbserver, > > continue^M > Continuing.^M > ../../../binutils-gdb/gdb/gdbserver/linux-arm-low.c:458: A problem internal to GDBserver has been detected.^M > raw_bkpt_type_to_arm_hwbp_type: unhandled raw type^M > Remote connection closed^M > (gdb) FAIL: gdb.base/cond-eval-mode.exp: hbreak: continue > > After we make GDBserver handling Zx/zx packet idempotent, > > [PATCH 3/3] [GDBserver] Make Zx/zx packet handling idempotent. > https://sourceware.org/ml/gdb-patches/2014-04/msg00480.html > >> Now removal/insertion of all kinds of breakpoints/watchpoints, either >> internal, or from GDB, always go through the target methods. > > GDBserver handles all kinds of breakpoints/watchpoints through target > methods. However, some target backends, such as arm, don't support Z0 > packet but need software breakpoint to do breakpoint stepping over in > linux-low.c:start_step_over, > > if (can_hardware_single_step ()) > { > step = 1; > } > else > { > CORE_ADDR raddr = (*the_low_target.breakpoint_reinsert_addr) (); > set_reinsert_breakpoint (raddr); > step = 0; > } > > a software breakpoint is requested to the backend, and the error is > triggered. This problem should affect targets having > breakpoint_reinsert_addr hooked. BTW, I think the patch is OK on its own right, as it would be needed to step over thread event breakpoints on older kernels (that's all breakpoint_reinsert_addr handles, see comment above start_step_over), but gdbserver shouldn't be using those event breakpoints nowadays (thread_db_use_events ends up false), so it's surprising that that's even reached. The test isn't even threaded. It sounds like gdbserver is trying to step over the breakpoint at "foo"? Didn't gdb itself step over it? How come that was reached in gdbserver? Did we mishandle the breakpoint's reference count in gdbserver? Thanks, Pedro Alves