'num_pieces' and 'pieces', for returning the result of an
expression that uses DW_OP_piece.
(struct dwarf_expr_piece): New struct type.
* dwarf2expr.c (new_dwarf_expr_context): Initialize num_pieces and
pieces.
(free_dwarf_expr_context): Free pieces, if any.
(add_piece): New function.
(execute_stack_op): Implement DW_OP_piece.
* dwarf2loc.c (dwarf2_evaluate_loc_desc): If the result of the
expression is a list of pieces, print an error message.
(dwarf2_loc_desc_needs_frame): If the expression yields
pieces, and any piece is in a register, then we need a frame.
* findvar.c (read_var_value): Remove case for thread local storage
variables. It is now entirely handled by the dwarf2 location
expression code.
* printcmd.c (address_info): Ditto.
* symtab.h (address_class): Remove LOC_THREAD_LOCAL_STATIC
enumeration value.
(struct symbol): Remove objfile field, which was used by
LOC_THREAD_LOCAL_STATIC only.
* dwarf2read.c (decode_locdesc): Remove is_thread_local variable.
* dwarf2loc.h (struct dwarf2_loclist_baton): Add comment about
usage of objfile pointer.
* dwarf2loc.c (locexpr_describe_location): Add case to handle
thread local variables.
Add include of objfiles.h.
* dwarf2expr.c (execute_stack_op): Add comments about thread local
storage variables.
* Makefile.in (dwarf2loc.o): Update dependencies.
correctly indicate an empty stack and ``stack_allocated'' to the
indicate the number of elements initially allocated.
(dwarf_expr_grow_stack): Simplify method for computing new
stack size. Don't loop infinitely if ``stack_len'' is zero.
(execute_stack_op): Move ``ctx->in_reg'' initialization
out of loop. Allow DW_OP_reg0 ... DW_OP_reg31 and DW_OP_regx to
be used in conjuction with DW_OP_piece. Revise error message
accordingly.
to read_reg and update its comment. Remove regnum member.
* dwarf2expr.c (execute_stack_op): Remove memaddr and expr_lval.
Don't call read_reg when setting in_reg. Call read_reg to get
the frame base if it's in a register. Return the register number
on the stack instead of in the context. Remove extra arguments
to read_reg.
* dwarf2loc.c (dwarf_expr_read_reg): Remove extra arguments.
(dwarf2_evaluate_loc_desc): Call value_from_register. Expect
the register number on the expression stack.
(needs_frame_read_reg): Remove extra arguments.
* dwarf2expr.c (dwarf2_read_address): Renamed from read_address;
made non-static.
(execute_stack_op): All callers updated.
* dwarf2expr.h: Add prototype for dwarf2_read_address.
* dwarf2loc.c (find_location_expression): New function.
(dwarf_expr_frame_base): Call it.
(dwarf2_evaluate_loc_desc): Handle 0-length location expressions.
(dwarf2_tracepoint_var_ref): New function, broken out from
locexpr_tracepoint_var_ref.
(locexpr_tracepoint_var_ref): Call dwarf2_tracepoint_var_ref.
Make static.
(loclist_read_variable, loclist_read_needs_frame): New functions.
(loclist_describe_location, loclist_tracepoint_var_ref): New
functions.
(dwarf2_loclist_funcs): New struct location_funcs.
* dwarf2loc.h (struct dwarf2_loclist_baton): New type.
(struct dwarf2_locexpr_baton): Add comments.
(dwarf2_loclist_funcs): New extern.
* dwarf2read.c (struct comp_unit_head): Remove DIE member, add
base_address and base_known.
(dwarf_loc_buffer): New variable.
(struct dwarf2_pinfo): Add dwarf_loc_buffer and dwarf_loc_size.
(DWARF_LOC_BUFFER, DWARF_LOC_SIZE): New macros.
(dwarf2_has_info): Initialize dwarf_loc_offset.
(dwarf2_build_psymtabs): Read in .debug_loc.
(dwarf2_build_psymtabs_hard): Use DWARF_LOC_BUFFER and
DWARF_LOC_SIZE.
(psymtab_to_symtab_1): Likewise. Move base address calculation
here, from...
(dwarf2_get_pc_bounds): ... here. Use the base address from
cu_header.
(dwarf2_symbol_mark_computed): Handle location lists.
* dwarf2loc.c: Include "regcache.h".
(dwarf_expr_read_reg): Rename regnum argument to dwarf_regnum. Use
register_size.
* Makefile.in (dwarf2loc.o): Update dependencies.