mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 02:24:46 +08:00
0d53c4c49f
* 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.
65 lines
2.0 KiB
C
65 lines
2.0 KiB
C
/* Dwarf2 location expression support for GDB.
|
|
Copyright 2003 Free Software Foundation, Inc.
|
|
|
|
This file is part of GDB.
|
|
|
|
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
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
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.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#if !defined (DWARF2LOC_H)
|
|
#define DWARF2LOC_H
|
|
|
|
/* This header is private to the DWARF-2 reader. It is shared between
|
|
dwarf2read.c and dwarf2loc.c. */
|
|
|
|
/* The symbol location baton types used by the DWARF-2 reader (i.e.
|
|
SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct
|
|
dwarf2_locexpr_baton" is for a symbol with a single location
|
|
expression; "struct dwarf2_loclist_baton" is for a symbol with a
|
|
location list. */
|
|
|
|
struct dwarf2_locexpr_baton
|
|
{
|
|
/* Pointer to the start of the location expression. */
|
|
unsigned char *data;
|
|
|
|
/* Length of the location expression. */
|
|
unsigned short size;
|
|
|
|
/* The objfile containing the symbol whose location we're computing. */
|
|
struct objfile *objfile;
|
|
};
|
|
|
|
struct dwarf2_loclist_baton
|
|
{
|
|
/* The initial base address for the location list, based on the compilation
|
|
unit. */
|
|
CORE_ADDR base_address;
|
|
|
|
/* Pointer to the start of the location list. */
|
|
unsigned char *data;
|
|
|
|
/* Length of the location list. */
|
|
unsigned short size;
|
|
|
|
/* The objfile containing the symbol whose location we're computing. */
|
|
struct objfile *objfile;
|
|
};
|
|
|
|
extern struct location_funcs dwarf2_locexpr_funcs;
|
|
extern struct location_funcs dwarf2_loclist_funcs;
|
|
|
|
#endif
|