This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: Pedro Alves <palves at redhat dot com>, Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org, Alan Modra <amodra at gmail dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Eli Zaretskii <eliz at gnu dot org>, Nick Clifton <nickc at redhat dot com>, binutils <binutils at sourceware dot org>
- Date: Mon, 13 Feb 2017 11:32:29 -0600
- Subject: Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
On 2/13/17 10:58 AM, Pedro Alves wrote:
On 02/13/2017 03:52 PM, Yao Qi wrote:
These options should be modeled as per-architecture data. We need to
define a key to access that data dynamically. grep
"static struct gdbarch_data *" in *.c.
If I understand the suggestion correctly, that would make all the different
POWER (etc.) gdbarch instances have their own instance of the option string.
I.e., the POWER gdbarch instance determined for the objfile before the program
is run or GDB connects to a target would have a different set of options than
the gdbarch instance created based on the POWER-based XML target description
returned by the (e.g.), remote server, because those are different
gdbarch object instances. As a result "set disassembler-options" would
show different options before and after run/connection (and in other
situations that use different gdbarch objects).
What Alan's implementation achieves instead is that there's only one option
value string for the whole family of gdbarchs of a given architecture, like
POWER vs MIPS, vs x86, etc, so that the disassembler options active persist
across internal uses of all the different gdbarch instances that
model variants of the same CPU architecture.
s/Alan's/Peter's/. :-) Thank you for explaining what Yao's suggestion
would do. As a user, I'd much prefer setting a disassembler option
(per arch) and having that be used for all of my disassemble commands,
versus to having to set it for each gdbarch instance. I think that
would also fall under the principle of least surprise rule too.