[RFA,1/6] Remove dead code in end_psymtab

Message ID 20180503223621.22544-2-tom@tromey.com
State Superseded
Headers show
Series
  • Make psymbols independent of the progspace
Related show

Commit Message

Tom Tromey May 3, 2018, 10:36 p.m.
I noticed that there is a bit of dead code in end_psymtab.
This deletes it.

Normally I would investigate a fix for the code.  However, considering
that the code has been this way a long time (since the first import to
sourceware) and considering that dbxread.c is not as important any
more, I think it's safe to just consider that there's no bug.

ChangeLog
2018-05-03  Tom Tromey  <tromey@redhat.com>

	* dbxread.c (end_psymtab): Remove dead code.
---
 gdb/ChangeLog | 4 ++++
 gdb/dbxread.c | 8 +-------
 2 files changed, 5 insertions(+), 7 deletions(-)

-- 
2.13.6

Comments

Keith Seitz June 1, 2018, 6:55 p.m. | #1
On 05/03/2018 03:36 PM, Tom Tromey wrote:
> Normally I would investigate a fix for the code.  However, considering

> that the code has been this way a long time (since the first import to

> sourceware) and considering that dbxread.c is not as important any

> more, I think it's safe to just consider that there's no bug.


I agree. If it's not tested and the comments aren't clear about what problem it is trying to solve, wait for a new bug report. :-)

IANAMBLGTM*

Keith

* "I am not a maintainer, but looks good to me."
Simon Marchi June 5, 2018, 7:41 p.m. | #2
On 2018-06-01 14:55, Keith Seitz wrote:
> On 05/03/2018 03:36 PM, Tom Tromey wrote:

>> Normally I would investigate a fix for the code.  However, considering

>> that the code has been this way a long time (since the first import to

>> sourceware) and considering that dbxread.c is not as important any

>> more, I think it's safe to just consider that there's no bug.

> 

> I agree. If it's not tested and the comments aren't clear about what

> problem it is trying to solve, wait for a new bug report. :-)

> 

> IANAMBLGTM*

> 

> Keith

> 

> * "I am not a maintainer, but looks good to me."


Thanks Keith for taking a look.  LGTM too.

Simon

Patch

diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index bdf4fb9c79..7acbb0ec8b 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2105,13 +2105,7 @@  dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
       ALL_OBJFILE_PSYMTABS (objfile, p1)
       {
 	if (p1->texthigh == 0 && p1->textlow != 0 && p1 != pst)
-	  {
-	    p1->texthigh = pst->textlow;
-	    /* If this file has only data, then make textlow match
-	       texthigh.  */
-	    if (p1->textlow == 0)
-	      p1->textlow = p1->texthigh;
-	  }
+	  p1->texthigh = pst->textlow;
       }
     }