Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] Don't check PST is NULL in read_symtab
Date: Fri, 11 Jan 2013 01:57:00 -0000	[thread overview]
Message-ID: <1357869440-23451-1-git-send-email-yao@codesourcery.com> (raw)

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


             reply	other threads:[~2013-01-11  1:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11  1:57 Yao Qi [this message]
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

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=1357869440-23451-1-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /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