This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
identify static fields with the python api
- From: Paul Marquess <Paul dot Marquess at owmobility dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Mon, 30 Nov 2015 08:52:51 +0000
- Subject: identify static fields with the python api
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp dot mailfrom=Paul dot Marquess at owmobility dot com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
I trying to identify the static fields in a struct/class using the Python A= PI, but I don't see anything in the API that will flag them.
Can get everything else I need from the field as shown below
for field in sometype.fields():
n =3D field.name
t =3D field.type
s =3D t.sizeof
To work around the issue I've captured the output from "ptype" with a gdb.e= xecute and checked for the static fields there. Messy (and surprisingly slo= w for bigish classes) but it does seem to work.
Is there any other way to do this?
Paul