From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5898 invoked by alias); 10 Apr 2012 23:32:51 -0000 Received: (qmail 5887 invoked by uid 22791); 10 Apr 2012 23:32:49 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Apr 2012 23:32:31 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SHkY1-0002AE-Bu from Yao_Qi@mentor.com ; Tue, 10 Apr 2012 16:32:29 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 10 Apr 2012 16:32:14 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Tue, 10 Apr 2012 16:32:28 -0700 Message-ID: <4F84C2D7.1070203@codesourcery.com> Date: Tue, 10 Apr 2012 23:48:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Jan Kratochvil CC: Subject: Re: [patch] More suggestive displaced-stepping memory error message References: <20120410191955.GB31331@host2.jankratochvil.net> In-Reply-To: <20120410191955.GB31331@host2.jankratochvil.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2012-04/txt/msg00202.txt.bz2 On 04/11/2012 03:19 AM, Jan Kratochvil wrote: > - read_memory (copy, displaced->step_saved_copy, len); > + status = target_read_memory (copy, displaced->step_saved_copy, len); > + if (status != 0) > + throw_error (MEMORY_ERROR, > + _("Error accessing memory address %s (%s) for " > + "displaced-stepping buffer, you may want to temporarily " > + "turn it off if there is only one inferior thread."), The error message is not clear to me. Why "one inferior thread" matters here? If GDB is unable to do displaced-stepping due to unavailable scratch pad, user has no choice except disable displaced-stepping for a moment, and turn it on later. > + paddress (target_gdbarch, copy), safe_strerror (status)); ^^^^^^^^^^^^^^ why not `gdbarch'? Think a little more, is it a little over-strict and less user-friendly in this case? If I got such error message like "turn it off temporarily and turn it on later", I can turn displaced-stepping off, but I don't know when to turn it on again. Probably, GDB can be smart enough to not use displaced stepping when get error on accessing scratch pad. So far, displaced_step_prepare returns 1 for success and 0 for queued request. We can add one more return value -1 for `unable to do displaced stepping', so that caller can go non-displaced-stepping path. -- Yao (齐尧)