gdbserver: allow agent expressions to fail with invalid memory access
authorAndrew Burgess <aburgess@redhat.com>
Thu, 20 Oct 2022 10:14:33 +0000 (11:14 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 3 Apr 2023 13:46:32 +0000 (14:46 +0100)
commit3812b38d8de5804ad3eadd6c7a5d532402ddabab
tree24567807fc8f29e4b8eaab45db57fcf4e9f494d6
parent0576dff20f052ab6d1ddba861235c7dc2584a145
gdbserver: allow agent expressions to fail with invalid memory access

This commit extends gdbserver to take account of a failed memory
access from agent_mem_read, and to return a new eval_result_type
expr_eval_invalid_memory_access.

I have only updated the agent_mem_read calls related directly to
reading memory, I have not updated any of the calls related to
tracepoint data collection.  This is just because I'm not familiar
with that area of gdb/gdbserver, and I don't want to break anything,
so leaving the existing behaviour untouched seems like the safest
approach.

I've then updated gdb.base/bp-cond-failure.exp to test evaluating the
breakpoints on the target, and have also extended the test so that it
checks for different sizes of memory access.
gdb/testsuite/gdb.base/bp-cond-failure.exp
gdbserver/ax.cc
gdbserver/ax.h