From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 2/2] gdb: Simplify variable set hooks
Date: Mon, 14 Nov 2016 08:35:00 -0000 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B23400000CE@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <1478888325-32039-3-git-send-email-andrew.burgess@embecosm.com>
> -----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 <andrew.burgess@embecosm.com>
> 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.
>
> gdb/ChangeLog:
>
> * 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.
>
> gdb/testsuite/ChangeLog:
>
> * 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
next prev parent reply other threads:[~2016-11-14 8:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-11 18:19 [PATCH 0/2] Auto roll back on error while changing a setting Andrew Burgess
2016-11-11 18:19 ` [PATCH 2/2] gdb: Simplify variable set hooks Andrew Burgess
2016-11-12 0:29 ` Luis Machado
2016-11-14 8:35 ` Metzger, Markus T [this message]
2016-11-24 23:57 ` Pedro Alves
2016-11-11 18:19 ` [PATCH 1/2] gdb: Restore a settings previous value on error during change Andrew Burgess
2016-11-12 0:20 ` Luis Machado
2016-11-15 23:02 ` Andrew Burgess
2016-11-16 14:18 ` Luis Machado
2016-11-16 18:02 ` Andrew Burgess
2016-11-16 18:15 ` Luis Machado
2016-11-24 23:52 ` Pedro Alves
2016-12-29 14:42 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A78C989F6D9628469189715575E55B23400000CE@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox