1999-04-16 09:35:26 +08:00
|
|
|
/* Definitions for expressions stored in reversed prefix form, for GDB.
|
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* ax-gdb.c, c-valprint.c, charset.c, corefile.c: Update copyright.
* demangle.c, disasm.c, dwarf2cfi.c, dwarfread.c: Update copyright.
* elfread.c, eval.c, expprint.c, expression.h: Update copyright.
* f-typeprint.c, findvar.c, gcore.c, gdb_mbuild.sh: Update copyright.
* gdbtypes.h, gnu-v2-abi.c, inferior.h, inftarg.c: Update copyright.
* language.c, language.h, m32r-tdep.c: Update copyright.
* mn10200-tdep.c, scm-lang.c, scm-lang.h: Update copyright.
* somsolib.c, somsolib.h, symfile.c, symtab.h: Update copyright.
* thread-db.c, typeprint.c, utils.c, valarith.c: Update copyright.
* values.c, win32-nat.c, x86-64-linux-nat.c: Update copyright.
* x86-64-linux-tdep.c, z8k-tdep.c: Update copyright.
* cli/cli-decode.h, config/h8500/tm-h8500.h: Update copyright.
Index: mi/ChangeLog
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* mi-cmd-env.c: Update copyright.
2003-01-14 08:49:06 +08:00
|
|
|
|
2013-01-01 14:33:28 +08:00
|
|
|
Copyright (C) 1986-2013 Free Software Foundation, Inc.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
This file is part of GDB.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
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
|
2007-08-24 02:08:50 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-07-08 04:19:36 +08:00
|
|
|
(at your option) any later version.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
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.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-24 02:08:50 +08:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
#if !defined (EXPRESSION_H)
|
|
|
|
#define EXPRESSION_H 1
|
|
|
|
|
|
|
|
|
2011-01-08 03:36:19 +08:00
|
|
|
#include "symtab.h" /* Needed for "struct block" type. */
|
* defs.h (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT, DOUBLEST)
(floatformat_to_doublest, floatformat_from_doublest)
(floatformat_is_negative, floatformat_is_nan)
(floatformat_mantissa, store_floating)
(extract_floating): Move declaration from here.
* doublest.h: To here. New file.
* utils.c (get_field, floatformat_to_doublest, put_field)
(ldfrexp, floatformat_from_doublest, floatformat_is_negative)
(floatformat_is_nan, floatformat_mantissa)
(FLOATFORMAT_CHAR_BIT): Move from here.
* doublest.c: To here. New file.
* findvar.c (store_floating, extract_floating): Move from here.
* doublest.c: To here.
* Makefile.in (SFILES): Add doublest.c.
(COMMON_OBS): Add doublest.o.
(doublest.o): Specify dependencies.
(doublest_h): Define.
* config/m88k/tm-m88k.h: Include "doublest.h".
* config/i960/tm-i960.h: Ditto.
* config/i386/tm-symmetry.h: Ditto.
* rs6000-tdep.c, valarith.c: Ditto.
* valprint.c, stabsread.c, sh-tdep.c: Ditto.
* ia64-tdep.c, i387-tdep.c, i386-tdep.c: Ditto.
* values.c, arm-tdep.c, arm-linux-tdep.c: Ditto.
* alpha-tdep.c, ax.h, expression.h: Ditto.
* sh-tdep.c, parse.c, top.c, value.h: Ditto.
* Makefile.in (arm-tdep.o): Add $(doublest_h).
(i386-tdep.o, i387-tdep.o, ia64-tdep.o): Ditto.
(rs6000-tdep.o, stabsread.o, valarith.o): Ditto.
(values.o, valprint.o, arm-linux-tdep.o): Ditto.
(alpha-tdep.o, ax_h, parse.o, top.o, value_h): Ditto.
(parser_defs_h): Ditto.
(expression_h): Add $(doublest_h) and $(symtab_h).
2001-08-02 02:39:27 +08:00
|
|
|
#include "doublest.h" /* Needed for DOUBLEST. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* Definitions for saved C expressions. */
|
|
|
|
|
|
|
|
/* An expression is represented as a vector of union exp_element's.
|
|
|
|
Each exp_element is an opcode, except that some opcodes cause
|
|
|
|
the following exp_element to be treated as a long or double constant
|
|
|
|
or as a variable. The opcodes are obeyed, using a stack for temporaries.
|
|
|
|
The value is left on the temporary stack at the end. */
|
|
|
|
|
|
|
|
/* When it is necessary to include a string,
|
|
|
|
it can occupy as many exp_elements as it needs.
|
|
|
|
We find the length of the string using strlen,
|
|
|
|
divide to find out how many exp_elements are used up,
|
|
|
|
and skip that many. Strings, like numbers, are indicated
|
|
|
|
by the preceding opcode. */
|
|
|
|
|
|
|
|
enum exp_opcode
|
1999-07-08 04:19:36 +08:00
|
|
|
{
|
2011-02-02 02:54:01 +08:00
|
|
|
#define OP(name) name ,
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2011-02-02 02:54:01 +08:00
|
|
|
#include "std-operator.def"
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2011-02-02 02:54:01 +08:00
|
|
|
/* First extension operator. Individual language modules define extra
|
|
|
|
operators in *.def include files below with numbers higher than
|
|
|
|
OP_EXTENDED0. */
|
|
|
|
OP (OP_EXTENDED0)
|
1999-07-08 04:19:36 +08:00
|
|
|
|
2011-02-02 02:54:01 +08:00
|
|
|
/* Language specific operators. */
|
|
|
|
#include "ada-operator.def"
|
1999-07-08 04:19:36 +08:00
|
|
|
|
2011-02-02 02:54:01 +08:00
|
|
|
#undef OP
|
2009-09-16 00:09:32 +08:00
|
|
|
|
|
|
|
/* Existing only to swallow the last comma (',') from last .inc file. */
|
|
|
|
OP_UNUSED_LAST
|
1999-07-08 04:19:36 +08:00
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
union exp_element
|
1999-07-08 04:19:36 +08:00
|
|
|
{
|
|
|
|
enum exp_opcode opcode;
|
|
|
|
struct symbol *symbol;
|
|
|
|
LONGEST longconst;
|
|
|
|
DOUBLEST doubleconst;
|
2007-10-26 02:01:58 +08:00
|
|
|
gdb_byte decfloatconst[16];
|
1999-07-08 04:19:36 +08:00
|
|
|
/* Really sizeof (union exp_element) characters (or less for the last
|
|
|
|
element of a string). */
|
|
|
|
char string;
|
|
|
|
struct type *type;
|
|
|
|
struct internalvar *internalvar;
|
* ada-exp.y (write_object_renaming, write_var_or_type)
(write_ambiguous_var, write_var_from_sym): Make blocks const.
* ada-lang.c (replace_operator_with_call)
(find_old_style_renaming_symbol): Make blocks const.
* ada-lang.h (ada_find_renaming_symbol): Update.
(struct ada_symbol_info) <block>: Now const.
* breakpoint.c (watch_command_1): Update.
* breakpoint.h (struct watchpoint) <exp_valid_block,
cond_exp_valid_block>: Now const.
* c-exp.y (classify_inner_name, classify_name): Make block
argument const.
* expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b'
const.
* expression.h (innermost_block, parse_exp_1): Update.
(union exp_element) <block>: Now const.
* gdbtypes.c (lookup_template_type, lookup_enum, lookup_union)
(lookup_struct): Make block argument const.
* gdbtypes.h (lookup_template_type): Update.
* go-exp.y (classify_name, classify_packaged_name)
(package_name_p): Make block argument const.
* objc-lang.c (lookup_struct_typedef): Make block argument const.
* objc-lang.h (lookup_struct_typedef): Update.
* parse.c (parse_exp_in_context, parse_exp_1)
(write_exp_elt_block): Make block arguments const.
(expression_context_block, innermost_block): Now const.
* parser-defs.h (write_exp_elt_block): Update.
(expression_context_block, innermost_block, block_found): Now
const.
* printcmd.c (struct display) <block>: Now const.
* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
* valops.c (address_of_variable): Make block argument const.
* value.h (value_of_variable): Update.
* varobj.c (struct varobj_root) <valid_block>: Now const.
2012-12-04 03:59:14 +08:00
|
|
|
const struct block *block;
|
2006-10-10 11:17:53 +08:00
|
|
|
struct objfile *objfile;
|
1999-07-08 04:19:36 +08:00
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
struct expression
|
1999-07-08 04:19:36 +08:00
|
|
|
{
|
2011-01-06 06:22:53 +08:00
|
|
|
const struct language_defn *language_defn; /* language it was
|
2011-01-08 03:36:19 +08:00
|
|
|
entered in. */
|
|
|
|
struct gdbarch *gdbarch; /* architecture it was parsed in. */
|
1999-07-08 04:19:36 +08:00
|
|
|
int nelts;
|
|
|
|
union exp_element elts[1];
|
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* Macros for converting between number of expression elements and bytes
|
2011-01-08 03:36:19 +08:00
|
|
|
to store that many expression elements. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
#define EXP_ELEM_TO_BYTES(elements) \
|
|
|
|
((elements) * sizeof (union exp_element))
|
|
|
|
#define BYTES_TO_EXP_ELEM(bytes) \
|
|
|
|
(((bytes) + sizeof (union exp_element) - 1) / sizeof (union exp_element))
|
|
|
|
|
|
|
|
/* From parse.c */
|
|
|
|
|
2013-03-13 01:39:45 +08:00
|
|
|
extern struct expression *parse_expression (const char *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
Constify strings in tracepoint.c, lookup_cmd and the completers.
This is sort of a continuation of Keith's parse_exp_1 constification
patch. It started out by undoing these bits:
@@ -754,9 +754,12 @@ validate_actionline (char **line, struct
tmp_p = p;
for (loc = t->base.loc; loc; loc = loc->next)
{
- p = tmp_p;
- exp = parse_exp_1 (&p, loc->address,
+ const char *q;
+
+ q = tmp_p;
+ exp = parse_exp_1 (&q, loc->address,
block_for_pc (loc->address), 1);
+ p = (char *) q;
and progressively making more things const upwards, fixing fallout,
rinse repeat, until GDB built again (--enable-targets=all).
That ended up constifying lookup_cmd/add_cmd and (lots of) friends,
and the completers.
I didn't try to constify the command hooks themselves, because I know
upfront there are commands that write to the command string argument,
and I think I managed to stop at a nice non-hacky split point already.
I think the only non-really-super-obvious changes are
tracepoint.c:validate_actionline, and tracepoint.c:trace_dump_actions.
The rest is just mostly about 'char *' => 'const char *', 'char **'=>
'const char **', and the occasional (e.g., deprecated_cmd_warning)
case of 'char **'=> 'const char *', where/when I noticed that nothing
actually cares about the pointer to pointer output.
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/
2013-03-13 Pedro Alves <palves@redhat.com>
* ada-lang.c (struct add_partial_datum) <text, text0, word>: Make
fields const.
(ada_make_symbol_completion_list): Make "text0" parameter const.
* ax-gdb.c (agent_eval_command_one): Make "exp" parameter const.
* breakpoint.c (condition_completer): Make "text" and "word"
parameters const. Adjust.
(check_tracepoint_command): Adjust to validate_actionline
prototype change.
(catch_syscall_completer): Make "text" and "word" parameters
const.
* cli/cli-cmds.c (show_user): Make "comname" local const.
(valid_command_p): Make "command" parameter const.
(alias_command): Make "alias_prefix" and "command_prefix" locals
const.
* cli/cli-decode.c (add_cmd): Make "name" parameter const.
(add_alias_cmd): Make "name" and "oldname" parameters const.
Adjust. No longer make copy of OLDNAME.
(add_prefix_cmd, add_abbrev_prefix_cmd, add_set_or_show_cmd)
(add_setshow_cmd_full, add_setshow_enum_cmd)
(add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd)
(add_setshow_filename_cmd, add_setshow_string_cmd)
(add_setshow_string_noescape_cmd)
(add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
(add_setshow_zuinteger_unlimited_cmd, add_setshow_zuinteger_cmd)
(delete_cmd, add_info, add_info_alias, add_com, add_com_alias):
Make "name" parameter const.
(help_cmd): Rename "command" parameter to "arg". New const local
"command".
(find_cmd): Make "command" parameter const.
(lookup_cmd_1): Make "text" parameter pointer to const. Adjust to
deprecated_cmd_warning prototype change.
(undef_cmd_error): Make "cmdtype" parameter const.
(lookup_cmd): Make "line" parameter const.
(deprecated_cmd_warning): Change type of "text" parameter to
pointer to const char, from pointer to pointer to char. Adjust.
(lookup_cmd_composition): Make "text" parameter const.
(complete_on_cmdlist, complete_on_enum): Make "text" and "word"
parameters const.
* cli/cli-decode.h (struct cmd_list_element) <name>: Make field
const.
* cli/cli-script.c (validate_comname): Make "tem" local const.
(define_command): New const local "tem_c". Use it in calls to
lookup_cmd.
(document_command): Make "tem" and "comfull" locals const.
(show_user_1): Make "prefix" and "name" parameters const.
* cli-script.h (show_user_1): Make "prefix" and "name" parameters
const.
* command.h (add_cmd, add_alias_cmd, add_prefix_cmd)
(add_abbrev_prefix_cmd, completer_ftype, lookup_cmd, lookup_cmd_1)
(deprecated_cmd_warning, lookup_cmd_composition, add_com)
(add_com_alias, add_info, add_info_alias, complete_on_cmdlist)
(complete_on_enum, add_setshow_enum_cmd)
(add_setshow_auto_boolean_cmd, add_setshow_boolean_cmd)
(add_setshow_filename_cmd, add_setshow_string_cmd)
(add_setshow_string_noescape_cmd)
(add_setshow_optional_filename_cmd, add_setshow_integer_cmd)
(add_setshow_uinteger_cmd, add_setshow_zinteger_cmd)
(add_setshow_zuinteger_cmd, add_setshow_zuinteger_unlimited_cmd):
Change prototypes, constifying strings.
* completer.c (noop_completer, filename_completer): Make "text"
and "prefix" parameters const.
(location_completer, expression_completer)
(complete_line_internal): Make "text" and "prefix" parameters
const and adjust.
(command_completer, signal_completer): Make "text" and "prefix"
parameters const.
* completer.h (noop_completer, filename_completer)
(expression_completer, location_completer, command_completer)
(signal_completer): Change prototypes.
* corefile.c (complete_set_gnutarget): Make "text" and "word"
parameters const.
* cp-abi.c (cp_abi_completer): Likewise.
* expression.h (parse_expression_for_completion): Change
prototype.
* f-lang.c (f_make_symbol_completion_list): Make "text" and "word"
parameters const.
* infcmd.c (_initialize_infcmd): Make "cmd_name" local const.
* infrun.c (handle_completer): Make "text" and "word" parameters
const.
* interps.c (interpreter_completer): Make "text" and "word"
parameters const.
* language.h (struct language_defn)
<la_make_symbol_completion_list>: Make "text" and "word"
parameters const.
* parse.c (parse_exp_1): Move const hack to parse_exp_in_context.
(parse_exp_in_context): Rename to ...
(parse_exp_in_context_1): ... this.
(parse_exp_in_context): Reimplement, with const hack from
parse_exp_1.
(parse_expression_for_completion): Make "string" parameter const.
* printcmd.c (decode_format): Make "string_ptr" parameter pointer
to pointer to const char. Adjust.
(print_command_1): Make "exp" parameter const.
(output_command): Rename to ...
(output_command_const): ... this. Make "exp" parameter const.
(output_command): Reimplement.
(x_command): Adjust.
(display_command): Rename "exp" parameter to "arg". New "exp"
local, const version of "arg".
* python/py-auto-load.c (gdbpy_initialize_auto_load): Make
"cmd_name" local const.
* python/py-cmd.c (cmdpy_destroyer): Cast const away in xfree
call.
(cmdpy_completer): Make "text" and "word" parameters const.
(gdbpy_parse_command_name): Make "prefix_text2" local const.
* python/py-param.c (add_setshow_generic): Make "tmp_name" local
const.
* remote.c (_initialize_remote): Make "cmd_name" local const.
* symtab.c (language_search_unquoted_string): Make "text" and "p"
parameters const. Adjust.
(completion_list_add_fields): Make "sym_text", "text" and "word"
parameters const.
(struct add_name_data) <sym_text, text, word>: Make fields const.
(default_make_symbol_completion_list_break_on): Make "text" and
"word" parameters const. Adjust locals.
(default_make_symbol_completion_list)
(make_symbol_completion_list, make_symbol_completion_type)
(make_symbol_completion_list_fn): Make "text" and "word"
parameters const.
(make_file_symbol_completion_list): Make "text", "word" and
"srcfile" parameters const. Adjust locals.
(add_filename_to_list): Make "text" and "word" parameters const.
(struct add_partial_filename_data) <text, word>: Make fields
const.
(make_source_files_completion_list): Make "text" and "word"
parameters const.
* symtab.h (default_make_symbol_completion_list_break_on)
(default_make_symbol_completion_list, make_symbol_completion_list)
(make_symbol_completion_type enum type_code)
(make_symbol_completion_list_fn make_file_symbol_completion_list)
(make_source_files_completion_list): Change prototype.
* top.c (execute_command): Adjust to pass pointer to pointer to
const char to lookup_cmd, and to deprecated_cmd_warning prototype
change.
(set_verbose): Make "cmdname" local const.
* tracepoint.c (decode_agent_options): Make "exp" parameter const,
and adjust.
(validate_actionline): Make "line" parameter a pointer to const
char, and adjust.
(encode_actions_1): Make "action_exp" local const, and adjust.
(encode_actions): Adjust.
(replace_comma): Delete.
(trace_dump_actions): Make "action_exp" and "next_comma" locals
const, and adjust. Don't frob the action string while splitting
it at commas. Instead, make a copy of each split substring in
turn.
(trace_dump_command): Adjust to validate_actionline prototype
change.
* tracepoint.h (decode_agent_options, decode_agent_options)
(encode_actions, validate_actionline): Change prototypes.
* valprint.h (output_command): Delete declaration.
(output_command_const): Declare.
* value.c (function_destroyer): Cast const away in xfree call.
2013-03-14 02:34:55 +08:00
|
|
|
extern struct type *parse_expression_for_completion (const char *, char **,
|
2012-12-08 04:09:11 +08:00
|
|
|
enum type_code *);
|
2008-06-07 04:58:08 +08:00
|
|
|
|
2013-03-13 01:39:45 +08:00
|
|
|
extern struct expression *parse_exp_1 (const char **, CORE_ADDR pc,
|
* ada-exp.y (write_object_renaming, write_var_or_type)
(write_ambiguous_var, write_var_from_sym): Make blocks const.
* ada-lang.c (replace_operator_with_call)
(find_old_style_renaming_symbol): Make blocks const.
* ada-lang.h (ada_find_renaming_symbol): Update.
(struct ada_symbol_info) <block>: Now const.
* breakpoint.c (watch_command_1): Update.
* breakpoint.h (struct watchpoint) <exp_valid_block,
cond_exp_valid_block>: Now const.
* c-exp.y (classify_inner_name, classify_name): Make block
argument const.
* expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b'
const.
* expression.h (innermost_block, parse_exp_1): Update.
(union exp_element) <block>: Now const.
* gdbtypes.c (lookup_template_type, lookup_enum, lookup_union)
(lookup_struct): Make block argument const.
* gdbtypes.h (lookup_template_type): Update.
* go-exp.y (classify_name, classify_packaged_name)
(package_name_p): Make block argument const.
* objc-lang.c (lookup_struct_typedef): Make block argument const.
* objc-lang.h (lookup_struct_typedef): Update.
* parse.c (parse_exp_in_context, parse_exp_1)
(write_exp_elt_block): Make block arguments const.
(expression_context_block, innermost_block): Now const.
* parser-defs.h (write_exp_elt_block): Update.
(expression_context_block, innermost_block, block_found): Now
const.
* printcmd.c (struct display) <block>: Now const.
* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
* valops.c (address_of_variable): Make block argument const.
* value.h (value_of_variable): Update.
* varobj.c (struct varobj_root) <valid_block>: Now const.
2012-12-04 03:59:14 +08:00
|
|
|
const struct block *, int);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2008-06-07 04:58:08 +08:00
|
|
|
/* For use by parsers; set if we want to parse an expression and
|
2012-12-08 04:05:15 +08:00
|
|
|
attempt completion. */
|
|
|
|
extern int parse_completion;
|
2008-06-07 04:58:08 +08:00
|
|
|
|
1999-04-16 09:35:26 +08:00
|
|
|
/* The innermost context required by the stack and register variables
|
|
|
|
we've encountered so far. To use this, set it to NULL, then call
|
|
|
|
parse_<whatever>, then look at it. */
|
* ada-exp.y (write_object_renaming, write_var_or_type)
(write_ambiguous_var, write_var_from_sym): Make blocks const.
* ada-lang.c (replace_operator_with_call)
(find_old_style_renaming_symbol): Make blocks const.
* ada-lang.h (ada_find_renaming_symbol): Update.
(struct ada_symbol_info) <block>: Now const.
* breakpoint.c (watch_command_1): Update.
* breakpoint.h (struct watchpoint) <exp_valid_block,
cond_exp_valid_block>: Now const.
* c-exp.y (classify_inner_name, classify_name): Make block
argument const.
* expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b'
const.
* expression.h (innermost_block, parse_exp_1): Update.
(union exp_element) <block>: Now const.
* gdbtypes.c (lookup_template_type, lookup_enum, lookup_union)
(lookup_struct): Make block argument const.
* gdbtypes.h (lookup_template_type): Update.
* go-exp.y (classify_name, classify_packaged_name)
(package_name_p): Make block argument const.
* objc-lang.c (lookup_struct_typedef): Make block argument const.
* objc-lang.h (lookup_struct_typedef): Update.
* parse.c (parse_exp_in_context, parse_exp_1)
(write_exp_elt_block): Make block arguments const.
(expression_context_block, innermost_block): Now const.
* parser-defs.h (write_exp_elt_block): Update.
(expression_context_block, innermost_block, block_found): Now
const.
* printcmd.c (struct display) <block>: Now const.
* symtab.h (lookup_struct, lookup_union, lookup_enum): Update.
* valops.c (address_of_variable): Make block argument const.
* value.h (value_of_variable): Update.
* varobj.c (struct varobj_root) <valid_block>: Now const.
2012-12-04 03:59:14 +08:00
|
|
|
extern const struct block *innermost_block;
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* From eval.c */
|
|
|
|
|
2002-09-19 11:58:41 +08:00
|
|
|
/* Values of NOSIDE argument to eval_subexp. */
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
enum noside
|
1999-07-08 04:19:36 +08:00
|
|
|
{
|
|
|
|
EVAL_NORMAL,
|
|
|
|
EVAL_SKIP, /* Only effect is to increment pos. */
|
|
|
|
EVAL_AVOID_SIDE_EFFECTS /* Don't modify any variables or
|
1999-04-16 09:35:26 +08:00
|
|
|
call any functions. The value
|
|
|
|
returned will have the correct
|
|
|
|
type, and will have an
|
|
|
|
approximately correct lvalue
|
|
|
|
type (inaccuracy: anything that is
|
|
|
|
listed as being in a register in
|
|
|
|
the function in which it was
|
2013-03-26 01:26:18 +08:00
|
|
|
declared will be lval_register).
|
|
|
|
Ideally this would not even read
|
|
|
|
target memory, but currently it
|
|
|
|
does in many situations. */
|
1999-07-08 04:19:36 +08:00
|
|
|
};
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
extern struct value *evaluate_subexp_standard
|
2000-05-28 09:12:42 +08:00
|
|
|
(struct type *, struct expression *, int *, enum noside);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
/* From expprint.c */
|
|
|
|
|
2000-02-02 08:21:19 +08:00
|
|
|
extern void print_expression (struct expression *, struct ui_file *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2012-03-21 23:16:24 +08:00
|
|
|
extern char *op_name (struct expression *exp, enum exp_opcode opcode);
|
|
|
|
|
2000-05-28 09:12:42 +08:00
|
|
|
extern char *op_string (enum exp_opcode);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
2011-01-06 06:22:53 +08:00
|
|
|
extern void dump_raw_expression (struct expression *,
|
|
|
|
struct ui_file *, char *);
|
2003-09-24 16:29:42 +08:00
|
|
|
extern void dump_prefix_expression (struct expression *, struct ui_file *);
|
1999-04-16 09:35:26 +08:00
|
|
|
|
1999-07-08 04:19:36 +08:00
|
|
|
#endif /* !defined (EXPRESSION_H) */
|