This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fwd: Re: RFA: DW_OP_piece read path]


   Date: Thu, 14 Apr 2005 14:18:57 -0400
   From: Andrew Cagney <cagney@gnu.org>

   It appears I sent this to the wrong address, sigh.

Ah, well, it's good to hear from you again.  An sorry that I start
nagging again, but can you please, please, please, add an empty line
after the declaration of local variables in a block if said block is
longer than say three or four lines?  The following bit lifted from
your patch provides no visual guidance at all about what's going on.
This makes working on that code for me, and most likely others, very
hard, even if I don't suffer from sleep deprivation.

+      int i;
+      long offset = 0;
+      bfd_byte *contents;
+      retval = allocate_value (SYMBOL_TYPE (var));
+      contents = value_contents_raw (retval);
+      for (i = 0; i < ctx->num_pieces; i++)
+	{
+	  struct dwarf_expr_piece *p = &ctx->pieces[i];
+	  if (p->in_reg)
+	    {
+	      bfd_byte regval[MAX_REGISTER_SIZE];
+	      int gdb_regnum = DWARF2_REG_TO_REGNUM (p->value);
+	      get_frame_register (frame, gdb_regnum, regval);
+	      memcpy (contents + offset, regval, p->size);
+	    }
+	  else /* In memory?  */
+	    {
+	      read_memory (p->value, contents + offset, p->size);
+	    }
+	  offset += p->size;
+	}

Otherwise, thanks!  It's good to have this functionality!

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]