diff options
author | Tom Tromey <tom@tromey.com> | 2023-06-19 14:44:43 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-06-20 11:21:51 -0600 |
commit | 1e0e3ecd67156ea8a7ecb9e4fb709caa6004bd52 (patch) | |
tree | 593d69def9eaffbafbb37a86c5be41583f0391f2 /gdb | |
parent | da25448d52654475792c8d05485d97205ba938ab (diff) | |
download | binutils-1e0e3ecd67156ea8a7ecb9e4fb709caa6004bd52.zip binutils-1e0e3ecd67156ea8a7ecb9e4fb709caa6004bd52.tar.gz binutils-1e0e3ecd67156ea8a7ecb9e4fb709caa6004bd52.tar.bz2 |
Make aop_map 'static'
This changes aop_map to be 'static'.
Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ax-general.c | 31 | ||||
-rw-r--r-- | gdb/ax.h | 30 |
2 files changed, 30 insertions, 31 deletions
diff --git a/gdb/ax-general.c b/gdb/ax-general.c index b28c8e7..a8451d7 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -294,7 +294,36 @@ ax_string (struct agent_expr *x, const char *str, int slen) /* Functions for disassembling agent expressions, and otherwise debugging the expression compiler. */ -struct aop_map aop_map[] = +/* An entry in the opcode map. */ +struct aop_map + { + + /* The name of the opcode. Null means that this entry is not a + valid opcode --- a hole in the opcode space. */ + const char *name; + + /* All opcodes take no operands from the bytecode stream, or take + unsigned integers of various sizes. If this is a positive number + n, then the opcode is followed by an n-byte operand, which should + be printed as an unsigned integer. If this is zero, then the + opcode takes no operands from the bytecode stream. + + If we get more complicated opcodes in the future, don't add other + magic values of this; that's a crock. Add an `enum encoding' + field to this, or something like that. */ + int op_size; + + /* The size of the data operated upon, in bits, for bytecodes that + care about that (ref and const). Zero for all others. */ + int data_size; + + /* Number of stack elements consumed, and number produced. */ + int consumed, produced; + }; + +/* Map of the bytecodes, indexed by bytecode number. */ + +static struct aop_map aop_map[] = { {0, 0, 0, 0, 0} #define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) \ @@ -221,36 +221,6 @@ extern void ax_string (struct agent_expr *x, const char *str, int slen); /* Disassemble the expression EXPR, writing to F. */ extern void ax_print (struct ui_file *f, struct agent_expr * EXPR); -/* An entry in the opcode map. */ -struct aop_map - { - - /* The name of the opcode. Null means that this entry is not a - valid opcode --- a hole in the opcode space. */ - const char *name; - - /* All opcodes take no operands from the bytecode stream, or take - unsigned integers of various sizes. If this is a positive number - n, then the opcode is followed by an n-byte operand, which should - be printed as an unsigned integer. If this is zero, then the - opcode takes no operands from the bytecode stream. - - If we get more complicated opcodes in the future, don't add other - magic values of this; that's a crock. Add an `enum encoding' - field to this, or something like that. */ - int op_size; - - /* The size of the data operated upon, in bits, for bytecodes that - care about that (ref and const). Zero for all others. */ - int data_size; - - /* Number of stack elements consumed, and number produced. */ - int consumed, produced; - }; - -/* Map of the bytecodes, indexed by bytecode number. */ -extern struct aop_map aop_map[]; - /* Given an agent expression AX, analyze and update its requirements. */ extern void ax_reqs (struct agent_expr *ax); |