This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Add gdb.current_arch() function to python module -- equivalent of guile (current-arch)
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Matthew Malcomson <hardenedapple at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 8 Feb 2017 22:15:42 +0000
- Subject: Re: [PATCH] Add gdb.current_arch() function to python module -- equivalent of guile (current-arch)
- Authentication-results: sourceware.org; auth=none
- References: <ac00f967-3a7d-bd6a-88de-bcb98ff357ca@gmail.com> <CAH=s-PMKXc_yN=vmpWzHAsZeDOaifSqzcsZVONcNQz1HG-fk5w@mail.gmail.com> <bc7e5720-6639-e588-a831-17233a9bc0a3@gmail.com>
On Wed, Feb 8, 2017 at 5:46 PM, Matthew Malcomson
<hardenedapple@gmail.com> wrote:
> The problem is that without this patch I can't get an Architecture object
> without first having a Frame object, and I can't get a Frame object without
> starting my target program.
>
> Adding a gdb.current_arch() function is in order to get the Architecture
> object I need without starting the target program.
>
IMO, "current" arch is unclear as an extension language interface. Yes, we
do have function get_current_arch, but it is just a c function, we are free to
change it in the future.
It would be better to add function Inferior.architecture. I don't have much
GDB python expertise, so I'd like to hear what other people think.
--
Yao (齐尧)