This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
src/gdb ChangeLog ax-gdb.c expprint.c expression.h
- From: brobecke at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 21 Mar 2012 15:16:25 -0000
- Subject: src/gdb ChangeLog ax-gdb.c expprint.c expression.h
CVSROOT: /cvs/src
Module name: src
Changes by: brobecke@sourceware.org 2012-03-21 15:16:24
Modified files:
gdb : ChangeLog ax-gdb.c expprint.c expression.h
Log message:
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.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14034&r2=1.14035
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ax-gdb.c.diff?cvsroot=src&r1=1.97&r2=1.98
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/expprint.c.diff?cvsroot=src&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/expression.h.diff?cvsroot=src&r1=1.41&r2=1.42