public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dholmster at gmail dot com" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-14802-4717@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2012-11-04 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-04 12:48 dholmster at gmail dot com [this message]
2012-11-04 12:53 ` [Bug python/14802] " dholmster at gmail dot com
2012-11-04 13:08 ` dholmster at gmail dot com
2012-11-04 13:09 ` dholmster at gmail dot com
2012-11-05 19:36 ` cvs-commit at gcc dot gnu.org
2012-11-05 19:38 ` tromey at redhat dot com
2012-11-05 19:41 ` dholmster at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14802-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).