aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-value.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-04-28 09:11:23 -0600
committerTom Tromey <tromey@adacore.com>2023-05-23 14:17:04 -0600
commit125862f0f220f631a184599ea7c9ff7efbea9044 (patch)
treee89a0003d7086ab2e01319ddf1f66e74a125c156 /gdb/testsuite/gdb.python/py-value.c
parent2c64cbb737e801c5c3b0e0d8b03901b65b2f84dc (diff)
downloadbinutils-125862f0f220f631a184599ea7c9ff7efbea9044.zip
binutils-125862f0f220f631a184599ea7c9ff7efbea9044.tar.gz
binutils-125862f0f220f631a184599ea7c9ff7efbea9044.tar.bz2
Add global_context parameter to gdb.parse_and_eval
This adds a 'global_context' parse_and_eval to gdb.parse_and_eval. This lets users request a parse that is done at "global scope". I considered letting callers pass in a block instead, with None meaning "global" -- but then there didn't seem to be a clean way to express the default for this parameter. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/testsuite/gdb.python/py-value.c')
-rw-r--r--gdb/testsuite/gdb.python/py-value.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-value.c b/gdb/testsuite/gdb.python/py-value.c
index 5a578de..f0b1f5f 100644
--- a/gdb/testsuite/gdb.python/py-value.c
+++ b/gdb/testsuite/gdb.python/py-value.c
@@ -79,6 +79,8 @@ int func2 (int arg1, int arg2)
char **save_argv;
+int shadowed = 23;
+
int
main (int argc, char *argv[])
{
@@ -96,6 +98,7 @@ main (int argc, char *argv[])
int i = 2;
int *ptr_i = &i;
struct str *xstr;
+ int shadowed = 97;
/* Prevent gcc from optimizing argv[] out. */