Add a comment briefly explaining partial symbols

Message ID 20190731221252.143637-1-cbiesinger@google.com
State New, archived
Headers

Commit Message

Terekhov, Mikhail via Gdb-patches July 31, 2019, 10:12 p.m. UTC
  Based on an explanation by tromey on IRC.

gdb/ChangeLog:

2019-07-31  Christian Biesinger  <cbiesinger@google.com>

	* objfiles.h (objfile): Add a comment describing partial symbols.
---
 gdb/objfiles.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
  

Comments

Simon Marchi July 31, 2019, 11:59 p.m. UTC | #1
On 2019-07-31 6:12 p.m., Christian Biesinger via gdb-patches wrote:
> Based on an explanation by tromey on IRC.
> 
> gdb/ChangeLog:
> 
> 2019-07-31  Christian Biesinger  <cbiesinger@google.com>
> 
> 	* objfiles.h (objfile): Add a comment describing partial symbols.
> ---
>  gdb/objfiles.h | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/objfiles.h b/gdb/objfiles.h
> index a0c106be3d..c7e0be1955 100644
> --- a/gdb/objfiles.h
> +++ b/gdb/objfiles.h
> @@ -382,7 +382,13 @@ private:
>     2.  Additional symbol files added by the add-symbol-file command,
>     3.  Shared library objfiles, added by ADD_SOLIB,  4.  symbol files
>     for modules that were loaded when GDB attached to a remote system
> -   (see remote-vx.c).  */
> +   (see remote-vx.c).
> +   
> +   GDB typically reads symbols twice -- first an initial scan which just
> +   reads "partial symbols"; these are partial information for the
> +   static/global symbols in a symbol file.  When later looking up symbols,
> +   objfile->sf->qf->lookup_symbol is used to check if we only have a partial
> +   symbol and if so, read and expand the full compunit.  */
>  
>  struct objfile
>  {
> 

Hi Christian,

Thanks, that LGTM.  But please wait a few days before pushing to see if others have things to add.

Simon
  
Terekhov, Mikhail via Gdb-patches Aug. 5, 2019, 3:37 p.m. UTC | #2
On Wed, Jul 31, 2019 at 6:59 PM Simon Marchi <simark@simark.ca> wrote:
>
> On 2019-07-31 6:12 p.m., Christian Biesinger via gdb-patches wrote:
> > Based on an explanation by tromey on IRC.
> >
> > gdb/ChangeLog:
> >
> > 2019-07-31  Christian Biesinger  <cbiesinger@google.com>
> >
> >       * objfiles.h (objfile): Add a comment describing partial symbols.
> > ---
> >  gdb/objfiles.h | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/gdb/objfiles.h b/gdb/objfiles.h
> > index a0c106be3d..c7e0be1955 100644
> > --- a/gdb/objfiles.h
> > +++ b/gdb/objfiles.h
> > @@ -382,7 +382,13 @@ private:
> >     2.  Additional symbol files added by the add-symbol-file command,
> >     3.  Shared library objfiles, added by ADD_SOLIB,  4.  symbol files
> >     for modules that were loaded when GDB attached to a remote system
> > -   (see remote-vx.c).  */
> > +   (see remote-vx.c).
> > +
> > +   GDB typically reads symbols twice -- first an initial scan which just
> > +   reads "partial symbols"; these are partial information for the
> > +   static/global symbols in a symbol file.  When later looking up symbols,
> > +   objfile->sf->qf->lookup_symbol is used to check if we only have a partial
> > +   symbol and if so, read and expand the full compunit.  */
> >
> >  struct objfile
> >  {
> >
>
> Hi Christian,
>
> Thanks, that LGTM.  But please wait a few days before pushing to see if others have things to add.

Thanks, pushed now.

Christian
  

Patch

diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index a0c106be3d..c7e0be1955 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -382,7 +382,13 @@  private:
    2.  Additional symbol files added by the add-symbol-file command,
    3.  Shared library objfiles, added by ADD_SOLIB,  4.  symbol files
    for modules that were loaded when GDB attached to a remote system
-   (see remote-vx.c).  */
+   (see remote-vx.c).
+   
+   GDB typically reads symbols twice -- first an initial scan which just
+   reads "partial symbols"; these are partial information for the
+   static/global symbols in a symbol file.  When later looking up symbols,
+   objfile->sf->qf->lookup_symbol is used to check if we only have a partial
+   symbol and if so, read and expand the full compunit.  */
 
 struct objfile
 {