Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fred Fish <fnf@fishpond.ninemoons.com>
To: gdb-patches@sources.redhat.com
Cc: fnf@redhat.com
Subject: RFA: Make lookup_minimal_symbol calls consistent
Date: Mon, 10 Dec 2001 11:19:00 -0000	[thread overview]
Message-ID: <200112101912.fBAJCWG31040@fishpond.ninemoons.com> (raw)

Most places in gdb call lookup_minimal_symbol with NULL for arguments
that are unspecified, however a few places still use 0.  This patch
makes all the calls consistently use NULL.

-Fred

2001-12-10  Fred Fish  <fnf@redhat.com>

	* arm-linux-tdep.c (skip_hurd_resolver): Use NULL rather than
	zero in args to lookup_minimal_symbol.
	* linespec.c (decode_line_1): Ditto.
	* i386-linux-tdep.c (skip_hurd_resolver): Ditto.
	* minsyms.c (find_stab_function_addr): Ditto.
	* symfile.c (simple_read_overlay_table): Ditto.
	(simple_read_overlay_region_table): Ditto.

Index: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.11
diff -u -p -r1.11 arm-linux-tdep.c
--- arm-linux-tdep.c	2001/08/21 04:31:32	1.11
+++ arm-linux-tdep.c	2001/12/10 18:25:01
@@ -402,7 +402,7 @@ skip_hurd_resolver (CORE_ADDR pc)
   if (resolver)
     {
       struct minimal_symbol *fixup
-	= lookup_minimal_symbol ("fixup", 0, objfile);
+	= lookup_minimal_symbol ("fixup", NULL, objfile);
 
       if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
 	return (SAVED_PC_AFTER_CALL (get_current_frame ()));
Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.9
diff -u -p -r1.9 i386-linux-tdep.c
--- i386-linux-tdep.c	2001/11/04 14:06:16	1.9
+++ i386-linux-tdep.c	2001/12/10 18:25:02
@@ -458,7 +458,7 @@ skip_hurd_resolver (CORE_ADDR pc)
   if (resolver)
     {
       struct minimal_symbol *fixup
-	= lookup_minimal_symbol ("fixup", 0, objfile);
+	= lookup_minimal_symbol ("fixup", NULL, objfile);
 
       if (fixup && SYMBOL_VALUE_ADDRESS (fixup) == pc)
 	return (SAVED_PC_AFTER_CALL (get_current_frame ()));
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.12
diff -u -p -r1.12 linespec.c
--- linespec.c	2001/11/10 21:34:56	1.12
+++ linespec.c	2001/12/10 18:25:05
@@ -1115,7 +1115,7 @@ decode_line_1 (char **argptr, int funfir
 	    goto symbol_found;
 
 	  /* If symbol was not found, look in minimal symbol tables */
-	  msymbol = lookup_minimal_symbol (copy, 0, 0);
+	  msymbol = lookup_minimal_symbol (copy, NULL, NULL);
 	  /* Min symbol was found --> jump to minsym processing. */
 	  if (msymbol)
 	    goto minimal_symbol_found;
Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.18
diff -u -p -r1.18 minsyms.c
--- minsyms.c	2001/10/12 19:07:07	1.18
+++ minsyms.c	2001/12/10 18:25:07
@@ -547,14 +547,14 @@ find_stab_function_addr (char *namestrin
     {
       /* Try again without the filename. */
       p[n] = 0;
-      msym = lookup_minimal_symbol (p, 0, objfile);
+      msym = lookup_minimal_symbol (p, NULL, objfile);
     }
   if (msym == NULL && filename != NULL)
     {
       /* And try again for Sun Fortran, but without the filename. */
       p[n] = '_';
       p[n + 1] = 0;
-      msym = lookup_minimal_symbol (p, 0, objfile);
+      msym = lookup_minimal_symbol (p, NULL, objfile);
     }
 
   return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.44
diff -u -p -r1.44 symfile.c
--- symfile.c	2001/12/02 22:38:23	1.44
+++ symfile.c	2001/12/10 18:25:15
@@ -3026,7 +3026,7 @@ simple_read_overlay_table (void)
   struct minimal_symbol *novlys_msym, *ovly_table_msym;
 
   simple_free_overlay_table ();
-  novlys_msym = lookup_minimal_symbol ("_novlys", 0, 0);
+  novlys_msym = lookup_minimal_symbol ("_novlys", NULL, NULL);
   if (! novlys_msym)
     {
       error ("Error reading inferior's overlay table: "
@@ -3035,7 +3035,7 @@ simple_read_overlay_table (void)
       return 0;
     }
 
-  ovly_table_msym = lookup_minimal_symbol ("_ovly_table", 0, 0);
+  ovly_table_msym = lookup_minimal_symbol ("_ovly_table", NULL, NULL);
   if (! ovly_table_msym)
     {
       error ("Error reading inferior's overlay table: couldn't find "
@@ -3064,7 +3064,7 @@ simple_read_overlay_region_table (void)
   struct minimal_symbol *msym;
 
   simple_free_overlay_region_table ();
-  msym = lookup_minimal_symbol ("_novly_regions", 0, 0);
+  msym = lookup_minimal_symbol ("_novly_regions", NULL, NULL);
   if (msym != NULL)
     cache_novly_regions = read_memory_integer (SYMBOL_VALUE_ADDRESS (msym), 4);
   else
@@ -3072,7 +3072,7 @@ simple_read_overlay_region_table (void)
   cache_ovly_region_table = (void *) xmalloc (cache_novly_regions * 12);
   if (cache_ovly_region_table != NULL)
     {
-      msym = lookup_minimal_symbol ("_ovly_region_table", 0, 0);
+      msym = lookup_minimal_symbol ("_ovly_region_table", NULL, NULL);
       if (msym != NULL)
 	{
 	  cache_ovly_region_table_base = SYMBOL_VALUE_ADDRESS (msym);
@@ -3142,7 +3142,7 @@ simple_overlay_update (struct obj_sectio
     if (cache_ovly_table != NULL)
       /* Does its cached location match what's currently in the symtab? */
       if (cache_ovly_table_base ==
-	  SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table", 0, 0)))
+	  SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table", NULL, NULL)))
 	/* Then go ahead and try to look up this single section in the cache */
 	if (simple_overlay_update_1 (osect))
 	  /* Found it!  We're done. */


             reply	other threads:[~2001-12-10 19:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-10 11:19 Fred Fish [this message]
2001-12-10 12:49 ` Jim Blandy

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=200112101912.fBAJCWG31040@fishpond.ninemoons.com \
    --to=fnf@fishpond.ninemoons.com \
    --cc=fnf@redhat.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