aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-04-15 21:55:04 +0000
committerTom Tromey <tromey@redhat.com>2009-04-15 21:55:04 +0000
commit334cc82d44775325475752b1126a3257b51b2b0c (patch)
treee7ff2bd8ba5616e0ad8f236b60ebf19ece961c68 /gdb/c-lang.c
parent27e3013dec60479105b8c69995b41e909e09d252 (diff)
downloadgdb-334cc82d44775325475752b1126a3257b51b2b0c.zip
gdb-334cc82d44775325475752b1126a3257b51b2b0c.tar.gz
gdb-334cc82d44775325475752b1126a3257b51b2b0c.tar.bz2
gdb
* c-lang.c (evaluate_subexp_c): Correctly handle EVAL_SKIP. gdb/testsuite * gdb.base/charset.exp: Add regression test.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index e18f173..86de933 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -941,7 +941,15 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
*pos += 2;
if (noside == EVAL_SKIP)
- return NULL;
+ {
+ /* Return a dummy value of the appropriate type. */
+ if ((dest_type & C_CHAR) != 0)
+ result = allocate_value (type);
+ else
+ result = value_typed_string ("", 0, type);
+ do_cleanups (cleanup);
+ return result;
+ }
if ((dest_type & C_CHAR) != 0)
{