]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/gdbserver/ax.h
* python/python.c (gdbpy_decode_line): Move cleanup creation out
[thirdparty/binutils-gdb.git] / gdb / gdbserver / ax.h
CommitLineData
9f14eebc
LM
1/* Data structures and functions associated with agent expressions in GDB.
2 Copyright (C) 2009-2012 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19#if !defined (AX_H)
20#define AX_H 1
21
22#include "server.h"
23#include "regcache.h"
24
25#ifdef IN_PROCESS_AGENT
26extern int debug_agent;
27#define debug_threads debug_agent
28#endif
29
30struct traceframe;
31
32/* Enumeration of the different kinds of things that can happen during
33 agent expression evaluation. */
34
35enum eval_result_type
36 {
37 expr_eval_no_error,
38 expr_eval_empty_expression,
39 expr_eval_empty_stack,
40 expr_eval_stack_overflow,
41 expr_eval_stack_underflow,
42 expr_eval_unhandled_opcode,
43 expr_eval_unrecognized_opcode,
44 expr_eval_divide_by_zero,
45 expr_eval_invalid_goto
46 };
47
48struct agent_expr
49{
50 int length;
51
52 unsigned char *bytes;
53};
54
55#ifndef IN_PROCESS_AGENT
56
57/* The packet form of an agent expression consists of an 'X', number
58 of bytes in expression, a comma, and then the bytes. */
59struct agent_expr *gdb_parse_agent_expr (char **actparm);
60
61/* Convert the bytes of an agent expression back into hex digits, so
62 they can be printed or uploaded. This allocates the buffer,
63 callers should free when they are done with it. */
64char *gdb_unparse_agent_expr (struct agent_expr *aexpr);
65void emit_prologue (void);
66void emit_epilogue (void);
67enum eval_result_type compile_bytecodes (struct agent_expr *aexpr);
68#endif
69
70enum eval_result_type gdb_eval_agent_expr (struct regcache *regcache,
71 struct traceframe *tframe,
72 struct agent_expr *aexpr,
73 ULONGEST *rslt);
74#endif /* AX_H */