From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20432 invoked by alias); 7 Dec 2014 22:29:59 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 20410 invoked by uid 48); 7 Dec 2014 22:29:58 -0000 From: "xdje42 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/17687] New: linear search in cp_add_using_directive Date: Sun, 07 Dec 2014 22:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xdje42 at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00350.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17687 Bug ID: 17687 Summary: linear search in cp_add_using_directive Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: xdje42 at gmail dot com Filing this to remember a potential perf issue. I noticed this while debugging another issue. I had set a breakpoint on cp_add_using_directive and saw it being called once for each symbol thusly: (top-gdb) c Continuing. Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "", alias=0x0, declaration=0x7ffff05f5eb1 "clearerr", excludes=0x0, copy_names=0, obstack=0x16285f0) at ../../anon-ns-16874/gdb/cp-namespace.c:139 (top-gdb) Continuing. Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "", alias=0x0, declaration=0x7ffff05f71ce "fclose", excludes=0x0, copy_names=0, obstack=0x16285f0) at ../../anon-ns-16874/gdb/cp-namespace.c:139 (top-gdb) Continuing. Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "", alias=0x0, declaration=0x7ffff05f97dd "feof", excludes=0x0, copy_names=0, obstack=0x16285f0) at ../../anon-ns-16874/gdb/cp-namespace.c:139 (top-gdb) Continuing. Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "", alias=0x0, declaration=0x7ffff05f8356 "ferror", excludes=0x0, copy_names=0, obstack=0x16285f0) at ../../anon-ns-16874/gdb/cp-namespace.c:139 (top-gdb) Continuing. Breakpoint 3, cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "", alias=0x0, declaration=0x7ffff05fb494 "fflush", excludes=0x0, copy_names=0, obstack=0x16285f0) at ../../anon-ns-16874/gdb/cp-namespace.c:139 (top-gdb) Is this a potential perf issue? [both when reading debug info and later when doing lookups] (top-gdb) bt #0 cp_add_using_directive (dest=0x7ffff0659462 "std", src=0x866f92 "", alias=0x0, declaration=0x7ffff06562d6 "mbstate_t", excludes=0x0, copy_names=0, obstack=0x16285f0) at ../../anon-ns-16874/gdb/cp-namespace.c:139 #1 0x000000000062e254 in read_import_statement (die=0x1798f70, cu=0x16af3e0) at ../../anon-ns-16874/gdb/dwarf2read.c:8896 #2 0x000000000062ce73 in process_die (die=0x1798f70, cu=0x16af3e0) at ../../anon-ns-16874/gdb/dwarf2read.c:8234 #3 0x000000000063b3e0 in read_namespace (die=0x1798e30, cu=0x16af3e0) at ../../anon-ns-16874/gdb/dwarf2read.c:13898 #4 0x000000000062cd92 in process_die (die=0x1798e30, cu=0x16af3e0) at ../../anon-ns-16874/gdb/dwarf2read.c:8217 #5 0x000000000062e78b in read_file_scope (die=0x17d0290, cu=0x16af3e0) at ../../anon-ns-16874/gdb/dwarf2read.c:9057 #6 0x000000000062cc90 in process_die (die=0x17d0290, cu=0x16af3e0) at ../../anon-ns-16874/gdb/dwarf2read.c:8164 #7 0x000000000062c53e in process_full_comp_unit (per_cu=0x1627f40, pretend_language=language_minimal) at ../../anon-ns-16874/gdb/dwarf2read.c:7946 #8 0x000000000062b4ee in process_queue () at ../../anon-ns-16874/gdb/dwarf2read.c:7484 #9 0x00000000006207cc in dw2_do_instantiate_symtab (per_cu=0x1627f40) at ../../anon-ns-16874/gdb/dwarf2read.c:2638 #10 0x000000000062085e in dw2_instantiate_symtab (per_cu=0x1627f40) at ../../anon-ns-16874/gdb/dwarf2read.c:2659 #11 0x0000000000622f9a in dw2_lookup_symbol (objfile=0x1628590, block_index=0, name=0x1490640 "(anonymous namespace)", domain=VAR_DOMAIN) at ../../anon-ns-16874/gdb/dwarf2read.c:3612 #12 0x000000000059ac9c in lookup_symbol_via_quick_fns ( objfile=objfile@entry=0x1628590, block_index=block_index@entry=0, name=name@entry=0x1490640 "(anonymous namespace)", domain=domain@entry=VAR_DOMAIN) at ../../anon-ns-16874/gdb/symtab.c:1679 ... -- You are receiving this mail because: You are on the CC list for the bug.