aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2010-03-18 01:47:33 +0000
committerStan Shebs <shebs@codesourcery.com>2010-03-18 01:47:33 +0000
commit3a96536b1719be040188657f7cb1afb83ab914ca (patch)
tree63561dafd6e0ad2d83f46b967effeb7de73f7aab
parent573cda036ad9f4f8bfe70199cca46106a9583153 (diff)
downloadgdb-3a96536b1719be040188657f7cb1afb83ab914ca.zip
gdb-3a96536b1719be040188657f7cb1afb83ab914ca.tar.gz
gdb-3a96536b1719be040188657f7cb1afb83ab914ca.tar.bz2
2010-03-17 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c (require_rvalue): Disallow non-scalars.
-rw-r--r--gdb/ChangeLog2
-rw-r--r--gdb/ax-gdb.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2b5e242..f961562 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,7 @@
2010-03-17 Stan Shebs <stan@codesourcery.com>
+ * ax-gdb.c (require_rvalue): Disallow non-scalars.
+
* infcall.c: Include tracepoint.h.
(call_function_by_hand): Disallow calls in tfind mode.
* infcmd.c: Include tracepoint.h.
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 091fd95..4307de3 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -745,6 +745,15 @@ gen_int_literal (struct agent_expr *ax, struct axs_value *value, LONGEST k,
static void
require_rvalue (struct agent_expr *ax, struct axs_value *value)
{
+ /* Only deal with scalars, structs and such may be too large
+ to fit in a stack entry. */
+ value->type = check_typedef (value->type);
+ if (TYPE_CODE (value->type) == TYPE_CODE_ARRAY
+ || TYPE_CODE (value->type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (value->type) == TYPE_CODE_UNION
+ || TYPE_CODE (value->type) == TYPE_CODE_FUNC)
+ error ("Value not scalar: cannot be an rvalue.");
+
switch (value->kind)
{
case axs_rvalue: