aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-03-21 15:16:24 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-03-21 15:16:24 +0000
commitbd0b9f9e12441312c46482764448a8a8ce236107 (patch)
treedd038bb3899fde1f4b8bed60e4de7ada7b83ba57 /gdb/ax-gdb.c
parentb781d74fe101630e7d5dac103916b17fbe4de7cd (diff)
downloadgdb-bd0b9f9e12441312c46482764448a8a8ce236107.zip
gdb-bd0b9f9e12441312c46482764448a8a8ce236107.tar.gz
gdb-bd0b9f9e12441312c46482764448a8a8ce236107.tar.bz2
SEGV during AX eval of OP_DOUBLE (unsupported)
To reproduce the problem, simply try the following with any program: (gdb) maintenance agent-eval 1.0 Critical error handler: process [...] terminated due to access violation (this is on Windows; on GNU/Linux, the libc copes better) The problem is quite simple: gen_expr is given an expression that contains an unrecognized operator (OP_DOUBLE in this case). When that happens, it tries to report an error with a string image of the operator in the error message. Conversion of the opcode into a string is done using op_string which, despite its name, probably is not what the author was looking for. This function returns NULL for a lot of the opcodes, thus triggering the crash. There is a function that corresponds to what we are looking for: expprint.c:op_name. It was static, though, so I made it non-static, and used it from ax-gdb.c:gen_expr. gdb/ChangeLog: * expression.h (op_name): Add declaration. * expprint.c (op_name): Remove declaration. Make non-static. * ax-gdb.c (gen_expr): Use op_name instead of op_string.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r--gdb/ax-gdb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index a76e781..aaefed6 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2217,7 +2217,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
default:
error (_("Unsupported operator %s (%d) in expression."),
- op_string (op), op);
+ op_name (exp, op), op);
}
}