aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/ax.exp
diff options
context:
space:
mode:
authorRobert O'Callahan <robert@ocallahan.org>2015-07-08 10:53:36 +0100
committerPedro Alves <palves@redhat.com>2015-07-08 10:53:36 +0100
commitbcf5c1d96b3b5493041002eb2b6d27288d9d160a (patch)
treed7267257d9f989850cb58cf7cd06a8ed0d889b04 /gdb/testsuite/gdb.trace/ax.exp
parente8643a4533a92e011dad97ea53c99d314c06513d (diff)
downloadgdb-bcf5c1d96b3b5493041002eb2b6d27288d9d160a.zip
gdb-bcf5c1d96b3b5493041002eb2b6d27288d9d160a.tar.gz
gdb-bcf5c1d96b3b5493041002eb2b6d27288d9d160a.tar.bz2
PR18617 - Incorrect expression bytecode generated for narrowing conversions
The existing code preserves 'from' bits, which is incorrect. E.g. (gdb) maint agent-eval (char)255L Scope: 0x4008d6 Reg mask: 00 0 const16 255 3 ext 64 5 end 'ext 64' should be 'ext 8'; this bytecode evaluates to 255 instead of the correct result of -1. The fix is simple. I ran the entire test suite on x86-64 and there were no new test failures. gdb/ChangeLog: 2015-07-08 Robert O'Callahan <robert@ocallahan.org> PR exp/18617 * ax-gdb.c (gen_conversion): Extend to 'to' bits, not 'from'. gdb/testsuite/ChangeLog: 2015-07-08 Robert O'Callahan <robert@ocallahan.org> PR exp/18617 * gdb.trace/ax.exp: Add test.
Diffstat (limited to 'gdb/testsuite/gdb.trace/ax.exp')
-rw-r--r--gdb/testsuite/gdb.trace/ax.exp2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.trace/ax.exp b/gdb/testsuite/gdb.trace/ax.exp
index e3d0479..d064475 100644
--- a/gdb/testsuite/gdb.trace/ax.exp
+++ b/gdb/testsuite/gdb.trace/ax.exp
@@ -80,6 +80,8 @@ gdb_test "maint agent &gdb_long_test == &gdb_short_test" "" "maint agent &gdb_lo
gdb_test "maint agent &gdb_long_test < &gdb_short_test" "" "maint agent &gdb_long_test < &gdb_short_test"
+gdb_test "maint agent (unsigned char)1L" ".*ext 8.*" "maint agent (unsigned char)1L"
+
# Now test eval version of agent expressions.
gdb_test "maint agent-eval 12" ".*const8 12.*end.*" "maint agent-eval 12"