From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108159 invoked by alias); 17 Feb 2017 01:42:16 -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 108126 invoked by uid 89); 17 Feb 2017 01:42:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.3.2 spammy=refuse, Tremblay, tremblay, HX-AuditID:sk:c1b4fb3 X-HELO: sesbmg22.ericsson.net Received: from sesbmg22.ericsson.net (HELO sesbmg22.ericsson.net) (193.180.251.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Feb 2017 01:42:03 +0000 Received: from ESESSHC024.ericsson.se (Unknown_Domain [153.88.183.90]) by (Symantec Mail Security) with SMTP id 36.43.11383.8E456A85; Fri, 17 Feb 2017 02:42:01 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.90) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 17 Feb 2017 02:42:00 +0100 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=antoine.tremblay@ericsson.com; Received: from elxa4wqvvz1 (67.71.111.110) by VI1PR0701MB1888.eurprd07.prod.outlook.com (10.167.197.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.10; Fri, 17 Feb 2017 01:41:57 +0000 References: <20161129120702.9490-1-antoine.tremblay@ericsson.com> <20170127150139.GB24676@E107787-LIN> <2255ed6f-a146-026c-f871-00e9a33dfcf0@redhat.com> User-agent: mu4e 0.9.19; emacs 25.1.1 From: Antoine Tremblay To: Pedro Alves CC: Antoine Tremblay , Yao Qi , "gdb-patches@sourceware.org" Subject: Re: [PATCH 1/2] This patch fixes GDBServer's run control for single stepping In-Reply-To: <2255ed6f-a146-026c-f871-00e9a33dfcf0@redhat.com> Date: Fri, 17 Feb 2017 01:42:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: DM5PR06CA0032.namprd06.prod.outlook.com (10.168.181.18) To VI1PR0701MB1888.eurprd07.prod.outlook.com (10.167.197.24) X-MS-Office365-Filtering-Correlation-Id: 0cea9944-64cf-475e-a428-08d456d629a6 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0701MB1888; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0701MB1888;3:TYysyoe5OpDSh8qBe3rGpYBBvB+Q4I4rXF5thN0fMYKoMC2LmnrQGwKPjw6O052D2H4UrUOJpAxdfGRzKOBVFItfRNNsUvhs4Ti6fvRFgVixyPICbQKzignDY7GyCvVpRPwNuu6GUoybf7HrJVoV+aour3HqM57Uk2uGn9vWN+EMYQFRoLGewusOJJiMxv5+H64yFa4F7I/9P8zwwnlDz62AJCZ2C01Nm1iDh1p/8i6BxDPMY6Zhd7gmlg6/0GMdVeqcr0QKAQxYk/zcNffhpA==;25:LK0ti2rwYl+ey+0BaHjRofodQYXJQqI0AsfSQ0CSZmIKopgLWIEAyzUjnLXFkya6W0Cw9qT7JASBNoNneMOsuGL5Zth4FK9lp44g9nsaQEPY/UBn78bTdzGNrJ2r5uik+iNlsj6SG5DaOyB2JXpSNRavZrBt2qIv/7W38Ud1BsxLEqeKS7TUjQxNIYW1m+KOCTOndqyGOsAUWMTOVNi6hbos/MHC5zntaJgwXQSQJMNglD/MMyQ0JS6jsLUSakWMgNrDaph9HgQy816n/gWi1K8/b3mgMdA0OHIOOoUzQNht2MfX++A4Ed+yKjEyPqxG/eX3cyGDDpBvSXrMP2ALSNMGoGmgBbKRheBpT/KpEhNN4PUBWRqkc9syFDrLfNGETMJyhQFbXl1pvVcW2Xkx9nFL577sFC/mzXNYcOY8krh3sJu5/4xVLQuVOCYRu+kLKrvWwe1Uj8B/TCDV3PCUAA== X-Microsoft-Exchange-Diagnostics: 1;VI1PR0701MB1888;31:os6TBLsy1ymwQMeSvwxJ4TcaufT593y3UqN6709osCbFSzjdQ/TNOWzntRnb84T/KH8aw6lHvidjaRY5zVsM7DYt88uC5+JhHTKszXjR7LO6wD4XOanjoB2d3Iqbs5nLQDTlN18toSB6J4Ls34WVPg/brWwcOrYSlBNAdwsCM2y8hfq2nizyyssggrtMRLWtycLIHRpGB5boMlSlt0TbJNMPXC9YF1ViUHjXDUkRPCQ=;20:JYV9w1QU5sOcA+gQVDOcePI42N7a1R6FJ0YBBJuRIbdFgKmrks04mwum/EfbTr8h5Xbvh+574+rr5UYD9PAkFrJcxQW/iTsjn2pvWA7NB+6VHcIRPQXP7T9MqdRTbmfmAnWg7SXVhUS4Fk4naUifWfP2+VxlrcTnvQft8F13ohE2FFvqAJ1cBUi/h64EZCsQpCApKybzgSkitxn+rG5XtIQkIbpCDX37d8ykGqPa9HdF4BzY0EPiZyy3ZFgKtm7BR9+z0cc5YRYvfI1jAReFOkMGrquVtBooziIoqJjp39PmD0yo9URTsquzvgVxrvRLPxwsvV8czcq1C/RxGVW9RMwQxIRrww3d2+BfFBLWm49L6IPZcFjA8T6kONZyHOBBHWIQuGg2aoqtMaQZtHL3VqBzxkofcsP7XBSMNv5pH3SLg0gN9BEGOfPKdmzkq03emlfnf8MqAxsfYV9ebjE9Ctrj1xSwl3mhnfcB0TQv3YxnheaPn0+WdFhT5bD0Skgp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123558025)(20161123564025)(20161123560025)(20161123562025)(6072148);SRVR:VI1PR0701MB1888;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0701MB1888; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0701MB1888;4:iKbjI8LJVTBDEu90uACSB1jVhnPN4yKYnaLPETiX3fjRxX8ZqT+55wmFOgFLc84K/LpaeiO+zA7l8qUoujb+mohqpEvquQAnaGxkqZtruXwplX8syETbfCV89o1UuFRMrHEZNkud0wRDyMVSxMOpMdU1196hvRfePH49+T03d5c8q4NZDPaFjXidnc1/7ARf0DPYZVlsWGJd+YTDXUGhHWJVmqd1azH1ralyIZEniJjC1MOTdukdUklM5Yo51E2dacSOHs674LS1Xt7+VXzXPfwtFvpHY4+0DMF28al8KPCZkl5Z0gKam1JtobaWPmxFTclbgNHaykVooqcDXLnXJ9mZYb7ttwBmjUZfp2vZ0UnoXU+GMIv504cJ/i2B1irLbybY2qscPBsaw43bnKTetFlqFEBe6T1vdsFJEXVyU4YD/oZ1IxaQNClOKv3q34Ta0CBGTqMabtsFlBqpcl7vwJ0PxqPTBbb2bsFKuRhkr8+anq9dkC7lleUKIcfdIptmNdkpWWLt+tmrVaGPa5UC+dmjKKbywC7eEl0y5qBSIY33O3AY34TUfp4UwxOUYxTykZRL0OpBv7EOhJya4nHD1CmJmpHei8/sX7J8BrVldp+ENOXghGHDeKEu0Imwa+B9pwBn5L83d+ssACTX31GtTQ== X-Forefront-PRVS: 02213C82F8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(189002)(51444003)(377454003)(199003)(24454002)(50466002)(48376002)(93886004)(92566002)(6246003)(38730400002)(42186005)(110136004)(2906002)(25786008)(6496005)(106356001)(105586002)(36756003)(4326007)(6486002)(229853002)(54356999)(50986999)(76176999)(54906002)(53936002)(47776003)(83506001)(6116002)(3846002)(189998001)(68736007)(97736004)(4001350100001)(81166006)(81156014)(8676002)(66066001)(2950100002)(6666003)(6916009)(5003940100001)(86362001)(33646002)(53546006)(7736002)(305945005)(389900003)(101416001)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0701MB1888;H:elxa4wqvvz1;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0701MB1888;23:od4KzGifoIn9SgOY7HMmzwOhzrBKGbsXmFS07n/?= =?us-ascii?Q?PZPXWRaycF58Wq1bl8B0fdXw1Bs9YV2O/KwOrXZ02I/HI8iFvChtXwkvaGMU?= =?us-ascii?Q?FJQkTEaxkcVh78+zYV/Jq33thh2BDZhOCAsZe6X0avkXPVLBXhvNLznLb+2P?= =?us-ascii?Q?j2Yzq+FSdY7BlpbEVc6EHLvtXe0QicC56orhHjr8YLAbr3aGeI4T5TBQrSi3?= =?us-ascii?Q?tvXvcI/JtZVMc4cQJw4c3PAvq6fgc8+HqUm0ipd2qjzB/uP8SW54ZDestccu?= =?us-ascii?Q?tZQi40w1wwPtQ2X1BOoycwiDQQcADdPBA7JUqkFyiNaUC8/Xi0dDyvDxJ06W?= =?us-ascii?Q?nNwh7hEgpelDXKKsrPTeJJEnAqLviwSQ7g0A1TNypLhSymAh8g+H1KkDm5GC?= =?us-ascii?Q?1qhejZCPZ8Bol7VEXrCoOgWQ2+PhPRppvU/chj+Q6SoClUNLltGigcN/Owsy?= =?us-ascii?Q?6rngmSp8V/NUgNLWC4dsi3rnIBa60rwQfQrQcHO1R3yAAsjEt0dtqSPV8Fny?= =?us-ascii?Q?7l+wpW5Bu3V6lRrHR+MIML0VMEFVXHsggMfFHQuX2Ho3eAqHVPhZ236o4o90?= =?us-ascii?Q?gJsDAxfbIj7kb6ZsJ5SiBjXbdt2GklAJrEyEI8sJtruKOMCwtL7IurMwmSJr?= =?us-ascii?Q?bux/Rn1pKaVg/hWc6TeuiHcO1qAoiKmg5yyrn24L1sDzUURwKVInQ8vEd1QH?= =?us-ascii?Q?QfqBfaBt6trzWGlYP33fM87w2nv5iLTFLNMfBI112NxRYF+EFEB19wt8Q2xx?= =?us-ascii?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aFRp9tjwMPFKrr4F1Fn4BpO2EoK58UG2d0XwMJdPBFtAVZ0UxARvmgVxXqPbmpKaxORw20Pi5rT3wFxDDA==;5:cRkGtR6LbojBMS7KhtewzfLmuYB68Z4d0gA//LFA0RCt0w9s+A4hz/dl67BBbHFX7hZ1ts2wrYFSM6kGa/YRv4p1M34586ApgWZ20qXpRNnPtX+h753xhGpcCDE4GJZJ/5Ne2o7WoX7pcbyoeers9w==;24:kN6YbzQa0llXqaxMXdRLUqC7hLETp7pP20Mr6KJSkf31lEpBdDJ4XuEzBGdOdvK2kj/jCvhhN1L63J198ZRr9jsqAKVTux/o09/ohqn5gmE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0701MB1888;7:i6z1kmBXrK3gU2v+xV9mQjBTHbHeENWteN1qCwpkCQCBidapPh4I4UqRbddmk0eP6PSnli2yramanWcDRhhwQL03WtyzpsMZ+uM8xPBm0/dBwq9NSi7aXPTe8aUHS5nMYHMCJU4sZqHUQABO+msGx7NcvtZS4DM+H6SCIsc69U9Sz70Vx3gWru1Dy7rQNXIEUIIkDPfukI+GBT7U6tVMWjeWJUFJcnql0VXWwPpaxXHU1MRP4KNuE9+td70JWqv0FOy/pqFAqH2i/UzWEytmfziJYyRPlhR/yF63yTlOAYZ5p2AFI8z54drBMh5jv4yzYlaPdhnk6Qtcj/zf2XxRjA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2017 01:41:57.7801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB1888 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00462.txt.bz2 Pedro Alves writes: > On 01/30/2017 01:28 PM, Antoine Tremblay wrote: > >>> We don't change anything when setting breakpoint inside IT block. >> >> Well that's a problem if we write a 32 bit thumb2 breakpoint aligned on >> 2 bytes like discussed before. > Sorry for the delay I just saw your mail... > Can we restrict the stopping-all-threads to the case that > needs it, only? Possibly but I would like to avoid introducing 2 execution paths in the run control, it's already hard to follow as it is and it would introduce a lot of code in the arch independant code just for this case, that's something I would like to avoid too. > > An optimization that would avoid this would be to use a > hardware watchpoint/breakpoint (if available) for single-stepping. > IIRC, you can ARM a breakpoint (or was it a watchpoint) on ARM for > triggering when the PC is different from the current PC (or really, > some specified address). I did not know that but I'm worried about the limited number of hardware watchpoints available. IIRC on my board I had only 4, if GDBServer can't find one available would it refuse to single step ? That would be weird... ? It's an interesting approch however I'll dig about it more. > > In IT blocks, this would probably make the thread stop on > instructions that aren't really executed (e.g., the then/else > branches when the condition is correspondingly false/true), Really ? I need to find something about that in the arch man... > unlike the current solution where breakpoint instructions are > not executed by the CPU when it falls on an instruction that > isn't executed (because the breakpoint opcode we use it just > some magic invalid instruction, node the BKPT instruction), but > I think that when the thread stops, and we're stepping an IT > block, we could look at the status registers and decide whether > to single-step again. > > TBC, I'm not suggesting that we need to do that right now. > > The emulation solution discussed on the lkml thread made > me thing of displaced stepping -- the ARM implementation > emulates some instructions. I wonder whether displaced > stepping over IT blocks is already handled correctly. > It does look like displaced stepping would be preferable to trying to emulate and validate that the emulation is correct. Simon and I are looking into displaced stepping but we've yet to have this discussion with Yao...