public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/30174] New: Rework 'main' name yet again
@ 2023-02-26 16:33 tromey at sourceware dot org
  2023-02-26 16:33 ` [Bug symtab/30174] " tromey at sourceware dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-02-26 16:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

            Bug ID: 30174
           Summary: Rework 'main' name yet again
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

The new DWARF indexer broke 'main' handling for some languages.
This was bug #30116.

However, I wonder if the fix for #30116 made startup a bit slower
for C and C++ programs.  The problem here is that the patch
removed the checks for a function named "main".  So, we can
no longer tell the language of "main" without a symbol lookup.
But -- this means waiting for finalization to be complete.

One solution would be to resurrect some old patches to make
the main-name stuff lazy.  Partly that involved something like:

#define current_language lazily_compute_language()

Another idea would be to have a "quick" function that does this
work.  Right now we have lookup_global_symbol_language, which
is used for this and only has a single caller -- it could easily
be made more specific.

The idea here would be to simply assume that if the objfile
has any C++ code at all, then use C++ as the language; otherwise
use C.  Perhaps like other languages the symbol could just
be searched for in minsyms.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
@ 2023-02-26 16:33 ` tromey at sourceware dot org
  2023-02-26 16:34 ` tromey at sourceware dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-02-26 16:33 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |29366


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29366
[Bug 29366] [meta] New DWARF indexer meta bug
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
  2023-02-26 16:33 ` [Bug symtab/30174] " tromey at sourceware dot org
@ 2023-02-26 16:34 ` tromey at sourceware dot org
  2023-08-04 17:19 ` tromey at sourceware dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-02-26 16:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=30165

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
  2023-02-26 16:33 ` [Bug symtab/30174] " tromey at sourceware dot org
  2023-02-26 16:34 ` tromey at sourceware dot org
@ 2023-08-04 17:19 ` tromey at sourceware dot org
  2023-08-05  8:56 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-08-04 17:19 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Some of this is done on the background DWARF reader branch,
"t/bg-dwarf-reading" in my github.
It's not neatly organized or anything though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (2 preceding siblings ...)
  2023-08-04 17:19 ` tromey at sourceware dot org
@ 2023-08-05  8:56 ` vries at gcc dot gnu.org
  2023-08-05 14:00 ` vries at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2023-08-05  8:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #1)
> Some of this is done on the background DWARF reader branch,
> "t/bg-dwarf-reading" in my github.
> It's not neatly organized or anything though.

I build the branch (I had to build with gcc-12, I ran into a build breaker with
gcc-7), and checked that the gdb.base/main-c.exp and gdb.cp/main-cp.exp
test-cases of
https://sourceware.org/pipermail/gdb-patches/2023-August/201368.html do pass.

The test-cases starts passing at 0012-more-main-name.patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (3 preceding siblings ...)
  2023-08-05  8:56 ` vries at gcc dot gnu.org
@ 2023-08-05 14:00 ` vries at gcc dot gnu.org
  2023-08-06 15:03 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2023-08-05 14:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
I've picked the relevant patches, rebased to current trunk, and ran the
testsuite.

https://github.com/vries/gdb/tree/symtab/tromey/compute-main-name

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (4 preceding siblings ...)
  2023-08-05 14:00 ` vries at gcc dot gnu.org
@ 2023-08-06 15:03 ` tromey at sourceware dot org
  2023-08-06 22:22 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-08-06 15:03 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
> I build the branch (I had to build with gcc-12, I ran into a build breaker
> with gcc-7)

What was that?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (5 preceding siblings ...)
  2023-08-06 15:03 ` tromey at sourceware dot org
@ 2023-08-06 22:22 ` vries at gcc dot gnu.org
  2023-10-24 19:40 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2023-08-06 22:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #4)
> > I build the branch (I had to build with gcc-12, I ran into a build breaker
> > with gcc-7)
> 
> What was that?

This one:
...
In file included from /data/vries/gdb/src/gdb/dwarf2/cooked-index.h:39:0,
                 from /data/vries/gdb/src/gdb/dwarf2/cooked-index.c:21:
/data/vries/gdb/src/gdb/../gdbsupport/task-group.h:90:34: error: use of deleted
function ‘std::ato\
mic<int>::atomic(const std::atomic<int>&)’
   std::atomic<int> m_completed = 0;
                                  ^
In file included from /usr/include/c++/7/future:42:0,
                 from /data/vries/gdb/src/gdb/../gdbsupport/thread-pool.h:31,
                 from /data/vries/gdb/src/gdb/dwarf2/cooked-index.h:33,
                 from /data/vries/gdb/src/gdb/dwarf2/cooked-index.c:21:
/usr/include/c++/7/atomic:668:7: note: declared here
       atomic(const atomic&) = delete;
       ^~~~~~
/usr/include/c++/7/atomic:672:17: note:   after user-defined conversion:
constexpr std::atomic<int\
>::atomic(std::atomic<int>::__integral_type)
       constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
                 ^~~~~~
...
and two more like it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (6 preceding siblings ...)
  2023-08-06 22:22 ` vries at gcc dot gnu.org
@ 2023-10-24 19:40 ` tromey at sourceware dot org
  2023-10-25  8:43 ` sam at gentoo dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-10-24 19:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
I did this as part of the background DWARF reading project.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (7 preceding siblings ...)
  2023-10-24 19:40 ` tromey at sourceware dot org
@ 2023-10-25  8:43 ` sam at gentoo dot org
  2023-11-12 23:27 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: sam at gentoo dot org @ 2023-10-25  8:43 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (8 preceding siblings ...)
  2023-10-25  8:43 ` sam at gentoo dot org
@ 2023-11-12 23:27 ` tromey at sourceware dot org
  2024-01-09  1:46 ` cvs-commit at gcc dot gnu.org
  2024-01-09  1:49 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2023-11-12 23:27 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2023-November/203984.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (9 preceding siblings ...)
  2023-11-12 23:27 ` tromey at sourceware dot org
@ 2024-01-09  1:46 ` cvs-commit at gcc dot gnu.org
  2024-01-09  1:49 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-09  1:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

--- Comment #8 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=33c6eaaefcedd45e86d564d014f14cce2620f933

commit 33c6eaaefcedd45e86d564d014f14cce2620f933
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Mar 24 23:35:02 2023 -0600

    Do more DWARF reading in the background

    This patch rearranges the DWARF reader so that more work is done in
    the background.  This is PR symtab/29942.

    The idea here is that there is only a small amount of work that must
    be done on the main thread when scanning DWARF -- before the main
    scan, the only part is mapping the section data.

    Currently, the DWARF reader uses the quick_symbol_functions "lazy"
    functionality to defer even starting to read.  This patch instead
    changes the reader to start reading immediately, but doing more in
    worker tasks.

    Before this patch, "file" on my machine:

        (gdb) file /tmp/gdb
        2023-10-23 12:29:56.885 - command started
        Reading symbols from /tmp/gdb...
        2023-10-23 12:29:58.047 - command finished
        Command execution time: 5.867228 (cpu), 1.162444 (wall)

    After the patch, more work is done in the background and so this takes
    a bit less time:

        (gdb) file /tmp/gdb
        2023-10-23 13:25:51.391 - command started
        Reading symbols from /tmp/gdb...
        2023-10-23 13:25:51.712 - command finished
        Command execution time: 1.894500 (cpu), 0.320306 (wall)

    I think this could be further sped up by using the shared library load
    map to avoid objfile loops like the one in expand_symtab_containing_pc
    -- it seems like the correct objfile could be chosen more directly.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29942
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30174

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug symtab/30174] Rework 'main' name yet again
  2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
                   ` (10 preceding siblings ...)
  2024-01-09  1:46 ` cvs-commit at gcc dot gnu.org
@ 2024-01-09  1:49 ` tromey at sourceware dot org
  11 siblings, 0 replies; 13+ messages in thread
From: tromey at sourceware dot org @ 2024-01-09  1:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30174

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |15.1

--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-09  1:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-26 16:33 [Bug symtab/30174] New: Rework 'main' name yet again tromey at sourceware dot org
2023-02-26 16:33 ` [Bug symtab/30174] " tromey at sourceware dot org
2023-02-26 16:34 ` tromey at sourceware dot org
2023-08-04 17:19 ` tromey at sourceware dot org
2023-08-05  8:56 ` vries at gcc dot gnu.org
2023-08-05 14:00 ` vries at gcc dot gnu.org
2023-08-06 15:03 ` tromey at sourceware dot org
2023-08-06 22:22 ` vries at gcc dot gnu.org
2023-10-24 19:40 ` tromey at sourceware dot org
2023-10-25  8:43 ` sam at gentoo dot org
2023-11-12 23:27 ` tromey at sourceware dot org
2024-01-09  1:46 ` cvs-commit at gcc dot gnu.org
2024-01-09  1:49 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).