Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Prune some deadwood in dwarf2read.c:decode_locdesc
Date: Mon, 17 Nov 2003 04:19:00 -0000	[thread overview]
Message-ID: <20031117041950.GA22322@nevyn.them.org> (raw)

This patch is obvious; barring comments I'll commit it in a day or two.
Neither of these flags is checked any more now that LOC_COMPUTED is used.

The current status quo, by the way, is that there is one caller of
decode_locdesc left which checks these global flags.  I believe that that
call (for DW_AT_frame_base) is entirely dead and can be removed, after which
it will be possible to simplify decode_locdesc even further.  But it's
slightly less trivially dead, so I'll do that in a separate patch when I'm
more awake.

After that, decode_locdesc will only ever be used in places where we expect
a constant result - a global variable, a structure offset, et cetera. 
Everything else has been converted to LOC_COMPUTED and LOC_COMPUTED_ARG.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-11-16  Daniel Jacobowitz  <drow@mvista.com>

	* dwarf2read.c (optimized_out, islocal): Remove.
	(decode_locdesc): Update comments.  Don't set optimized_out
	or islocal.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.112
diff -u -p -r1.112 dwarf2read.c
--- dwarf2read.c	12 Nov 2003 17:10:55 -0000	1.112
+++ dwarf2read.c	17 Nov 2003 04:13:41 -0000
@@ -443,8 +443,6 @@ static struct pending **list_in_scope = 
    none of the flags are set, the object lives at the address returned
    by decode_locdesc.  */
 
-static int optimized_out;	/* No ops in location in expression,
-				   so object was optimized out.  */
 static int isreg;		/* Object lives in register.
 				   decode_locdesc's return value is
 				   the register number.  */
@@ -454,12 +452,6 @@ static int offreg;		/* Object's address 
 static int basereg;		/* See `offreg'.  */
 static int isderef;		/* Value described by flags above is
 				   the address of a pointer to the object.  */
-static int islocal;		/* Variable is at the returned offset
-				   from the frame start, but there's
-				   no identified frame pointer for
-				   this function, so we can't say
-				   which register it's relative to;
-				   use LOC_LOCAL.  */
 
 /* DW_AT_frame_base values for the current function.
    frame_base_reg is -1 if DW_AT_frame_base is missing, otherwise it
@@ -6891,8 +6883,10 @@ dwarf2_fundamental_type (struct objfile 
    FIXME: Implement more operations as necessary.
 
    A location description containing no operations indicates that the
-   object is optimized out. The global optimized_out flag is set for
-   those, the return value is meaningless.
+   object is optimized out.  The return value is meaningless for that case.
+   FIXME drow/2003-11-16: No callers check for this case any more; soon all
+   callers will only want a very basic result and this can become a
+   complaint.
 
    When the result is a register number, the global isreg flag is set,
    otherwise it is cleared.
@@ -6901,9 +6895,7 @@ dwarf2_fundamental_type (struct objfile 
    and the register number is returned in basereg, otherwise it is cleared.
 
    When the DW_OP_fbreg operation is encountered without a corresponding
-   DW_AT_frame_base attribute, the global islocal flag is set.
-   Hopefully the machine dependent code knows how to set up a virtual
-   frame pointer for the local references.
+   DW_AT_frame_base attribute, we complain.
 
    Note that stack[0] is unused except as a default error return.
    Note that stack overflow is not yet handled.  */
@@ -6927,12 +6919,9 @@ decode_locdesc (struct dwarf_block *blk,
   isreg = 0;
   offreg = 0;
   isderef = 0;
-  islocal = 0;
-  optimized_out = 1;
 
   while (i < size)
     {
-      optimized_out = 0;
       op = data[i++];
       switch (op)
 	{
@@ -7073,7 +7062,6 @@ decode_locdesc (struct dwarf_block *blk,
 	    {
 	      complaint (&symfile_complaints,
 			 "DW_AT_frame_base missing for DW_OP_fbreg");
-	      islocal = 1;
 	    }
 	  break;
 


             reply	other threads:[~2003-11-17  4:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-17  4:19 Daniel Jacobowitz [this message]
2003-11-18 21:52 ` 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=20031117041950.GA22322@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.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