From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26237 invoked by alias); 4 Nov 2012 12:48:22 -0000 Received: (qmail 26217 invoked by uid 48); 4 Nov 2012 12:48:21 -0000 From: "dholmster at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/14802] New: Declaring a convenience function using Python does not work as documented Date: Sun, 04 Nov 2012 12:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: dholmster at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2012-q4/txt/msg00175.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14802 Bug #: 14802 Summary: Declaring a convenience function using Python does not work as documented Product: gdb Version: 7.4 Status: NEW Severity: critical Priority: P2 Component: python AssignedTo: unassigned@sourceware.org ReportedBy: dholmster@gmail.com Classification: Unclassified I have tried to declare a convenience function as described in the documentation [1] but I am unable to call the new function afterwards. This has been tried using GDB 7.5 on Gentoo GNU/Linux as well as GDB 7.5 on MacOS X (installed via Homebrew) with the same result. Here is the result when running the example from the documentation: (gdb) python >import gdb >class Greet(gdb.Function): > def __init__(self): > super(Greet, self).__init__('greet') > > def invoke(self, name): > return 'Hello %s' % name.string() > >Greet () >end (gdb) greet test Undefined command: "greet". Try "help". (gdb) greet Undefined command: "greet". Try "help". gdb.Command and gdb.Parameter both work as expected in the two GDB installations that I tried gdb.Function in. GDB 7.5 on OSX: $ uname -a Darwin moonglow.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 $ gcc -v Using built-in specs. Target: i686-apple-darwin11 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) $ gdb GNU gdb (GDB) 7.5 [..] This GDB was configured as "x86_64-apple-darwin12.1.0". GDB 7.5 on Gentoo: $ uname -a Linux moonglow-gentoo 3.5.2-gentoo #3 SMP PREEMPT Sat Aug 25 07:32:50 CEST 2012 x86_64 Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz GenuineIntel GNU/Linux $ gcc -v Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-cloog --disable-ppl-version-check --with-cloog-include=/usr/include/cloog-ppl --enable-lto --disable-nls --with-system-zlib --enable-obsolete --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.6.3/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.6.3 p1.6, pie-0.5.2' Thread model: posix gcc version 4.6.3 (Gentoo 4.6.3 p1.6, pie-0.5.2) $ gdb GNU gdb (Gentoo 7.5 p1) 7.5 [..] This GDB was configured as "x86_64-pc-linux-gnu". [1] http://sourceware.org/gdb/current/onlinedocs/gdb/Functions-In-Python.html#Functions-In-Python -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.