From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH] gdb: Add test for some error cases of @entry usage
Date: Sun, 21 Jan 2018 00:01:00 -0000 [thread overview]
Message-ID: <20180121000151.29174-1-andrew.burgess@embecosm.com> (raw)
Adds a test that using @entry for a non-parameter, or for an unknown
symbol, both give the expected error. This error message was
previously untested.
gdb/testsuite/ChangeLog:
* gdb.arch/amd64-entry-value.exp: Test using @entry on a
non-parameter, and on an unknown symbol.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.arch/amd64-entry-value.exp | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp
index 46a896fdec0..72700d55c23 100644
--- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp
@@ -87,6 +87,14 @@ gdb_test "p d9@entry" " = 11\\.5" "entry_stack: p d9@entry"
gdb_test "p da" " = 4\\.5" "entry_stack: p da"
gdb_test "p da@entry" " = 12\\.5" "entry_stack: p da@entry"
+# Test @entry values for a static file scoped variable, and for an
+# unknown symbol. Both of these should give an error.
+gdb_test "p v@entry" \
+ "@entry can be used only for function parameters, not for \"v\"" \
+ "attempt to print global v@entry"
+gdb_test "p unknown@entry" \
+ "@entry can be used only for function parameters, not for \"unknown\"" \
+ "attempt to print unknown@entry"
# Test various kinds of `set print entry-values'.
--
2.14.3
next reply other threads:[~2018-01-21 0:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-21 0:01 Andrew Burgess [this message]
2018-01-21 0:47 ` Pedro Alves
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=20180121000151.29174-1-andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).