Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: Dwarf locations: analyze location before fetching stack top
@ 2004-08-09 23:48 Jim Blandy
  2004-08-24 18:20 ` Jim Blandy
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Blandy @ 2004-08-09 23:48 UTC (permalink / raw)
  To: gdb-patches


This is a minor rearrangement that will clean up an upcoming patch for
recognizing multi-piece expression values a bit.  I'll commit in a few
days.

(That upcoming patch is independent of the design for supporting
scattered values in GDB.  It is related only to recognizing, but not
handling, all possible results of Dwarf expression evaluation.)

2004-08-09  Jim Blandy  <jimb@redhat.com>

	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Wait to fetch the top of
	the stack until we've decided what sort of result the evaluation
	has produced.  Use separate variables, with more specific names.

Index: gdb/dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.15
diff -c -p -r1.15 dwarf2loc.c
*** gdb/dwarf2loc.c	13 May 2004 17:30:41 -0000	1.15
--- gdb/dwarf2loc.c	9 Aug 2004 23:41:15 -0000
*************** dwarf2_evaluate_loc_desc (struct symbol 
*** 205,211 ****
  			  unsigned char *data, unsigned short size,
  			  struct objfile *objfile)
  {
-   CORE_ADDR result;
    struct value *retval;
    struct dwarf_expr_baton baton;
    struct dwarf_expr_context *ctx;
--- 205,210 ----
*************** dwarf2_evaluate_loc_desc (struct symbol 
*** 228,248 ****
    ctx->get_tls_address = dwarf_expr_tls_address;
  
    dwarf_expr_eval (ctx, data, size);
-   result = dwarf_expr_fetch (ctx, 0);
  
    if (ctx->in_reg)
      {
!       int regnum = DWARF2_REG_TO_REGNUM (result);
!       retval = value_from_register (SYMBOL_TYPE (var), regnum, frame);
      }
    else
      {
        retval = allocate_value (SYMBOL_TYPE (var));
        VALUE_BFD_SECTION (retval) = SYMBOL_BFD_SECTION (var);
  
        VALUE_LVAL (retval) = lval_memory;
        VALUE_LAZY (retval) = 1;
!       VALUE_ADDRESS (retval) = result;
      }
  
    free_dwarf_expr_context (ctx);
--- 227,249 ----
    ctx->get_tls_address = dwarf_expr_tls_address;
  
    dwarf_expr_eval (ctx, data, size);
  
    if (ctx->in_reg)
      {
!       CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0);
!       int gdb_regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
!       retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame);
      }
    else
      {
+       CORE_ADDR address = dwarf_expr_fetch (ctx, 0);
+ 
        retval = allocate_value (SYMBOL_TYPE (var));
        VALUE_BFD_SECTION (retval) = SYMBOL_BFD_SECTION (var);
  
        VALUE_LVAL (retval) = lval_memory;
        VALUE_LAZY (retval) = 1;
!       VALUE_ADDRESS (retval) = address;
      }
  
    free_dwarf_expr_context (ctx);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFC: Dwarf locations: analyze location before fetching stack top
  2004-08-09 23:48 RFC: Dwarf locations: analyze location before fetching stack top Jim Blandy
@ 2004-08-24 18:20 ` Jim Blandy
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Blandy @ 2004-08-24 18:20 UTC (permalink / raw)
  To: gdb-patches


Jim Blandy <jimb@redhat.com> writes:
> This is a minor rearrangement that will clean up an upcoming patch for
> recognizing multi-piece expression values a bit.  I'll commit in a few
> days.
> 
> (That upcoming patch is independent of the design for supporting
> scattered values in GDB.  It is related only to recognizing, but not
> handling, all possible results of Dwarf expression evaluation.)
> 
> 2004-08-09  Jim Blandy  <jimb@redhat.com>
> 
> 	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Wait to fetch the top of
> 	the stack until we've decided what sort of result the evaluation
> 	has produced.  Use separate variables, with more specific names.

I've committed this.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-24 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 23:48 RFC: Dwarf locations: analyze location before fetching stack top Jim Blandy
2004-08-24 18:20 ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox