From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id EB5F4385DC00 for ; Sun, 31 May 2020 15:54:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EB5F4385DC00 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-240-FDcfZVSsMsSrrLTz4qYVoQ-1; Sun, 31 May 2020 11:54:19 -0400 X-MC-Unique: FDcfZVSsMsSrrLTz4qYVoQ-1 Received: by mail-wr1-f70.google.com with SMTP id e7so3104295wrp.14 for ; Sun, 31 May 2020 08:54:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=n6W3oEwKNnspjM6FIlXivdhlQ3BxhxQoGm1ZIM6e2Fw=; b=o0+PYfVpYFzsrpXmAApw5LSm//AaM8rQoKnoylafqtY2wp5/iB9RcKY0PGJauV0Dgz 1/4HzMC3qMZrDr+bj8+0Vym7lI3bKJ5nrrgtU2oUhebP54Na+amf+9z5dKa0N9IP9C03 +VRikOoKyo+fATr8gXHeQoc22/XqMAe7vxp3iARp8REX/mnfBv147t1DTmTBStv8x1yb lAvLgYfk5bIPidGNKN+44Gv3UeaWBv3sBsLtZ3VNtsNv0AGXnQFGcXWFCP3QA4DKfB1t /ft/bwLXI5HMIks8HK1itZAFOgrkh0grGzdkUgi02ZRu+vwB0NGHp0dHW1wN2DydrhoO 8u6g== X-Gm-Message-State: AOAM532KPTX0gcIJ1YJ+UDoX0kcWcHP88kLPREC3y7OCdsX5llBcbQWv QFg8IbqF/OMe8ePSh5ZPIKKkx5orOJslEidJn9iaG++8nwEOmSYA/4bwUMC/tPRiWOSpVttfIP7 n9n7T6mRPr2+oYvtPz/Wasg== X-Received: by 2002:adf:ea11:: with SMTP id q17mr17412005wrm.75.1590940457658; Sun, 31 May 2020 08:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5z1b+AQTddC0wnW1Ambb0nSIZMi/spvjSqlnYKhih9Td3MCCjbe78DMysATa34xo6mnSyfg== X-Received: by 2002:adf:ea11:: with SMTP id q17mr17411996wrm.75.1590940457429; Sun, 31 May 2020 08:54:17 -0700 (PDT) Received: from ?IPv6:2001:8a0:f909:7b00:56ee:75ff:fe8d:232b? ([2001:8a0:f909:7b00:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id k26sm9247697wmi.27.2020.05.31.08.54.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 May 2020 08:54:16 -0700 (PDT) Subject: Re: [PATCH 7/7] Reset Windows hardware breakpoints on executable's entry point To: Hannes Domani , Gdb-patches References: <20200525185659.59346-1-ssbssa@yahoo.de> <20200525185659.59346-8-ssbssa@yahoo.de> <8e076c81-6e92-930f-c16d-1db73bde8a83@redhat.com> <262511602.870722.1590593988931@mail.yahoo.com> From: Pedro Alves Message-ID: <033665b4-d036-83a6-2a31-88bccb802612@redhat.com> Date: Sun, 31 May 2020 16:54:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <262511602.870722.1590593988931@mail.yahoo.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2020 15:54:25 -0000 On 5/27/20 4:39 PM, Hannes Domani via Gdb-patches wrote: > Am Mittwoch, 27. Mai 2020, 16:48:16 MESZ hat Pedro Alves Folgendes geschrieben: >> The answer at , >> seems to confirm it: >> >>    "If you debugger sets some registry values right now, those changes would not >>      matter, because OS will override all register values while starting executing >>      process. " >> >> Interestingly, it also says: >> >>    "Workaround is simple -- first make a single step using t instruction, then you >>      can use hardware breakpoints as you like." >> >> Which makes it sounds like a single-step is all it takes to get to the entry point. >> That may make it easier to implement this inside do_initial_windows_stuff, >> including doing the same thing in gdbserver. > > I just tried: ... > So after a nexti the hardware breakpoint still didn't work, because at this > point it's far before the overwriting of the context. > OK, thanks for trying it out. > Or did you mean this different? No, I was misled by the comments in stackoverflow, which are clearly incorrect. Meanwhile I found this, which explains this mechanism in more detail: http://www.nynaeve.net/?p=81 > Anyways, since there is a simple workaround to make the hardware breakpoints > work (just use "start"), it doesn't matter much to me if this gets fixed. I think that it's nice to make this work transparently; I was just exploring the best way to do so. Let me take another look at the patch. Thanks, Pedro Alves