This is the mail archive of the gdb-patches@sourceware.org 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]

[rfc][1/3] Eliminate LOC_INDIRECT and LOC_HP_THREAD_LOCAL_STATIC


Hello,

in recent discussions I noticed that the LOC_INDIRECT symbol address
class is no longer set by any symbol reader since the HPUX reader
was removed.  The same is true for LOC_HP_THREAD_LOCAL_STATIC.

The following patch removes the remaining (dead) code that attempts
to handle this address class.

Tested (together with the other two patches) on powerpc-linux,
powerpc64-linux, and spu-elf.

Does anybody object to removing these address classes?

Bye,
Ulrich


ChangeLog:

	* symtab.h (enum address_class): Remove LOC_INDIRECT and
	LOC_HP_THREAD_LOCAL_STATIC.

	* findvar.c (symbol_read_needs_frame, read_var_value): Do not
	handle LOC_INDIRECT or LOC_HP_THREAD_LOCAL_STATIC.
	(read_var_value): Likewise.
	* buildsym.c (finish_block): Likewise.
	* objfiles.c (objfile_relocate): Likewise.
	* printcmd.c (address_info): Likewise.
	* symmisc.c (print_symbol, print_partial_symbols): Likewise.
	* tracepoint.c (scope_info): Likewise.


diff -urNp gdb-orig/gdb/buildsym.c gdb-head/gdb/buildsym.c
--- gdb-orig/gdb/buildsym.c	2008-04-21 15:19:39.000000000 +0200
+++ gdb-head/gdb/buildsym.c	2008-05-19 17:56:59.352065387 +0200
@@ -297,7 +297,6 @@ finish_block (struct symbol *symbol, str
 		case LOC_UNDEF:
 		case LOC_CONST:
 		case LOC_STATIC:
-		case LOC_INDIRECT:
 		case LOC_REGISTER:
 		case LOC_LOCAL:
 		case LOC_TYPEDEF:
@@ -340,7 +339,6 @@ finish_block (struct symbol *symbol, str
 		    case LOC_UNDEF:
 		    case LOC_CONST:
 		    case LOC_STATIC:
-		    case LOC_INDIRECT:
 		    case LOC_REGISTER:
 		    case LOC_LOCAL:
 		    case LOC_TYPEDEF:
diff -urNp gdb-orig/gdb/findvar.c gdb-head/gdb/findvar.c
--- gdb-orig/gdb/findvar.c	2008-05-01 01:19:59.000000000 +0200
+++ gdb-head/gdb/findvar.c	2008-05-19 17:55:43.187389516 +0200
@@ -362,13 +362,11 @@ symbol_read_needs_frame (struct symbol *
     case LOC_LOCAL_ARG:
     case LOC_BASEREG:
     case LOC_BASEREG_ARG:
-    case LOC_HP_THREAD_LOCAL_STATIC:
       return 1;
 
     case LOC_UNDEF:
     case LOC_CONST:
     case LOC_STATIC:
-    case LOC_INDIRECT:
     case LOC_TYPEDEF:
 
     case LOC_LABEL:
@@ -457,24 +455,6 @@ read_var_value (struct symbol *var, stru
 	addr = SYMBOL_VALUE_ADDRESS (var);
       break;
 
-    case LOC_INDIRECT:
-      {
-	/* The import slot does not have a real address in it from the
-	   dynamic loader (dld.sl on HP-UX), if the target hasn't
-	   begun execution yet, so check for that. */
-	CORE_ADDR locaddr;
-	struct value *loc;
-	if (!target_has_execution)
-	  error (_("\
-Attempt to access variable defined in different shared object or load module when\n\
-addresses have not been bound by the dynamic loader. Try again when executable is running."));
-
-	locaddr = SYMBOL_VALUE_ADDRESS (var);
-	loc = value_at (lookup_pointer_type (type), locaddr);
-	addr = value_as_address (loc);
-	break;
-      }
-
     case LOC_ARG:
       if (frame == NULL)
 	return 0;
@@ -509,7 +489,6 @@ addresses have not been bound by the dyn
 
     case LOC_BASEREG:
     case LOC_BASEREG_ARG:
-    case LOC_HP_THREAD_LOCAL_STATIC:
       {
 	struct value *regval;
 
diff -urNp gdb-orig/gdb/objfiles.c gdb-head/gdb/objfiles.c
--- gdb-orig/gdb/objfiles.c	2008-05-11 23:02:59.000000000 +0200
+++ gdb-head/gdb/objfiles.c	2008-05-19 17:57:35.459353867 +0200
@@ -597,8 +597,7 @@ objfile_relocate (struct objfile *objfil
 	         But I'm leaving out that test, on the theory that
 	         they can't possibly pass the tests below.  */
 	      if ((SYMBOL_CLASS (sym) == LOC_LABEL
-		   || SYMBOL_CLASS (sym) == LOC_STATIC
-		   || SYMBOL_CLASS (sym) == LOC_INDIRECT)
+		   || SYMBOL_CLASS (sym) == LOC_STATIC)
 		  && SYMBOL_SECTION (sym) >= 0)
 		{
 		  SYMBOL_VALUE_ADDRESS (sym) +=
diff -urNp gdb-orig/gdb/printcmd.c gdb-head/gdb/printcmd.c
--- gdb-orig/gdb/printcmd.c	2008-05-19 17:49:27.025146000 +0200
+++ gdb-head/gdb/printcmd.c	2008-05-19 17:56:24.182776879 +0200
@@ -1150,20 +1150,6 @@ address_info (char *exp, int from_tty)
 	}
       break;
 
-    case LOC_INDIRECT:
-      printf_filtered (_("external global (indirect addressing), at address *("));
-      fputs_filtered (paddress (load_addr = SYMBOL_VALUE_ADDRESS (sym)),
-		      gdb_stdout);
-      printf_filtered (")");
-      if (section_is_overlay (section))
-	{
-	  load_addr = overlay_unmapped_address (load_addr, section);
-	  printf_filtered (_(",\n -- loaded at "));
-	  fputs_filtered (paddress (load_addr), gdb_stdout);
-	  printf_filtered (_(" in overlay section %s"), section->name);
-	}
-      break;
-
     case LOC_REGPARM:
       printf_filtered (_("an argument in register %s"),
 			 gdbarch_register_name (current_gdbarch, val));
@@ -1241,12 +1227,6 @@ address_info (char *exp, int from_tty)
       }
       break;
 
-    case LOC_HP_THREAD_LOCAL_STATIC:
-      printf_filtered (_("\
-a thread-local variable at offset %ld from the thread base register %s"),
-		       val, gdbarch_register_name (current_gdbarch, basereg));
-      break;
-
     case LOC_OPTIMIZED_OUT:
       printf_filtered (_("optimized out"));
       break;
diff -urNp gdb-orig/gdb/symmisc.c gdb-head/gdb/symmisc.c
--- gdb-orig/gdb/symmisc.c	2008-04-03 20:19:16.000000000 +0200
+++ gdb-head/gdb/symmisc.c	2008-05-19 17:56:45.571907851 +0200
@@ -642,12 +642,6 @@ print_symbol (void *args)
 			       SYMBOL_BFD_SECTION (symbol)));
 	  break;
 
-	case LOC_INDIRECT:
-	  fprintf_filtered (outfile, "extern global at *(");
-	  fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (symbol)), outfile);
-	  fprintf_filtered (outfile, "),");
-	  break;
-
 	case LOC_REGISTER:
 	  fprintf_filtered (outfile, "register %ld", SYMBOL_VALUE (symbol));
 	  break;
@@ -832,9 +826,6 @@ print_partial_symbols (struct partial_sy
 	case LOC_STATIC:
 	  fputs_filtered ("static", outfile);
 	  break;
-	case LOC_INDIRECT:
-	  fputs_filtered ("extern global", outfile);
-	  break;
 	case LOC_REGISTER:
 	  fputs_filtered ("register", outfile);
 	  break;
diff -urNp gdb-orig/gdb/symtab.c gdb-head/gdb/symtab.c
--- gdb-orig/gdb/symtab.c	2008-05-19 17:49:27.072139000 +0200
+++ gdb-head/gdb/symtab.c	2008-05-19 17:57:09.010147090 +0200
@@ -1116,7 +1116,6 @@ fixup_symbol_section (struct symbol *sym
     {
     case LOC_STATIC:
     case LOC_LABEL:
-    case LOC_INDIRECT:
       addr = SYMBOL_VALUE_ADDRESS (sym);
       break;
     case LOC_BLOCK:
@@ -1151,7 +1150,6 @@ fixup_psymbol_section (struct partial_sy
     {
     case LOC_STATIC:
     case LOC_LABEL:
-    case LOC_INDIRECT:
     case LOC_BLOCK:
       addr = SYMBOL_VALUE_ADDRESS (psym);
       break;
diff -urNp gdb-orig/gdb/symtab.h gdb-head/gdb/symtab.h
--- gdb-orig/gdb/symtab.h	2008-05-19 17:49:27.079138000 +0200
+++ gdb-head/gdb/symtab.h	2008-05-19 17:55:07.212082116 +0200
@@ -524,26 +524,11 @@ enum address_class
 
   LOC_UNRESOLVED,
 
-  /* Value is at a thread-specific location calculated by a
-     target-specific method. This is used only by hppa.  */
-
-  LOC_HP_THREAD_LOCAL_STATIC,
-
   /* The variable does not actually exist in the program.
      The value is ignored.  */
 
   LOC_OPTIMIZED_OUT,
 
-  /* The variable is static, but actually lives at * (address).
-   * I.e. do an extra indirection to get to it.
-   * This is used on HP-UX to get at globals that are allocated
-   * in shared libraries, where references from images other
-   * than the one where the global was allocated are done
-   * with a level of indirection.
-   */
-
-  LOC_INDIRECT,
-
   /* The variable's address is computed by a set of location
      functions (see "struct symbol_ops" below).  */
   LOC_COMPUTED,
diff -urNp gdb-orig/gdb/tracepoint.c gdb-head/gdb/tracepoint.c
--- gdb-orig/gdb/tracepoint.c	2008-05-11 23:07:15.000000000 +0200
+++ gdb-head/gdb/tracepoint.c	2008-05-19 17:56:04.167580248 +0200
@@ -2520,13 +2520,6 @@ scope_info (char *args, int from_tty)
 	    case LOC_OPTIMIZED_OUT:
 	      printf_filtered ("optimized out.\n");
 	      continue;
-	    case LOC_HP_THREAD_LOCAL_STATIC:
-	      printf_filtered ("HP thread local static ");
-	      break;
-	    case LOC_INDIRECT:
-	      printf_filtered ("extern (local indirect) at address ");
-	      printf_filtered ("%s", paddress (SYMBOL_VALUE_ADDRESS (sym)));
-	      break;
 	    case LOC_COMPUTED:
 	    case LOC_COMPUTED_ARG:
 	      SYMBOL_OPS (sym)->describe_location (sym, gdb_stdout);
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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