From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24378 invoked by alias); 17 Apr 2013 09:36:18 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 24369 invoked by uid 89); 17 Apr 2013 09:36:17 -0000 X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_QE,TW_XC autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 17 Apr 2013 09:36:12 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3H9aAcB014985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Apr 2013 05:36:10 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3H9a8mj016993; Wed, 17 Apr 2013 05:36:09 -0400 Message-ID: <516E6D08.2030409@redhat.com> Date: Wed, 17 Apr 2013 09:36:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Kent Tong CC: gdb@sourceware.org Subject: Re: Fwd: disabling NMI rendering breakpoints non-functional? References: <516C10D3.3020304@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-04/txt/msg00047.txt.bz2 On 04/16/2013 03:09 AM, Kent Tong wrote: >> GDB has no clue of NMI, it just tells the target to set a breakpoint at >> some address, or to single-step. How qemu implements those things >> behind the scenes is up to qemu. > > Thanks for the reply! I also figured that. But does the breakpoint if it is > set to a memory address whose content will be overwritten (e.g., loading > instructions into there)? In the past it worked, but now somehow it has > stopped working. Depends on how qemu implements breakpoints. By default, if the target doesn't support z0 remote protocol packets, then GDB fallsback to implementing breakpoints by planting architecture-defined breakpoint instructions (on x86 that's trap3/0xcc), and then handling the resulting trap. Naturally it won't work if the instruction is overwritten. The emulator is free to implement the z0/Z0 packets to handle setting breakpoints itself as it sees fit. It could still be by planting 0xcc instructions or by watching the address that is about to be executed, or through whatever other means it comes up with to make that scenario work. GDB doesn't care. -- Pedro Alves