From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15993 invoked by alias); 6 Sep 2013 06:05:51 -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 15984 invoked by uid 89); 6 Sep 2013 06:05:51 -0000 Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Sep 2013 06:05:51 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED autolearn=ham version=3.3.2 X-HELO: mtaout22.012.net.il Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MSO00900WX5LY00@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Fri, 06 Sep 2013 09:05:48 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MSO0099YWXNFM60@a-mtaout22.012.net.il>; Fri, 06 Sep 2013 09:05:48 +0300 (IDT) Date: Fri, 06 Sep 2013 06:05:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 2/3] Trust readonly sections if target has memory protection In-reply-to: <1378432920-7731-3-git-send-email-yao@codesourcery.com> To: Yao Qi Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83siximqmk.fsf@gnu.org> References: <1378432920-7731-1-git-send-email-yao@codesourcery.com> <1378432920-7731-3-git-send-email-yao@codesourcery.com> X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00200.txt.bz2 > From: Yao Qi > Date: Fri, 6 Sep 2013 10:01:59 +0800 > > This patch first changes command "trust-readonly-sections" to an > auto_boolean command, so "auto" means that GDB trusts read-only > sections if the target has memory protection. Then, this patch adds a > gdbarch hook method "has_memory_protection". Patch 2/2 is to > implement the hook method for linux target. > > gdb: > > 2013-09-06 Yao Qi > > * arch-utils.c (default_has_memory_protection): New function. > * arch-utils.h (default_has_memory_protection): Declaration. > * gdbarch.sh (has_memory_protection): New hook method. > * gdbarch.c: Re-generated. > * gdbarch.h: Re-generated. > * target.c (trust_readonly): Change type to 'enum auto_boolean' > and initialize it to 'AUTO_BOOLEAN_AUTO'. > (trust_readonly_p): New function. > (memory_xfer_partial_1): Call trust_readonly_p. > (initialize_targets): Register command > "trust-readonly-sections" as add_setshow_auto_boolean_cmd. > > * NEWS: Describe the default option of > "trust-readonly-sections" becomes "auto" and the related > changes. > > gdb/doc: > > 2013-09-06 Yao Qi > > * gdb.texinfo (Files): Explain the default option of > "trust-readonly-sections" is "auto". Is it possible NOT to split documentation changes between changesets, when they are all parts of the same patch series? Reviewing changes piecemeal like that is extremely inconvenient and error-prone, especially since you never tell in the beginning that the documentation changes are split. TIA. > *** Changes since GDB 7.6 > > +* The default value of option "trust-readonly-sections" is "auto". GDB > + trusts the contents of read-only sections from the object file on the > + GNU/Linux targets. The second sentence is in contradiction with the first. "Auto" means GDB decides automatically whether to trust these section; it does not mean the decision is YES for GNU/Linux and NO otherwise. > +@item set trust-readonly-sections auto > +This is the default mode. Tell @value{GDBN} to trust read-only > +sections on some targets which have memory protection, such as > +GNU/Linux, because the contents of the section in the target program > +can't change. Again, no need to mention one platform here. Such references quickly become obsolete with time. > +When this mode is auto, memory reads from readonly sections will be\n\ > +read from the object file if the target has memory protection.\n"), I would suggest When this mode is auto, GDB will decide based on the target memory protection features whether to read readonly sections from object file instead of from the inferior's memory. IOW, "auto" means GDB will decide by its own internal logic. Thanks.