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]

Re: Modify address of a gdb.Value


>>>>> "Niko" == Niko Sams <niko.sams@gmail.com> writes:

Niko> I tried to implement this payload method in python
[...]
Niko> the obvious solution would be gdb.lookup_type('QMapPayloadNode<%s,
Niko> %s>' % (self.ktype, self.vtype)).sizeof
Niko> but that doesn't work, i get this error:
Niko> RuntimeError: No type named QMapPayloadNode<int, QString *>
Niko> This is because that QMapPayloadNode is not instanciated, it's only
Niko> used for this sizeof.

Niko> So any idea how i can compute the payload?

There's no easy way.  gdb only knows what the compiler tells it, and
in this case, the information is omitted.

You could try recreating the ABI struct layout rules in Python.
This is a pain but not insanely hard.

Tom


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