From: Maxim Bublis <satori@yandex-team.ru>
To: gdb-patches@sourceware.org
Cc: Maxim Bublis <satori@yandex-team.ru>
Subject: [PATCH 1/3] gdb/testsuite/gdb.python: Added testcase for .value() method
Date: Tue, 04 Mar 2014 10:37:00 -0000 [thread overview]
Message-ID: <1393929360-31299-2-git-send-email-satori@yandex-team.ru> (raw)
In-Reply-To: <1393929360-31299-1-git-send-email-satori@yandex-team.ru>
---
gdb/testsuite/ChangeLog | 6 ++++++
gdb/testsuite/gdb.python/py-symbol.c | 3 +++
gdb/testsuite/gdb.python/py-symbol.exp | 6 ++++++
3 files changed, 15 insertions(+)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 835338f..e0066fa 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2014-03-04 Maxim Bublis <satori@yandex-team.ru>
+
+ * gdb.python/py-symbol.c: Add label.
+ * gdb.python/py-symbol.exp: Test label object .value()
+ method call.
+
2014-02-26 Ludovic Courtès <ludo@gnu.org>
* gdb.guile/scm-value.exp (test_value_in_inferior): Add
diff --git a/gdb/testsuite/gdb.python/py-symbol.c b/gdb/testsuite/gdb.python/py-symbol.c
index 3201365..746a370 100644
--- a/gdb/testsuite/gdb.python/py-symbol.c
+++ b/gdb/testsuite/gdb.python/py-symbol.c
@@ -40,6 +40,9 @@ int func (int arg)
{
int i = 2;
i = i * arg; /* Block break here. */
+
+some_label:
+
return arg;
}
diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index 9b6ba2e..cace689 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -81,6 +81,12 @@ gdb_test "python print (func.print_name)" "func" "Test func.print_name"
gdb_test "python print (func.linkage_name)" "func" "Test func.linkage_name"
gdb_test "python print (func.addr_class == gdb.SYMBOL_LOC_BLOCK)" "True" "Test func.addr_class"
+# Test attributes and methods of label.
+gdb_py_test_silent_cmd "python some_label = list(block)\[2\]" "Get some_label symbol" 0
+gdb_test "python print (some_label.name)" "some_label" "Test some_label.name"
+gdb_test "python print (some_label.addr_class == gdb.SYMBOL_LOC_LABEL)" "True" "Test some_label.addr_class"
+gdb_test "python print (some_label.value(frame))" ".*TypeError: cannot get the value of a label.*" "Test some_label.value()"
+
gdb_breakpoint [gdb_get_line_number "Break at end."]
gdb_continue_to_breakpoint "Break at end for variable a" ".*Break at end.*"
gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0
--
1.7.9.5
next prev parent reply other threads:[~2014-03-04 10:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 10:36 [PATCH 0/3] Fixed abortion using Python API for label symbol object Maxim Bublis
2014-03-04 10:37 ` [PATCH 2/3] gdb/python: raise TypeError instead of abort() on calling .value() method " Maxim Bublis
2014-03-04 17:57 ` Phil Muldoon
[not found] ` <07E7B14B-748D-4CF7-A8AD-623AF5D6E701@yandex-team.ru>
2014-03-06 8:37 ` Phil Muldoon
2014-03-04 10:37 ` Maxim Bublis [this message]
2014-03-05 13:41 ` [PATCH v2 1/3] gdb/testsuite/gdb.python: Added testcase for value method Maxim Bublis
[not found] ` <1394026864-4691-2-git-send-email-satori@yandex-team.ru>
2014-04-14 7:41 ` [PATCH v2 2/3] gdb/python: raise TypeError instead of abort on calling value method for label symbol object Phil Muldoon
2014-04-16 17:20 ` Maxim Bublis
2014-04-17 12:44 ` Maxim Bublis
2014-03-04 10:37 ` [PATCH 3/3] gdb/doc/python.texi: documented gdb.SYMBOL_LOC_LABEL. Added notion on possible exception thrown from symbol object .value() method Maxim Bublis
2014-03-04 16:53 ` Eli Zaretskii
2014-03-05 13:34 ` Maxim Bublis
2014-03-05 13:41 ` [PATCH v2 3/3] gdb/doc/python.texi: documented gdb.SYMBOL_LOC_LABEL, added notion on possible exceptions thrown from symbol object value method Maxim Bublis
2014-03-05 17:12 ` Eli Zaretskii
2014-03-25 16:51 ` [PATCH 0/3] Fixed abortion using Python API for label symbol object Maxim Bublis
2014-03-25 19:51 ` Phil Muldoon
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=1393929360-31299-2-git-send-email-satori@yandex-team.ru \
--to=satori@yandex-team.ru \
--cc=gdb-patches@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