* parse.c (parse_fprintf): New function used to avoid calls to
fprintf in bison parser generated debug code.
* parser-defs.h: Declaration of new parse_fprintf function.
* ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y:
Set YYDEBUG to 1 by default.
Set YYFPRINTF as parse_fprintf.
* c-lang.h: #include "macroexp.h", for macro_lookup_ftype.
(scan_macro_expansion, scanning_macro_expansion,
finished_macro_expansion): New function declarations.
(expression_macro_lookup_func, expression_macro_lookup_baton): New
variable declarations.
* parser-defs.h (expression_context_pc): New declaration.
* parse.c (expression_context_pc): New variable.
(parse_exp_1): Set expression_context_pc, as well as
expression_context_block.
* c-exp.y (yylex): If we're not already reading the result of a
macro expansion, try to macro-expand the next token. When we're
done scanning a macro expansion, switch back to the mainline text.
Commas and `if's in a macro's expansion don't terminate the input.
* c-lang.c: #include "macroscope.h" and "gdb_assert.h".
(macro_original_text, macro_expanded_text,
expression_macro_lookup_func, expression_macro_lookup_baton): New
variables.
(scan_macro_expansion, scanning_macro_expansion,
finished_macro_expansion, scan_macro_cleanup, null_macro_lookup,
c_preprocess_and_parse): New functions.
(c_language_defn, cplus_language_defn, asm_language_defn): Call
c_preprocess_and_parse, instead of c_parse.
* Makefile.in (c_lang_h): Note that this #includes macroexp.h.
(c-lang.o): Note dependency on macroscope.h and gdb_assert.h.
* parser-defs.h (prev_lexptr): New external variable.
* parse.c (parse_exp_1): Set prev_lexptr to null before
calling the language-specific parser.
* c-exp.y (yylex): Set prev_lexptr to start of current token.
(yyerror): Use prev_lexptr in error reporting.
* stack.c (get_selected_block): Add new argument `addr_in_block',
used to return the exact code address we used to select the block,
not just the block.
* blockframe.c (get_frame_block, get_current_block): Same.
* frame.h (get_frame_block, get_current_block,
get_selected_block): Update declarations.
* linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c,
linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed.
gdb/mi/ChangeLog:
* mi-cmd-stack.c (list_args_or_locals): Pass new arg to
get_frame_block. (See entry in gdb/ChangeLog.)
Add address space identifiers to expression language for types.
* c-exp.y (space_identifier, cv_with_space_id,
const_or_volatile_or_space_identifier_noopt,
const_or_volatile_or_space_identifier): New terminals.
(ptype): Accept const_or_volatile_or_space_identifier.
(typebase): Accept const_or_volatile_or_space_identifier.
* c-typeprint.c (c_type_print_cv_qualifier): Rename to
c_type_print_modifier. Handle address space modified types.
* gdbtypes.h (TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE):
New type flags.
(struct type): Add new field as_type for addr-space qualified types.
(TYPE_AS_TYPE): New macro, retrieves the chain of types that are
identical to this one except for address-space qualification.
* gdbtypes.c (alloc_type): Initialize new field 'as_type'.
(address_space_name_to_int): New function.
(address_space_int_to_name): New function.
(make_type_with_address_space): New function.
(make_cv_type): Handle as_type field of new struct type object.
* parse.c (check_type_stack_depth): New function.
(push_type_address_space): New function.
(follow_types): Handle types with address-space qualifier.
* parser-defs.h (enum type_pieces): Add enum tp_space_identifier.
Changes by Daniel Berlin <dan@cgsoftware.com>, to support
better parsing of const and volatile type expressions.
* c-exp.y (const_and_volatile, const_or_volatile_noopt,
const_or_volatile): New non-terminals.
(ptype): Use new rule for const_or_volatile.
(typebase): Use new rule for const_or_volatile_noopt.
* parser-defs.h (enum type_pieces): New values tp_const, tp_volatile.
* parse.c (follow_types): Handle tp_const and tp_volatile on the
type stack: call make_cv_type to create new const/volatile type.
* linespec.h: New file. Declarations for linespec.c.
* linespec.c, alpha-tdep.c, breakpoint.c, parse.c, source.c,
symtab.c, tracepoint.c: Include the above.
* completer.c: New file. Line completion stuff for GDB.
(get_gdb_completer_word_break_characters,
get_gdb_completer_quote_characters): New functions. Accessors for
useful completer internal data.
(filename_completer, line_completion_function, skip_quoted): Moved
here from top.c.
* completer.h: New file. Declarations for the above.
* linespec.c (decode_line_1): Use
get_gdb_completer_word_break_characters and
get_gdb_completer_quote_characters.
* top.c: Include completer.h.
(filename_completer, line_completion_function, skip_quoted):
Moved to completer.c.
* corefile.c, exec.c, source.c, symfile.c, linespec.c: Include
completer.h.
* Makefile.in (SFILES): Add completer.c.
(COMMON_OBS): Add completer.o.
(completer.o): New target.
(linespec.o, alpha-tdep.o, breakpoint.o, parse.o, source.o,
symtab.o, tracepoint.o): Add linespec.h to dependencies list.
(corefile.o, exec.o, source.o, symfile.o, linespec.o): Add completer.h
to dependencies list.
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid
possible nested-if confusion.
* breakpoint.c (breakpoint_here_p): Ditto.
(breakpoint_inserted_here_p): Ditto.
(breakpoint_thread_match): Ditto.
* gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
* gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
prototypes.
* symtab.h: Add prototype for _initialize_source.
* value.h: Add prototype for _initialize_value.
* defs.h: Include sys/types.h or stddef.h to get size_t.
(make_cleanup): Add make_cleanup_func typedef and switch to using
a prototype for this function.
(mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
using mmalloc.
* ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c
dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c
infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c:
Cast parameters passed to make_cleanup to use the new
make_cleanup_func typedef.
More warning cleanups. There are still a bunch of places where the first
argument to make_cleanup is not cast to (make_cleanup_func); these are
either due to the function fitting the make_cleanup_func specification
already (e.g. free()) or they are in files that weren't compiled when
I did my make on a Linux native system. Bwahahaha. You can see them
like this:
grep make_cleanup\ * | grep -v make_cleanup_func
I'll surely go back and clean up the remaining suspicious calls in
GDB one of these days. :-)
* expprint.c expression.h (dump_expression): Rename to
dump_prefix_expression.
* Print out the expression in normal form. Call print_longest
instead of trying to do it ourselves.
* (dump_postfix_expression): New function, prints out the expression
with indentation and better formatting and interpretation.
* parse.c (parse_exp_1): Put calls to dump expressions under ifdef
MAINTENANCE_CMDS and expressiondebug variable.
bility of multiple symbols at the same address when finding high.
* breakpoint.c (resolve_sal_pc): if the function based section lookup
fails, try getting the section from the minimal symbol table.
* parse.c (write_exp_msymbol): use symbol_overlayed_address to get
the LMA of a minimal symbol if unmapped.
* symtab.c (find_line_symtab): change interface to return symtab
containing the best linetable found.
(decode_line_1): use find_line_symtab to set val.symtab. This should
improve support for source files with multiple symtabs.
* tm-txvu.h: include tm-mips64.h instead of starting from scratch.
so that targets can define their own register name aliases.
infcmd.c (registers_info): call target_map_name_to_register so that
"print $reg" and "info reg $reg" share the same register alias set.
mips-tdep.c: separate MIPS_R5900_REGS from NUM_REGS so that sky registers
can be printed separately.
txvu-tdep.c: print registers according to current CPU context.
tm-txvu.h: define SKY registers and conditionalize register interpretation
macros.
txvu.mt: Don't bother building remote-mips.o for sky target.
* parse.c, parser-defs.h (length_of_subexp): Make non-static.
* jv-exp.y (FieldAccess): Handle dollar-VARIABLE as primary.
(ArrayAccess): Likewise. Also remove warnings.
(CastExpression): Implement (typename) UnaryExpression.
(push_qualified_expression_name): Fix small bug.
* jv-lang.c: Use TYPE_TAG_NAME, not TYPE_NAME for class names.
(_initialize_jave_language): Fix typo (jave -> java).
(java_language): Java does *not* have C-style arrays.
(java_class_from_object): Make more general (and complicated).
(java_link_class_type): Fix typo "super" -> "class". Handle arrays.
(java_emit_char, java_printchar): New function.
(evaluate_subexp_java case BINOP_SUBSCRIPT): Handle Java arrays.
* jv-valprint.c (java_value_print): Implement printing of Java arrays.
(java_print_value_fields): New function.
(java_val_print): Better printing of TYPE_CODE_CHAR, TYPE_CODE_STRUCT.
* monitor.h,monitor.c:
Added monitor flags MO_NO_ECHO_ON_SETMEM (don't expect echo on
setmem command), MO_RUN_FIRST_TIME (if command to start process
running on target is different from one to continue execution),
MO_HEX_PREFIX (if addresses from monitor have a "0x" prefix).
* monitor.c,parse.c,sparc-tdep.c:
Don't require strings in the registers array. This is to allow
NULLs to be place holders in the tm-*.h file so that only minor
changes are needed when a new processor is introduced (eg, one
without floating point).
* sparc-tdep.c: Conditionally remove dependancies on floating point.
* sparclet-rom.c,config/sparc/sparclet.mt,config/sparc/tm-sparclet.h:
New files for target sparclet.
* symfile.c: Add option for 2nd parameter on load command : a load
offset added to the vma of each section.
* c-exp.y (%union): Change dval to typed_val_float. Use DOUBLEST
to store actual data. Change types of INT and FLOAT tokens to
typed_val_int and typed_val_float respectively. Create new token
DOUBLE_KEYWORD to specify the string `double'. Make production
for FLOAT use type determined by parse_number. Add production for
"long double" data type.
* (parse_number): Use sscanf to parse numbers as float, double or
long double depending upon the type of typed_val_float.dval. Also
allow user to specify `f' or `l' suffix to explicitly specify
float or long double constants. Change typed_val to
typed_val_int.
* (yylex): Change typed_val to typed_val_int. Also, scan for
"double" keyword.
* coffread.c (decode_base_type): Add support for T_LNGDBL basic
type.
* configure, configure.in: Add check for long double support in
the host compiler.
* defs.h: Define DOUBLEST appropriatly depending on whether
HAVE_LONG_DOUBLE (from autoconf) is defined. Also, fix prototypes
for functions that handle this type.
* expression.h (union exp_element): doubleconst is now type
DOUBLEST.
* m2-exp.y f-exp.y (%union): dval becomes type DOUBLEST.
* findvar.c (extract_floating): Make return value be DOUBLEST.
Also, add support for numbers with size of long double.
* (store_floating): Arg `val' is now type DOUBLEST. Handle all
floating types.
* parser-defs.h parse.c (write_exp_elt_dblcst): Arg expelt is now
DOUBLEST.
* valarith.c (value_binop): Change temp variables v1, v2 and v to
type DOUBLEST. Coerce type of result to long double if either op
was of that type.
* valops.c (value_arg_coerce): If argument type is bigger than
double, coerce to long double.
* (call_function_by_hand): If REG_STRUCT_HAS_ADDR is defined, and
arg type is float and > 8 bytes, then use pointer-to-object
calling conventions.
* valprint.c (print_floating): Arg doub is now type DOUBLEST.
Use appropriate format and precision to print out floating point
values.
* value.h: Fixup prototypes for value_as_double,
value_from_double, and unpack_double to use DOUBLEST.
* values.c (record_latest_value): Remove check for invalid
floats. Allow history to store them so that people may examine
them in hex if they want.
* (value_as_double unpack_double): Change return value to DOUBLEST.
* (value_from_double): Arg `num' is now DOUBLEST.
* (using_struct_return): Use RETURN_VALUE_ON_STACK macro (target
specific) to expect certain types to always be returned on the stack.