Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: use frame_unwind_register instead of frame_register
@ 2006-11-03 22:11 Jim Blandy
  2006-11-03 22:23 ` Daniel Jacobowitz
  2006-11-06 14:33 ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: Jim Blandy @ 2006-11-03 22:11 UTC (permalink / raw)
  To: gdb-patches


Committed as obvious --- frame_unwind_register takes care of passing
all the dummy arguments to frame_register, so dwarf_expr_read_reg
shouldn't have to bother.

gdb/ChangeLog:
2006-11-03  Jim Blandy  <jimb@codesourcery.com>

        * dwarf2loc.c (dwarf_expr_read_reg): Use frame_unwind_register
        instead of frame_register.  Doc fix.

Index: gdb/dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.34
diff -u -r1.34 dwarf2loc.c
--- gdb/dwarf2loc.c	10 Oct 2006 03:17:53 -0000	1.34
+++ gdb/dwarf2loc.c	3 Nov 2006 21:52:38 -0000
@@ -114,9 +114,8 @@
 
 /* Helper functions for dwarf2_evaluate_loc_desc.  */
 
-/* Using the frame specified in BATON, read register REGNUM.  The lval
-   type will be returned in LVALP, and for lval_memory the register
-   save address will be returned in ADDRP.  */
+/* Using the frame specified in BATON, return the value of register
+   REGNUM, treated as an unsigned integer.  */
 static CORE_ADDR
 dwarf_expr_read_reg (void *baton, int dwarf_regnum)
 {
@@ -130,8 +129,7 @@
   regsize = register_size (current_gdbarch, regnum);
   buf = alloca (regsize);
 
-  frame_register (debaton->frame, regnum, &optimized, &lval_type, &save_addr,
-		  &realnum, buf);
+  frame_unwind_register (debaton->frame, regnum, buf);
   /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2
      address is always unsigned.  That may or may not be true.  */
   result = extract_unsigned_integer (buf, regsize);


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

* Re: PATCH: use frame_unwind_register instead of frame_register
  2006-11-03 22:11 PATCH: use frame_unwind_register instead of frame_register Jim Blandy
@ 2006-11-03 22:23 ` Daniel Jacobowitz
  2006-11-06 14:33 ` Daniel Jacobowitz
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-11-03 22:23 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

On Fri, Nov 03, 2006 at 02:11:17PM -0800, Jim Blandy wrote:
> -  frame_register (debaton->frame, regnum, &optimized, &lval_type, &save_addr,
> -		  &realnum, buf);
> +  frame_unwind_register (debaton->frame, regnum, buf);

So... they're unused now, right? :-)

I often wonder if we should switch to just using -Wall, and use
ATTRIBUTE_UNUSED aggressively, instead of ignoring -Wunused.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: PATCH: use frame_unwind_register instead of frame_register
  2006-11-03 22:11 PATCH: use frame_unwind_register instead of frame_register Jim Blandy
  2006-11-03 22:23 ` Daniel Jacobowitz
@ 2006-11-06 14:33 ` Daniel Jacobowitz
  2006-11-06 20:06   ` Jim Blandy
  2006-11-06 23:24   ` Jim Blandy
  1 sibling, 2 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-11-06 14:33 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

On Fri, Nov 03, 2006 at 02:11:17PM -0800, Jim Blandy wrote:
> 
> Committed as obvious --- frame_unwind_register takes care of passing
> all the dummy arguments to frame_register, so dwarf_expr_read_reg
> shouldn't have to bother.
> 
> gdb/ChangeLog:
> 2006-11-03  Jim Blandy  <jimb@codesourcery.com>
> 
>         * dwarf2loc.c (dwarf_expr_read_reg): Use frame_unwind_register
>         instead of frame_register.  Doc fix.

Jim, in addition to leaving a pile of unused variables in the function
(see my other message from Friday), you've introduced an
off-by-one-frame error here.  frame_register unwinds from the NEXT
frame, but frame_unwind_register unwinds from THIS frame.  Our GDB
autotester reported about six hundred new failures and I'm pretty sure
that's why; we now use the previous frame's r11 for fbreg.  Could you
revert or fix this, please?

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: PATCH: use frame_unwind_register instead of frame_register
  2006-11-06 14:33 ` Daniel Jacobowitz
@ 2006-11-06 20:06   ` Jim Blandy
  2006-11-06 23:24   ` Jim Blandy
  1 sibling, 0 replies; 6+ messages in thread
From: Jim Blandy @ 2006-11-06 20:06 UTC (permalink / raw)
  To: gdb-patches


Daniel Jacobowitz <drow@false.org> writes:
> On Fri, Nov 03, 2006 at 02:11:17PM -0800, Jim Blandy wrote:
>> 
>> Committed as obvious --- frame_unwind_register takes care of passing
>> all the dummy arguments to frame_register, so dwarf_expr_read_reg
>> shouldn't have to bother.
>> 
>> gdb/ChangeLog:
>> 2006-11-03  Jim Blandy  <jimb@codesourcery.com>
>> 
>>         * dwarf2loc.c (dwarf_expr_read_reg): Use frame_unwind_register
>>         instead of frame_register.  Doc fix.
>
> Jim, in addition to leaving a pile of unused variables in the function
> (see my other message from Friday), you've introduced an
> off-by-one-frame error here.  frame_register unwinds from the NEXT
> frame, but frame_unwind_register unwinds from THIS frame.  Our GDB
> autotester reported about six hundred new failures and I'm pretty sure
> that's why; we now use the previous frame's r11 for fbreg.  Could you
> revert or fix this, please?

Urf.  I feel like a bull in a china shop.  Testing revised patch
now...
 


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

* Re: PATCH: use frame_unwind_register instead of frame_register
  2006-11-06 14:33 ` Daniel Jacobowitz
  2006-11-06 20:06   ` Jim Blandy
@ 2006-11-06 23:24   ` Jim Blandy
  2006-11-06 23:27     ` Daniel Jacobowitz
  1 sibling, 1 reply; 6+ messages in thread
From: Jim Blandy @ 2006-11-06 23:24 UTC (permalink / raw)
  To: gdb-patches


I've committed the below, which 1) uses frame_register_read instead of
frame_unwind_register, thereby obtaining the registers from the right
frame, and 2) removes the now-unused variables.

2006-11-06  Jim Blandy  <jimb@codesourcery.com>

	* (dwarf_expr_read_reg): Use frame_register_read, not frame_register.
	* dwarf2loc.c (dwarf_expr_read_reg): Use frame_register_read
	instead of frame_register.  Doc fix.

Index: gdb/dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.35
diff -u -r1.35 dwarf2loc.c
--- gdb/dwarf2loc.c     3 Nov 2006 22:09:28 -0000       1.35
+++ gdb/dwarf2loc.c     6 Nov 2006 23:19:48 -0000
@@ -120,16 +120,15 @@
 dwarf_expr_read_reg (void *baton, int dwarf_regnum)
 {
   struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
-  CORE_ADDR result, save_addr;
-  enum lval_type lval_type;
+  CORE_ADDR result;
   gdb_byte *buf;
-  int optimized, regnum, realnum, regsize;
+  int regnum, regsize;

   regnum = DWARF2_REG_TO_REGNUM (dwarf_regnum);
   regsize = register_size (current_gdbarch, regnum);
   buf = alloca (regsize);

-  frame_unwind_register (debaton->frame, regnum, buf);
+  frame_register_read (debaton->frame, regnum, buf);
   /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2
      address is always unsigned.  That may or may not be true.  */
   result = extract_unsigned_integer (buf, regsize);


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

* Re: PATCH: use frame_unwind_register instead of frame_register
  2006-11-06 23:24   ` Jim Blandy
@ 2006-11-06 23:27     ` Daniel Jacobowitz
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-11-06 23:27 UTC (permalink / raw)
  To: gdb-patches

On Mon, Nov 06, 2006 at 03:24:01PM -0800, Jim Blandy wrote:
> 
> I've committed the below, which 1) uses frame_register_read instead of
> frame_unwind_register, thereby obtaining the registers from the right
> frame, and 2) removes the now-unused variables.

Thanks.  We really do need to cut down on the number of functions...


-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2006-11-06 23:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-03 22:11 PATCH: use frame_unwind_register instead of frame_register Jim Blandy
2006-11-03 22:23 ` Daniel Jacobowitz
2006-11-06 14:33 ` Daniel Jacobowitz
2006-11-06 20:06   ` Jim Blandy
2006-11-06 23:24   ` Jim Blandy
2006-11-06 23:27     ` Daniel Jacobowitz

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