* dwarf2loc.c (struct dwarf_expr_baton) Replace objfile by per_cu.
	(dwarf_expr_tls_address): Use per_cu instead of objfile.
	(dwarf2_evaluate_loc_desc): Drop initialization of BATON.OBJFILE.
	Initialize new BATON.PER_CU.  Adjust CTX->GDBARCH initialization for
	this change.
	(struct needs_frame_baton): New field per_cu.
	(dwarf2_loc_desc_needs_frame): Initialize new BATON.PER_CU.
	* dwarf2read.c (struct dwarf2_per_cu_data) <cu>: Extend the comment.
This commit is contained in:
Jan Kratochvil 2010-06-07 19:42:58 +00:00
parent 245040d756
commit 17ea53c331
3 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,14 @@
2010-06-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.c (struct dwarf_expr_baton) Replace objfile by per_cu.
(dwarf_expr_tls_address): Use per_cu instead of objfile.
(dwarf2_evaluate_loc_desc): Drop initialization of BATON.OBJFILE.
Initialize new BATON.PER_CU. Adjust CTX->GDBARCH initialization for
this change.
(struct needs_frame_baton): New field per_cu.
(dwarf2_loc_desc_needs_frame): Initialize new BATON.PER_CU.
* dwarf2read.c (struct dwarf2_per_cu_data) <cu>: Extend the comment.
2010-06-07 Sami Wagiaalla <swagiaal@redhat.com> 2010-06-07 Sami Wagiaalla <swagiaal@redhat.com>
* cp-support.c (make_symbol_overload_list_namespace): Only search * cp-support.c (make_symbol_overload_list_namespace): Only search

View File

@ -122,7 +122,7 @@ find_location_expression (struct dwarf2_loclist_baton *baton,
struct dwarf_expr_baton struct dwarf_expr_baton
{ {
struct frame_info *frame; struct frame_info *frame;
struct objfile *objfile; struct dwarf2_per_cu_data *per_cu;
}; };
/* Helper functions for dwarf2_evaluate_loc_desc. */ /* Helper functions for dwarf2_evaluate_loc_desc. */
@ -227,8 +227,9 @@ static CORE_ADDR
dwarf_expr_tls_address (void *baton, CORE_ADDR offset) dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
{ {
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
struct objfile *objfile = dwarf2_per_cu_objfile (debaton->per_cu);
return target_translate_tls_address (debaton->objfile, offset); return target_translate_tls_address (objfile, offset);
} }
struct piece_closure struct piece_closure
@ -801,12 +802,12 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
} }
baton.frame = frame; baton.frame = frame;
baton.objfile = dwarf2_per_cu_objfile (per_cu); baton.per_cu = per_cu;
ctx = new_dwarf_expr_context (); ctx = new_dwarf_expr_context ();
old_chain = make_cleanup_free_dwarf_expr_context (ctx); old_chain = make_cleanup_free_dwarf_expr_context (ctx);
ctx->gdbarch = get_objfile_arch (baton.objfile); ctx->gdbarch = get_objfile_arch (dwarf2_per_cu_objfile (per_cu));
ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
ctx->baton = &baton; ctx->baton = &baton;
ctx->read_reg = dwarf_expr_read_reg; ctx->read_reg = dwarf_expr_read_reg;
@ -907,6 +908,7 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
struct needs_frame_baton struct needs_frame_baton
{ {
int needs_frame; int needs_frame;
struct dwarf2_per_cu_data *per_cu;
}; };
/* Reads from registers do require a frame. */ /* Reads from registers do require a frame. */
@ -973,6 +975,7 @@ dwarf2_loc_desc_needs_frame (const gdb_byte *data, unsigned short size,
struct cleanup *old_chain; struct cleanup *old_chain;
baton.needs_frame = 0; baton.needs_frame = 0;
baton.per_cu = per_cu;
ctx = new_dwarf_expr_context (); ctx = new_dwarf_expr_context ();
old_chain = make_cleanup_free_dwarf_expr_context (ctx); old_chain = make_cleanup_free_dwarf_expr_context (ctx);

View File

@ -337,7 +337,8 @@ struct dwarf2_per_cu_data
Otherwise it's from .debug_info. */ Otherwise it's from .debug_info. */
unsigned int from_debug_types : 1; unsigned int from_debug_types : 1;
/* Set iff currently read in. */ /* Set to non-NULL iff this CU is currently loaded. When it gets freed out
of the CU cache it gets reset to NULL again. */
struct dwarf2_cu *cu; struct dwarf2_cu *cu;
/* If full symbols for this CU have been read in, then this field /* If full symbols for this CU have been read in, then this field