Discussion:
[Bug python/19399] New: add a way to get inferior's architecture
tromey at sourceware dot org
2015-12-23 19:16:47 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19399

Bug ID: 19399
Summary: add a way to get inferior's architecture
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---

I'm writing an unwinder in Python.

I'd like to be able to instantiate an arch-specific unwinder class when
doing an unwind. However, it is difficult to find the correct "current"
architecture to use.

It's not possible to use gdb.Frame.architecture(), because that requires
a frame -- but this is happening during unwinding.

The simplest thing for me would be if gdb.Inferior also had an architecture()
method. This could return the inferior's gdbarch.


Meanwhile I'm not sure what workaround I can use.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-15 18:05:59 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19399

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at sourceware dot org |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-10-07 05:22:50 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19399

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=add5ded5e476918ef8b05823801531de2f51fa9c

commit add5ded5e476918ef8b05823801531de2f51fa9c
Author: Tom Tromey <***@tromey.com>
Date: Sat Oct 6 22:57:19 2018 -0600

Add Inferior.architecture method

I've written a couple of gdb unwinders in Python, and while doing so,
I wanted to find the architecture of the inferior. (In an unwinder in
particular, one can't use the frame's architecture, because there is
no frame.)

This patch adds Inferior.architecture to allow this. Normally I think
I would have chosen an attribute and not a method here, but seeing
that Frame.architecture is a method, I chose a method as well, for
consistency.

gdb/ChangeLog
2018-10-06 Tom Tromey <***@tromey.com>

PR python/19399:
* python/py-inferior.c: Add "architecture" entry.
(infpy_architecture): New function.

gdb/doc/ChangeLog
2018-10-06 Tom Tromey <***@tromey.com>

PR python/19399:
* python.texi (Inferiors In Python): Document
Inferior.Architecture.

gdb/testsuite/ChangeLog
2018-10-06 Tom Tromey <***@tromey.com>

PR python/19399:
* gdb.python/py-inferior.exp: Add architecture test.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-10-07 05:34:02 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=19399

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |8.3

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...