From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13849 invoked by alias); 14 Nov 2016 08:35:52 -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 13741 invoked by uid 89); 14 Nov 2016 08:35:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_20,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=U*owner, gdbpatchesownersourcewareorg, gdb-patches-owner@sourceware.org, U*gdb-patches-owner X-HELO: mga06.intel.com Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 08:35:41 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 14 Nov 2016 00:35:39 -0800 X-ExtLoop1: 1 Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2016 00:35:38 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.49]) by IRSMSX151.ger.corp.intel.com ([169.254.4.28]) with mapi id 14.03.0248.002; Mon, 14 Nov 2016 08:35:37 +0000 From: "Metzger, Markus T" To: Andrew Burgess , "gdb-patches@sourceware.org" Subject: RE: [PATCH 2/2] gdb: Simplify variable set hooks Date: Mon, 14 Nov 2016 08:35:00 -0000 Message-ID: References: <1478888325-32039-1-git-send-email-andrew.burgess@embecosm.com> <1478888325-32039-3-git-send-email-andrew.burgess@embecosm.com> In-Reply-To: <1478888325-32039-3-git-send-email-andrew.burgess@embecosm.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00334.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Andrew Burgess > Sent: Friday, November 11, 2016 7:19 PM > To: gdb-patches@sourceware.org > Cc: Andrew Burgess > Subject: [PATCH 2/2] gdb: Simplify variable set hooks Hi Andrew, > Now the the variable set-hook mechanism supports automatic rollback of > the variable value if the set-hook throws an error, simplify existing > cases where we manually performed roll-back within the set-hook. >=20 > gdb/ChangeLog: >=20 > * dcache.c (set_dcache_size): Don't change value on error path. > (set_dcache_line_size): Likewise. > * record.c (record_insn_history_size_setshow_var): Remove. > (record_call_history_size_setshow_var): Remove. > (validate_history_size): Simplify to just the error check. > (set_record_insn_history_size): Update call to > validate_history_size. > (set_record_call_history_size): Likewise. > (_initialize_record): Remove use of *_setshow_var. > * symtab.c (new_symbol_cache_size): Remove. > (symbol_cache_size): Update comment. > (set_symbol_cache_size_handler): Simplify error check. > (_initialize_symtab): Remove use of new_symbol_cache_size. > * valprint.c (input_radix_1): Remove. > (set_input_radix): Remove use of input_radix_1. > (set_input_radix_1): Likewise. > (output_radix_1): Remove. > (set_output_radix): Remove use of output_radix_1. > (set_output_radix_1): Likewise. > (_initialize_valprint): Remove use of output_radix_1 and > input_radix_1. > * value.c (set_max_value_size): Simplify error case. >=20 > gdb/testsuite/ChangeLog: >=20 > * gdb.base/max-value-size.exp: Update expected output. > --- > gdb/ChangeLog | 25 +++++++++++++++++++ > gdb/dcache.c | 12 +++------ > gdb/record.c | 41 ++++++-------------------= ------ > gdb/symtab.c | 23 ++++------------- > gdb/testsuite/ChangeLog | 4 +++ > gdb/testsuite/gdb.base/max-value-size.exp | 4 +-- > gdb/valprint.c | 31 ++++++----------------- > gdb/value.c | 6 +---- > 8 files changed, 56 insertions(+), 90 deletions(-) The record changes look good to me. Regarding the parent patch, if we passed the to-be-set value to the set function in addition to the pointer to the set/show variable, we could leave the actual assignment to the set function. We wouldn't need to take care of restoring the previous value in the caller since we have not updated it, yet. This might be simpler. Regards, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928