This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Don't check PST is NULL in read_symtab
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 11 Jan 2013 09:57:20 +0800
- Subject: [PATCH] Don't check PST is NULL in read_symtab
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