This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

identify static fields with the python api


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]