diff options
author | Tom de Vries <tdevries@suse.de> | 2024-05-03 09:37:19 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-05-03 09:37:19 +0200 |
commit | ed8fd0a342f6e832fee1a3fabc3e494977780dcf (patch) | |
tree | 296876eab5385713509f814832204f96059044ea /gdb/testsuite/README | |
parent | e6d60e7624bffc24ce041da794b214e28ac80b4b (diff) | |
download | gdb-ed8fd0a342f6e832fee1a3fabc3e494977780dcf.zip gdb-ed8fd0a342f6e832fee1a3fabc3e494977780dcf.tar.gz gdb-ed8fd0a342f6e832fee1a3fabc3e494977780dcf.tar.bz2 |
[gdb/exp] Fix cast handling for indirection
Consider a test-case compiled without debug info, containing:
...
char a = 'a';
char *
a_loc (void)
{
return &a;
}
...
We get:
...
(gdb) p (char)*a_loc ()
Cannot access memory at address 0x10
...
There's a bug in unop_ind_base_operation::evaluate that evaluates
"(char)*a_loc ()" the same as:
...
(gdb) p (char)*(char)a_loc ()
Cannot access memory at address 0x10
...
Fix this by instead evaluating it the same as:
...
(gdb) p (char)*(char *)a_loc ()
$1 = 97 'a'
...
Tested on x86_64-linux.
PR exp/31693
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31693
Diffstat (limited to 'gdb/testsuite/README')
0 files changed, 0 insertions, 0 deletions