Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@cygnus.com>
To: Christopher Faylor <cgf@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Simple but crucial bug fix to gdb
Date: Wed, 30 May 2001 15:16:00 -0000	[thread overview]
Message-ID: <3B15711D.BEA4B77E@cygnus.com> (raw)
In-Reply-To: <20010530173650.A21397@redhat.com>

Christopher Faylor wrote:
> 
> Assuming that I have properly tracked where this is in the current sources,
> I think that this change looks reasonable.  There is a similar check for
> pst being non-null a few lines up from this point and pst does not get
> set in the intervening space.  So, if the previous check is correct, then
> this one is obviously needed.
> 
> I've included a diff below with some extended context.  If there are no
> objections, I'll be happy to check this in.
> 

I cannot approve the patch because I am not the maintainer of the stabs reader, but (for the reasons you've explained above) this seems to fall clearly into the obvious fix rule.

Fernando



> 
> Index: partial-stab.h
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/partial-stab.h,v
> retrieving revision 1.7
> diff -c -2 -0 -p -r1.7 partial-stab.h
> *** partial-stab.h      2001/03/06 08:21:11     1.7
> --- partial-stab.h      2001/05/30 21:34:59
> *************** switch (CUR_SYMBOL_TYPE)
> *** 583,626 ****
>   #ifdef SOFUN_ADDRESS_MAYBE_MISSING
>         /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
>            value for the bottom of the text seg in those cases. */
>         if (pst && textlow_not_set)
>           {
>             pst->textlow =
>               find_stab_function_addr (namestring, pst->filename, objfile);
>             textlow_not_set = 0;
>           }
>   #endif
>         /* End kludge.  */
> 
>         /* Keep track of the start of the last function so we
>            can handle end of function symbols.  */
>         last_function_start = CUR_SYMBOL_VALUE;
> 
>         /* In reordered executables this function may lie outside
>            the bounds created by N_SO symbols.  If that's the case
>            use the address of this function as the low bound for
>            the partial symbol table.  */
> !       if (textlow_not_set
> !           || (pst && CUR_SYMBOL_VALUE < pst->textlow
> !               && CUR_SYMBOL_VALUE
> !               != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
>           {
>             pst->textlow = CUR_SYMBOL_VALUE;
>             textlow_not_set = 0;
>           }
>   #endif /* DBXREAD_ONLY */
>         add_psymbol_to_list (namestring, p - namestring,
>                              VAR_NAMESPACE, LOC_BLOCK,
>                              &objfile->static_psymbols,
>                              0, CUR_SYMBOL_VALUE,
>                              psymtab_language, objfile);
>         continue;
> 
>         /* Global functions were ignored here, but now they
>            are put into the global psymtab like one would expect.
>            They're also in the minimal symbol table.  */
>         case 'F':
>         CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
>   #ifdef DBXREAD_ONLY
>         /* Kludges for ELF/STABS with Sun ACC */
>         last_function_name = namestring;
> --- 583,627 ----
>   #ifdef SOFUN_ADDRESS_MAYBE_MISSING
>         /* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
>            value for the bottom of the text seg in those cases. */
>         if (pst && textlow_not_set)
>           {
>             pst->textlow =
>               find_stab_function_addr (namestring, pst->filename, objfile);
>             textlow_not_set = 0;
>           }
>   #endif
>         /* End kludge.  */
> 
>         /* Keep track of the start of the last function so we
>            can handle end of function symbols.  */
>         last_function_start = CUR_SYMBOL_VALUE;
> 
>         /* In reordered executables this function may lie outside
>            the bounds created by N_SO symbols.  If that's the case
>            use the address of this function as the low bound for
>            the partial symbol table.  */
> !       if (pst
> !           && (textlow_not_set
> !               || (pst && CUR_SYMBOL_VALUE < pst->textlow
> !                 && CUR_SYMBOL_VALUE
> !                 != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))))
>           {
>             pst->textlow = CUR_SYMBOL_VALUE;
>             textlow_not_set = 0;
>           }
>   #endif /* DBXREAD_ONLY */
>         add_psymbol_to_list (namestring, p - namestring,
>                              VAR_NAMESPACE, LOC_BLOCK,
>                              &objfile->static_psymbols,
>                              0, CUR_SYMBOL_VALUE,
>                              psymtab_language, objfile);
>         continue;
> 
>         /* Global functions were ignored here, but now they
>            are put into the global psymtab like one would expect.
>            They're also in the minimal symbol table.  */
>         case 'F':
>         CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
>   #ifdef DBXREAD_ONLY
>         /* Kludges for ELF/STABS with Sun ACC */
>         last_function_name = namestring;

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


  reply	other threads:[~2001-05-30 15:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-30 14:27 Charlie Mills
2001-05-30 14:36 ` Christopher Faylor
2001-05-30 15:16   ` Fernando Nasser [this message]
2001-05-30 20:18     ` Jim Blandy
2001-05-30 20:25       ` Christopher Faylor
2001-05-31  5:30       ` Fernando Nasser
2001-05-31 13:55         ` Jim Blandy
2001-05-31 14:43           ` Fernando Nasser
2001-05-31 16:46           ` Christopher Faylor
2001-05-31 17:40             ` Daniel Berlin
2001-05-31 20:00               ` Frank Ch. Eigler
2001-06-01  9:41                 ` Fernando Nasser
2001-06-01 10:01                 ` Michael Snyder
2001-06-01 11:14                   ` Daniel Berlin
2001-06-01 11:25                     ` Fernando Nasser
2001-06-01 14:05                       ` Charlie Mills
2001-06-06  6:01                 ` Andrew Cagney
2001-05-30 20:00   ` Christopher Faylor
2001-05-30 20:43     ` Christopher Faylor
2001-05-30 20:12 ` Jim Blandy
2001-05-30 21:23   ` Daniel Berlin
2001-06-01 13:35 ` Jim Blandy
2001-06-01 13:41   ` Fernando Nasser
2001-06-01 14:07   ` Daniel Berlin
2001-06-01 14:15     ` Jim Blandy
2001-06-01 14:17     ` Jim Blandy

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=3B15711D.BEA4B77E@cygnus.com \
    --to=fnasser@cygnus.com \
    --cc=cgf@redhat.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