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: [obish] -Wunused-function warnings


On Mon, 19 Jan 2004 13:31:23 -0500
Andrew Cagney <cagney@gnu.org> wrote:


src/gdb/ia64-tdep.c:3261: warning: `process_note_abi_tag_sections' defined but not used
src/gdb/ia64-tdep.c:342: warning: `read_sigcontext_register' defined but not used
src/gdb/ia64-tdep.c:654: warning: `ia64_read_fp' defined but not used


It appears to me that it's safe to remove these function definitions.

Jeff, would mind trying it out?  If everything still builds and runs
okay, the patch which removes these definitions is preapproved.

I've done this, committing the attached.


Andrew

2004-02-03  Andrew Cagney  <cagney@redhat.com>

	* ia64-tdep.c (read_sigcontext_register): Delete unused function.
	(process_note_abi_tag_sections): Delete unused function.
	(ia64_read_fp): Delete unused function.
	(gdbarch_extract_struct_value_address): Delete declaration.

Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.110
diff -u -r1.110 ia64-tdep.c
--- ia64-tdep.c	26 Jan 2004 20:52:10 -0000	1.110
+++ ia64-tdep.c	3 Feb 2004 22:20:51 -0000
@@ -102,7 +102,6 @@
 static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
 static gdbarch_skip_prologue_ftype ia64_skip_prologue;
 static gdbarch_extract_return_value_ftype ia64_extract_return_value;
-static gdbarch_extract_struct_value_address_ftype ia64_extract_struct_value_address;
 static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
 static struct type *is_float_or_hfa_type (struct type *t);
 
@@ -334,32 +333,6 @@
 };
 
 
-/* Read the given register from a sigcontext structure in the
-   specified frame.  */
-
-static CORE_ADDR
-read_sigcontext_register (struct frame_info *frame, int regnum)
-{
-  CORE_ADDR regaddr;
-
-  if (frame == NULL)
-    internal_error (__FILE__, __LINE__,
-		    "read_sigcontext_register: NULL frame");
-  if (!(get_frame_type (frame) == SIGTRAMP_FRAME))
-    internal_error (__FILE__, __LINE__,
-		    "read_sigcontext_register: frame not a signal trampoline");
-  if (SIGCONTEXT_REGISTER_ADDRESS == 0)
-    internal_error (__FILE__, __LINE__,
-		    "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0");
-
-  regaddr = SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regnum);
-  if (regaddr)
-    return read_memory_integer (regaddr, register_size (current_gdbarch, regnum));
-  else
-    internal_error (__FILE__, __LINE__,
-		    "read_sigcontext_register: Register %d not in struct sigcontext", regnum);
-}
-
 /* Extract ``len'' bits from an instruction bundle starting at
    bit ``from''.  */
 
@@ -650,18 +623,6 @@
 }
 
 static CORE_ADDR
-ia64_read_fp (void)
-{
-  /* We won't necessarily have a frame pointer and even if we do, it
-     winds up being extraordinarly messy when attempting to find the
-     frame chain.  So for the purposes of creating frames (which is
-     all deprecated_read_fp() is used for), simply use the stack
-     pointer value instead.  */
-  gdb_assert (SP_REGNUM >= 0);
-  return read_register (SP_REGNUM);
-}
-
-static CORE_ADDR
 ia64_read_pc (ptid_t ptid)
 {
   CORE_ADDR psr_value = read_register_pid (IA64_PSR_REGNUM, ptid);
@@ -3254,53 +3215,6 @@
 {
   *targ_addr = memaddr;
   *targ_len  = nr_bytes;
-}
-
-static void
-process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
-{
-  int *os_ident_ptr = obj;
-  const char *name;
-  unsigned int sectsize;
-
-  name = bfd_get_section_name (abfd, sect);
-  sectsize = bfd_section_size (abfd, sect);
-  if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
-    {
-      unsigned int name_length, data_length, note_type;
-      char *note = alloca (sectsize);
-
-      bfd_get_section_contents (abfd, sect, note,
-                                (file_ptr) 0, (bfd_size_type) sectsize);
-
-      name_length = bfd_h_get_32 (abfd, note);
-      data_length = bfd_h_get_32 (abfd, note + 4);
-      note_type   = bfd_h_get_32 (abfd, note + 8);
-
-      if (name_length == 4 && data_length == 16 && note_type == 1
-          && strcmp (note + 12, "GNU") == 0)
-	{
-	  int os_number = bfd_h_get_32 (abfd, note + 16);
-
-	  /* The case numbers are from abi-tags in glibc.  */
-	  switch (os_number)
-	    {
-	    case 0 :
-	      *os_ident_ptr = ELFOSABI_LINUX;
-	      break;
-	    case 1 :
-	      *os_ident_ptr = ELFOSABI_HURD;
-	      break;
-	    case 2 :
-	      *os_ident_ptr = ELFOSABI_SOLARIS;
-	      break;
-	    default :
-	      internal_error (__FILE__, __LINE__,
-			      "process_note_abi_sections: unknown OS number %d", os_number);
-	      break;
-	    }
-	}
-    }
 }
 
 static int

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