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/14802] New: Declaring a convenience function usingPython does not work as documented


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.


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