diff options
Diffstat (limited to 'gdbserver')
-rw-r--r-- | gdbserver/ax-result-types.def | 44 | ||||
-rw-r--r-- | gdbserver/ax.h | 13 | ||||
-rw-r--r-- | gdbserver/tracepoint.cc | 11 |
3 files changed, 50 insertions, 18 deletions
diff --git a/gdbserver/ax-result-types.def b/gdbserver/ax-result-types.def new file mode 100644 index 0000000..7648b8d --- /dev/null +++ b/gdbserver/ax-result-types.def @@ -0,0 +1,44 @@ +/* Agent expression result types. + + Copyright (C) 2023 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* The AX_RESULT_TYPE macro is used to define a result type that can be + generated by agent expression evaluation. The first macro argument is + the name of an enum entry, and the second is a string that describes + this result type. */ + +AX_RESULT_TYPE (expr_eval_no_error, + "terror:no error") +AX_RESULT_TYPE (expr_eval_empty_expression, + "terror:empty expression") +AX_RESULT_TYPE (expr_eval_empty_stack, + "terror:empty stack") +AX_RESULT_TYPE (expr_eval_stack_overflow, + "terror:stack overflow") +AX_RESULT_TYPE (expr_eval_stack_underflow, + "terror:stack underflow") +AX_RESULT_TYPE (expr_eval_unhandled_opcode, + "terror:unhandled opcode") +AX_RESULT_TYPE (expr_eval_unrecognized_opcode, + "terror:unrecognized opcode") +AX_RESULT_TYPE (expr_eval_divide_by_zero, + "terror:divide by zero") +AX_RESULT_TYPE (expr_eval_invalid_goto, + "terror:invalid goto") +AX_RESULT_TYPE (expr_eval_invalid_memory_access, + "terror:invalid memory access") diff --git a/gdbserver/ax.h b/gdbserver/ax.h index c98e36a..60e307c 100644 --- a/gdbserver/ax.h +++ b/gdbserver/ax.h @@ -33,16 +33,9 @@ struct traceframe; enum eval_result_type { - expr_eval_no_error, - expr_eval_empty_expression, - expr_eval_empty_stack, - expr_eval_stack_overflow, - expr_eval_stack_underflow, - expr_eval_unhandled_opcode, - expr_eval_unrecognized_opcode, - expr_eval_divide_by_zero, - expr_eval_invalid_goto, - expr_eval_invalid_memory_access +#define AX_RESULT_TYPE(ENUM,STR) ENUM, +#include "ax-result-types.def" +#undef AX_RESULT_TYPE }; struct agent_expr diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc index 1f31e0c..609d49a 100644 --- a/gdbserver/tracepoint.cc +++ b/gdbserver/tracepoint.cc @@ -859,14 +859,9 @@ static struct tracepoint *last_tracepoint; static const char * const eval_result_names[] = { - "terror:in the attic", /* this should never be reported */ - "terror:empty expression", - "terror:empty stack", - "terror:stack overflow", - "terror:stack underflow", - "terror:unhandled opcode", - "terror:unrecognized opcode", - "terror:divide by zero" +#define AX_RESULT_TYPE(ENUM,STR) STR, +#include "ax-result-types.def" +#undef AX_RESULT_TYPE }; #endif |