[binutils-gdb] Specialize partial_symtab for DWARF include files

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[binutils-gdb] Specialize partial_symtab for DWARF include files

gdb-buildbot
*** TEST RESULTS FOR COMMIT b83470bfa7ca200b1c99caac5f6d56bffe0261d0 ***

commit b83470bfa7ca200b1c99caac5f6d56bffe0261d0
Author:     Tom Tromey <[hidden email]>
AuthorDate: Wed Feb 26 15:41:07 2020 -0700
Commit:     Tom Tromey <[hidden email]>
CommitDate: Wed Feb 26 15:49:50 2020 -0700

    Specialize partial_symtab for DWARF include files
   
    Include files are represented by a partial symtab, but don't expand to
    anything.  From dwarf2_psymtab::expand_psymtab:
   
      if (per_cu == NULL)
        {
          /* It's an include file, no symbols to read for it.
             Everything is in the parent symtab.  */
          readin = true;
          return;
        }
   
    This patch introduces a new specialization of partial_symtab to handle
    this case.  In addition to being slightly smaller, I believe an
    include file is the only situation where a DWARF psymtab can result in
    a null compunit_symtab.  This adds an assert to that effect as well.
    This change will simplify one of the psymtab sharing patches.
   
    gdb/ChangeLog
    2020-02-26  Tom Tromey  <[hidden email]>
   
            * dwarf2/read.c (struct dwarf2_include_psymtab): New.
            (dwarf2_create_include_psymtab): Use dwarf2_include_psymtab.
            (dwarf2_psymtab::expand_psymtab, dwarf2_psymtab::readin_p)
            (dwarf2_psymtab::get_compunit_symtab): Remove null checks for
            per_cu_data.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2bb65e7eae..2f92b0a7cd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2020-02-26  Tom Tromey  <[hidden email]>
+
+ * dwarf2/read.c (struct dwarf2_include_psymtab): New.
+ (dwarf2_create_include_psymtab): Use dwarf2_include_psymtab.
+ (dwarf2_psymtab::expand_psymtab, dwarf2_psymtab::readin_p)
+ (dwarf2_psymtab::get_compunit_symtab): Remove null checks for
+ per_cu_data.
+
 2020-02-26  Tom Tromey  <[hidden email]>
 
  * dwarf2/index-write.c (psym_index_map): Change type.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index d6b34d8586..c5f0ffa0d9 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -5918,6 +5918,44 @@ read_abbrev_offset (struct dwarf2_per_objfile *dwarf2_per_objfile,
   return (sect_offset) read_offset (abfd, info_ptr, offset_size);
 }
 
+/* A partial symtab that is used only for include files.  */
+struct dwarf2_include_psymtab : public partial_symtab
+{
+  dwarf2_include_psymtab (const char *filename, struct objfile *objfile)
+    : partial_symtab (filename, objfile)
+  {
+  }
+
+  void read_symtab (struct objfile *objfile) override
+  {
+    expand_psymtab (objfile);
+  }
+
+  void expand_psymtab (struct objfile *objfile) override
+  {
+    if (m_readin)
+      return;
+    /* It's an include file, no symbols to read for it.
+       Everything is in the parent symtab.  */
+    read_dependencies (objfile);
+    m_readin = true;
+  }
+
+  bool readin_p () const override
+  {
+    return m_readin;
+  }
+
+  struct compunit_symtab *get_compunit_symtab () const override
+  {
+    return nullptr;
+  }
+
+private:
+
+  bool m_readin = false;
+};
+
 /* Allocate a new partial symtab for file named NAME and mark this new
    partial symtab as being an include of PST.  */
 
@@ -5925,7 +5963,7 @@ static void
 dwarf2_create_include_psymtab (const char *name, dwarf2_psymtab *pst,
                                struct objfile *objfile)
 {
-  dwarf2_psymtab *subpst = new dwarf2_psymtab (name, objfile);
+  dwarf2_include_psymtab *subpst = new dwarf2_include_psymtab (name, objfile);
 
   if (!IS_ABSOLUTE_PATH (subpst->filename))
     {
@@ -5936,11 +5974,6 @@ dwarf2_create_include_psymtab (const char *name, dwarf2_psymtab *pst,
   subpst->dependencies = objfile->partial_symtabs->allocate_dependencies (1);
   subpst->dependencies[0] = pst;
   subpst->number_of_dependencies = 1;
-
-  /* No private part is necessary for include psymtabs.  This property
-     can be used to differentiate between such include psymtabs and
-     the regular ones.  */
-  subpst->per_cu_data = nullptr;
 }
 
 /* Read the Line Number Program data and extract the list of files
@@ -8851,24 +8884,13 @@ process_queue (struct dwarf2_per_objfile *dwarf2_per_objfile)
 void
 dwarf2_psymtab::expand_psymtab (struct objfile *objfile)
 {
-  struct dwarf2_per_cu_data *per_cu;
-
   if (readin)
     return;
 
   read_dependencies (objfile);
 
-  per_cu = per_cu_data;
-
-  if (per_cu == NULL)
-    {
-      /* It's an include file, no symbols to read for it.
-         Everything is in the parent symtab.  */
-      readin = true;
-      return;
-    }
-
-  dw2_do_instantiate_symtab (per_cu, false);
+  dw2_do_instantiate_symtab (per_cu_data, false);
+  gdb_assert (get_compunit_symtab () != nullptr);
 }
 
 /* Trivial hash function for die_info: the hash value of a DIE
Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-i686, branch master

gdb-buildbot
Buildername:
        Fedora-i686

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/18/builds/2324

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-i686/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m32

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/17/builds/2320

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-cc-with-index, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-cc-with-index

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/20/builds/2271

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.base/continue-all-already-running.exp: breakpoint hit
new UNRESOLVED: gdb.base/infcall-nested-structs.exp: l=c++: types-tll-td: failed to compile
PASS -> FAIL: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : second pass: run to foo
new KFAIL: gdb.reverse/fstatat-reverse.exp: continue to breakpoint: marker2
new KFAIL: gdb.reverse/until-reverse.exp: advance factorial
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print i3
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m64

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/3/builds/2381

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i02
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i12
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i22
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print i3
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m32

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/4/builds/2216

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : second pass: run to foo
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: print re_run_var_1
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=2: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=2: print re_run_var_2
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m64

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/2/builds/2216

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print i3
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by gdb-buildbot
Buildername:
        Ubuntu-Aarch64-m64

Worker:
        ubuntu-aarch64

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/8/builds/2202

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by gdb-buildbot
Buildername:
        Ubuntu-Aarch64-native-extended-gdbserver-m64

Worker:
        ubuntu-aarch64

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/5/builds/2101

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : second pass: run to foo
PASS -> UNRESOLVED: gdb.threads/attach-into-signal.exp: threaded: attach
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-extended-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-gdbserver-m64

Worker:
        fedora-x86-64-2

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/22/builds/2217

Author:
        Tom Tromey <[hidden email]>

Commit tested:
        b83470bfa7ca200b1c99caac5f6d56bffe0261d0

Subject of commit:
        Specialize partial_symtab for DWARF include files

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i02
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i12
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i22
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print j
PASS -> FAIL: gdb.trace/mi-tsv-changed.exp: create delete modify: tvariable $tvar3 modified
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/b8/b83470bfa7ca200b1c99caac5f6d56bffe0261d0//xfail.table.gz>