public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: ppluzhnikov@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-python: 2008-11-07 Paul Pluzhnikov <ppluzhnikov@google.com> Date: Fri, 07 Nov 2008 18:03:00 -0000 [thread overview] Message-ID: <20081107180328.15972.qmail@sourceware.org> (raw) The branch, archer-tromey-python has been updated via fec9620d4ece0e275113b47f9923876acfc7604f (commit) from 1e9b69a0f9de79f42992b4d7be1d70968d9af35f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit fec9620d4ece0e275113b47f9923876acfc7604f Author: Paul Pluzhnikov <ppluzhnikov@google.com> Date: Fri Nov 7 10:02:30 2008 -0800 2008-11-07 Paul Pluzhnikov <ppluzhnikov@google.com> * gdb.python/python-template.exp, gdb.python/python-template.cc: New test for const, volatile qualified pointer and reference template args. ----------------------------------------------------------------------- Summary of changes: gdb/testsuite/gdb.python/python-template.cc | 30 ++++++++++ gdb/testsuite/gdb.python/python-template.exp | 75 ++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 0 deletions(-) create mode 100644 gdb/testsuite/gdb.python/python-template.cc create mode 100644 gdb/testsuite/gdb.python/python-template.exp First 500 lines of diff: diff --git a/gdb/testsuite/gdb.python/python-template.cc b/gdb/testsuite/gdb.python/python-template.cc new file mode 100644 index 0000000..bd6a212 --- /dev/null +++ b/gdb/testsuite/gdb.python/python-template.cc @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +template <typename T> +struct Foo { +}; + +#ifndef TYPE +#define TYPE int +#endif + +int main() +{ + Foo<TYPE> foo; + return 0; // break here +} diff --git a/gdb/testsuite/gdb.python/python-template.exp b/gdb/testsuite/gdb.python/python-template.exp new file mode 100644 index 0000000..c2dacfc --- /dev/null +++ b/gdb/testsuite/gdb.python/python-template.exp @@ -0,0 +1,75 @@ +# Copyright (C) 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# This file is part of the GDB testsuite. It tests the mechanism +# exposing values to Python. + +if $tracelevel then { + strace $tracelevel +} + +set testfile "python-template" +set srcfile ${testfile}.cc +set binfile ${objdir}/${subdir}/${testfile} +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ + {debug c++}] != "" } { + untested "Couldn't compile ${srcfile}" + return -1 +} + +# Start with a fresh gdb. + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir + +gdb_test_multiple "python print 23" "verify python support" { + -re "not supported.*$gdb_prompt $" { + unsupported "python support is disabled" + return -1 + } + -re "$gdb_prompt $" {} +} + +proc test_template_arg {type} { + global testfile srcdir subdir srcfile binfile + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ + executable \ + [list debug c++ additional_flags="-DTYPE=$type"]] != "" } { + untested $type + return -1 + } + gdb_load ${binfile} + if ![runto_main ] then { + perror "couldn't run to breakpoint" + return + } + # There is no executable code in main(), so we are where we want to be + gdb_test "print foo" "" + gdb_test "python foo = gdb.get_value_from_history(0)" "" + + # Replace '*' with '\*' in regex. + regsub -all {\*} $type {\*} t + gdb_test "python print foo.type().template_argument(0)" $t +} + +test_template_arg "const int" +test_template_arg "volatile int" +test_template_arg "const int &" +test_template_arg "volatile int &" +test_template_arg "volatile int * const" +test_template_arg "volatile int * const *" +test_template_arg "const int * volatile" +test_template_arg "const int * volatile * const * volatile *" hooks/post-receive -- Repository for Project Archer.
next reply other threads:[~2008-11-07 18:03 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-11-07 18:03 ppluzhnikov [this message] 2008-11-07 21:07 ppluzhnikov 2008-11-08 0:41 ppluzhnikov
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=20081107180328.15972.qmail@sourceware.org \ --to=ppluzhnikov@sourceware.org \ --cc=archer-commits@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: linkBe 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).