Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't check PST is NULL in read_symtab
@ 2013-01-11  1:57 Yao Qi
  2013-01-11  4:52 ` Joel Brobecker
  0 siblings, 1 reply; 12+ messages in thread
From: Yao Qi @ 2013-01-11  1:57 UTC (permalink / raw)
  To: gdb-patches

Hi,
The "method" read_symtab of 'struct partial_symtab" is called in this
way,

  (*pst->read_symtab) (objfile, pst);

so argument PST can't be NULL.  This patch is to remove the checking
that PST is NULL.  I'll re-indent dwarf2_psymtab_to_symtab when check
this patch in.
Rebuild GDB for all targets.  Is it OK?

gdb:

2013-01-11  Yao Qi  <yao@codesourcery.com>

	* dbxread.c (dbx_psymtab_to_symtab_1): Don't check PST is NULL.
	* dwarf2read.c (dwarf2_psymtab_to_symtab): Likewise.
	* mdebugread.c (mdebug_psymtab_to_symtab): Likewise.
	* xcoffread.c (xcoff_psymtab_to_symtab_1): Likewise.
---
 gdb/dbxread.c    |    3 ---
 gdb/dwarf2read.c |    3 ---
 gdb/mdebugread.c |    3 ---
 gdb/xcoffread.c  |    3 ---
 4 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index ebe4237..8305a5d 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2406,9 +2406,6 @@ dbx_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
   struct cleanup *old_chain;
   int i;
 
-  if (!pst)
-    return;
-
   if (pst->readin)
     {
       fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in.  "
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e2088f1..f2d6a0a 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6410,8 +6410,6 @@ locate_pdi_sibling (const struct die_reader_specs *reader,
 static void
 dwarf2_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
 {
-  if (pst != NULL)
-    {
       if (pst->readin)
 	{
 	  warning (_("bug: psymtab for %s is already read in."),
@@ -6451,7 +6449,6 @@ dwarf2_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
 	  if (info_verbose)
 	    printf_filtered (_("done.\n"));
 	}
-    }
 
   process_cu_includes ();
 }
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 856ca9d..0be1095 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -278,9 +278,6 @@ static char *mdebug_next_symbol_text (struct objfile *);
 static void
 mdebug_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
 {
-  if (!pst)
-    return;
-
   if (info_verbose)
     {
       printf_filtered (_("Reading in symbols for %s..."), pst->filename);
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 9fe8621..f4dcae2 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1860,9 +1860,6 @@ xcoff_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
 static void
 xcoff_psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
 {
-  if (!pst)
-    return;
-
   if (pst->readin)
     {
       fprintf_unfiltered
-- 
1.7.7.6


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

end of thread, other threads:[~2013-01-14 12:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11  1:57 [PATCH] Don't check PST is NULL in read_symtab Yao Qi
2013-01-11  4:52 ` Joel Brobecker
2013-01-11 14:34   ` Tom Tromey
2013-01-11 14:56     ` Yao Qi
2013-01-11 15:06       ` Tom Tromey
2013-01-14 12:42         ` [committed]: " Yao Qi
2013-01-14 12:44         ` Yao Qi
2013-01-11 14:46   ` Yao Qi
2013-01-11 15:06     ` Joel Brobecker
2013-01-11 18:02       ` Pedro Alves
2013-01-11 18:44         ` Joel Brobecker
2013-01-14 12:42           ` Yao Qi

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