Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: [patch 1/2] DW_OP_call: Provide per_cu in the batons
Date: Mon, 07 Jun 2010 11:56:00 -0000	[thread overview]
Message-ID: <20100607115641.GB24148@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20091012210844.GA20340@caradoc.them.org> <m3tyy4pcbw.fsf@fleche.redhat.com>

Hi,

provide per_cu in the batons as required by the patch 2/2.


Thanks,
Jan


gdb/
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.

--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -122,7 +122,7 @@ find_location_expression (struct dwarf2_loclist_baton *baton,
 struct dwarf_expr_baton
 {
   struct frame_info *frame;
-  struct objfile *objfile;
+  struct dwarf2_per_cu_data *per_cu;
 };
 
 /* Helper functions for dwarf2_evaluate_loc_desc.  */
@@ -227,8 +227,9 @@ static CORE_ADDR
 dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
 {
   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
@@ -801,12 +802,12 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
     }
 
   baton.frame = frame;
-  baton.objfile = dwarf2_per_cu_objfile (per_cu);
+  baton.per_cu = per_cu;
 
   ctx = new_dwarf_expr_context ();
   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->baton = &baton;
   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
 {
   int needs_frame;
+  struct dwarf2_per_cu_data *per_cu;
 };
 
 /* 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;
 
   baton.needs_frame = 0;
+  baton.per_cu = per_cu;
 
   ctx = new_dwarf_expr_context ();
   old_chain = make_cleanup_free_dwarf_expr_context (ctx);
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -337,7 +337,8 @@ struct dwarf2_per_cu_data
      Otherwise it's from .debug_info.  */
   unsigned int from_debug_types : 1;
 
-  /* Set iff currently read in.  */
+  /* Set no 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;
 
   /* If full symbols for this CU have been read in, then this field


  reply	other threads:[~2010-06-07 11:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-20 12:37 [patch] Support DW_OP_call2 and DW_OP_call4 (PR 10640) Jan Kratochvil
2009-10-12 20:43 ` Tom Tromey
2009-10-12 20:49   ` Tom Tromey
2010-06-07 11:56     ` Jan Kratochvil [this message]
2010-06-07 17:44       ` [patch 1/2] DW_OP_call: Provide per_cu in the batons Tom Tromey
2010-06-07 19:44         ` Jan Kratochvil
2010-06-07 11:56     ` [patch 2/2] DW_OP_call: Support DW_OP_call2 and DW_OP_call4 Jan Kratochvil
2010-06-07 18:13       ` Tom Tromey
2010-06-07 20:00         ` Jan Kratochvil
2010-06-07 11:56     ` [patch 0/2] DW_OP_call: Re: [patch] Support DW_OP_call2 and DW_OP_call4 (PR 10640) Jan Kratochvil
2009-10-12 21:08   ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100607115641.GB24148@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox