public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Add test for some error cases of @entry usage
@ 2018-01-21  0:01 Andrew Burgess
  2018-01-21  0:47 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Burgess @ 2018-01-21  0:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdb: Add test for some error cases of @entry usage
  2018-01-21  0:01 [PATCH] gdb: Add test for some error cases of @entry usage Andrew Burgess
@ 2018-01-21  0:47 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2018-01-21  0:47 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 01/21/2018 12:01 AM, Andrew Burgess wrote:
> 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.

OK.  Thanks!

Pedro Alves

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-21  0:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-21  0:01 [PATCH] gdb: Add test for some error cases of @entry usage Andrew Burgess
2018-01-21  0:47 ` Pedro Alves

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).