This is the mail archive of the gdb-prs@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]

[Bug python/11777] Strange behaviour of gdb.Type.fields


------- Additional Comments From andre dot poenitz at nokia dot com  2010-07-01 09:13 -------

To reproduce without Qt:


------------------------- snip ------------------------
mkdir x && cd x


echo -e "struct P { P(); int a, b, c, d; }; " > p.h
echo -e "#include \"p.h\"\n P::P() {} " > p.cpp
echo -e "class P; struct X { X(); P *p; };" > x.h
echo -e " #include \"x.h\"\n X::X() {} " > x.cpp
echo -e "#include \"x.h\"\n int main() { X x; }" > main.cpp

g++ -g -shared -o libxp.so x.cpp p.cpp
g++ -g -o x -L. -lxp main.cpp -Wl,-rpath,`pwd`

gdb -ex "b main" -ex "run" -ex "python import gdb" \
    -ex 'set confirm off' \
    -ex 'python print gdb.parse_and_eval("x")["p"].dereference().type.fields()' \
    -ex 'python print
gdb.lookup_type(str(gdb.parse_and_eval("x")["p"].dereference().type)).fields()' \
    -ex q \
    ./x
------------------------- snip ------------------------


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11777

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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