Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Fix a "pc ... in psymtab but not in symtab" internal error warning
Date: Mon, 06 Jan 2003 11:36:00 -0000	[thread overview]
Message-ID: <20030106113618.GV693@gnat.com> (raw)
In-Reply-To: <20030103191915.GA7201@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

> > 2003-01-03  J. Brobecker  <brobecker@gnat.com>
> > 
> >         * mdebugread.c (parse_symbol): Skip stProc entries which storage
> >         class is not scText. These do not define "real" procedures.
> >         (parse_partial_symbols): Likewise.
> > 
> > Ahem, ok to commit?
> 
> Yes, I think so.  Meanwhile, I recommend:
>  http://www.testdrive.hp.com/os/#tru64
> 
> I imagine they've got a C++ compiler available; yeah, it's a bit of a
> nuisance to use their systems, but...

Ok, I have tested my change in one of their machines. Announcement: I
had to install gcc + dejagnu there, so if anyone is interested: I
installed GNAT 3.16w (2.8.1 based) + dejagnu in /house/brobecke/osf/bin.

My change did not show any regression in the C++ directory (did not run
the other tests), although as Daniel suggested, the results are rather
modest. For the record:

        # of expected passes            878
        # of unexpected failures        276
        # of expected failures          7
        # of unresolved testcases       33

Here is a new patch, with the comments a bit expanded, as recommended
by Elena.

Should I check this in?

Thanks,
-- 
Joel

[-- Attachment #2: mdebugread.c.diff --]
[-- Type: text/plain, Size: 4526 bytes --]

Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 mdebugread.c
*** mdebugread.c	3 Jan 2003 15:34:59 -0000	1.35
--- mdebugread.c	6 Jan 2003 11:26:38 -0000
*************** parse_symbol (SYMR *sh, union aux_ext *a
*** 751,756 ****
--- 751,788 ----
  
      case stProc:		/* Procedure, usually goes into global block */
      case stStaticProc:		/* Static procedure, goes into current block */
+       /* For stProc symbol records, we need to check the storage class
+          as well, as only (stProc, scText) entries represent "real"
+          procedures - See the Compaq document titled "Object File /
+          Symbol Table Format Specification" for more information.
+          If the storage class is not scText, we discard the whole block
+          of symbol records for this stProc.  */
+       if (sh->st == stProc && sh->sc != scText)
+         {
+           char *ext_tsym = ext_sh;
+           int keep_counting = 1;
+           SYMR tsym;
+ 
+           while (keep_counting)
+             {
+               ext_tsym += external_sym_size;
+               (*swap_sym_in) (cur_bfd, ext_tsym, &tsym);
+               count++;
+               switch (tsym.st)
+                 {
+                   case stParam:
+                     break;
+                   case stEnd:
+                     keep_counting = 0;
+                     break;
+                   default:
+                     complaint (&symfile_complaints,
+                                "unknown symbol type 0x%x", sh->st);
+                     break;
+                 }
+             }
+           break;
+         }
        s = new_symbol (name);
        SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
        SYMBOL_CLASS (s) = LOC_BLOCK;
*************** parse_partial_symbols (struct objfile *o
*** 3323,3328 ****
--- 3355,3393 ----
  		  /* FALLTHROUGH */
  
  		case stProc:
+ 		  /* Ignore all parameter symbol records.  */
+ 		  if (sh.index >= hdr->iauxMax)
+ 		    {
+ 		      /* Should not happen, but does when cross-compiling
+ 		         with the MIPS compiler.  FIXME -- pull later.  */
+ 		      index_complaint (name);
+ 		      new_sdx = cur_sdx + 1;	/* Don't skip at all */
+ 		    }
+ 		  else
+ 		    new_sdx = AUX_GET_ISYM (fh->fBigendian,
+ 					    (debug_info->external_aux
+ 					     + fh->iauxBase
+ 					     + sh.index));
+ 
+ 		  if (new_sdx <= cur_sdx)
+ 		    {
+ 		      /* This should not happen either... FIXME.  */
+ 		      complaint (&symfile_complaints,
+ 				 "bad proc end in aux found from symbol %s",
+ 				 name);
+ 		      new_sdx = cur_sdx + 1;	/* Don't skip backward */
+ 		    }
+ 
+                   /* For stProc symbol records, we need to check the
+                      storage class as well, as only (stProc, scText)
+                      entries represent "real" procedures - See the
+                      Compaq document titled "Object File / Symbol Table
+                      Format Specification" for more information.  If the
+                      storage class is not scText, we discard the whole
+                      block of symbol records for this stProc.  */
+                   if (sh.st == stProc && sh.sc != scText)
+                     goto skip;
+ 
  		  /* Usually there is a local and a global stProc symbol
  		     for a function. This means that the function name
  		     has already been entered into the mimimal symbol table
*************** parse_partial_symbols (struct objfile *o
*** 3345,3373 ****
  					 &objfile->static_psymbols,
  				    0, sh.value, psymtab_language, objfile);
  
- 		  /* Skip over procedure to next one. */
- 		  if (sh.index >= hdr->iauxMax)
- 		    {
- 		      /* Should not happen, but does when cross-compiling
- 		         with the MIPS compiler.  FIXME -- pull later.  */
- 		      index_complaint (name);
- 		      new_sdx = cur_sdx + 1;	/* Don't skip at all */
- 		    }
- 		  else
- 		    new_sdx = AUX_GET_ISYM (fh->fBigendian,
- 					    (debug_info->external_aux
- 					     + fh->iauxBase
- 					     + sh.index));
  		  procaddr = sh.value;
- 
- 		  if (new_sdx <= cur_sdx)
- 		    {
- 		      /* This should not happen either... FIXME.  */
- 		      complaint (&symfile_complaints,
- 				 "bad proc end in aux found from symbol %s",
- 				 name);
- 		      new_sdx = cur_sdx + 1;	/* Don't skip backward */
- 		    }
  
  		  cur_sdx = new_sdx;
  		  (*swap_sym_in) (cur_bfd,
--- 3410,3416 ----

  reply	other threads:[~2003-01-06 11:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03 19:07 Joel Brobecker
2003-01-03 19:19 ` Daniel Jacobowitz
2003-01-06 11:36   ` Joel Brobecker [this message]
2003-01-06 15:00     ` Elena Zannoni
2003-01-07  7:11       ` Joel Brobecker
2003-01-03 19:30 ` Elena Zannoni
2003-01-06  7:59   ` Joel Brobecker
2003-01-06 15:00     ` Elena Zannoni
2003-01-06 16:18     ` Elena Zannoni

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=20030106113618.GV693@gnat.com \
    --to=brobecker@gnat.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