From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29055 invoked by alias); 14 Dec 2011 17:21:39 -0000 Received: (qmail 29031 invoked by uid 22791); 14 Dec 2011 17:21:39 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GD X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Dec 2011 17:21:27 +0000 From: "l.lunak at suse dot cz" To: gdb-prs@sourceware.org Subject: [Bug gdb/13498] New: save-index makes gdb slow with dwarf4 Date: Wed, 14 Dec 2011 17:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: l.lunak at suse dot cz X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2011-q4/txt/msg00522.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13498 Bug #: 13498 Summary: save-index makes gdb slow with dwarf4 Product: gdb Version: HEAD Status: NEW Severity: minor Priority: P2 Component: gdb AssignedTo: unassigned@sourceware.org ReportedBy: l.lunak@suse.cz Classification: Unclassified When using the gdb-add-index script in order to modify binaries for faster load in gdb, some operations such as tab completion of function names are noticeably slower if the binaries have been built with -gdwarf-4. I experience the problem on openSUSE 11.4 with a git LibreOffice build, using gdb-weekly-7.3.50.20111213.tar.bz2 snapshot built from source. Steps to reproduce: 1) Build LibreOffice with -gdwarf-4 (http://wiki.documentfoundation.org/Development/Native_Build , --enable-debug passed to autogen/configure, current git uses -gdwarf-4 by default if supported, otherwise can be passed manually by invoking make as 'CFLAGS="-gdwarf-4" CXXFLAGS="-gdwarf-4" make') 2) Run LibreOffice, open an empty Writer document, type in something and save as a .docx document. 3) Attach gdb, type 'break DocxA', watch the time it took to complete the name to DocxAttributeOutput. Try repeatedly (second time it's faster). 4) Modify LibreOffice binaries using the gdb-add-index script (for dev-install build they are in solver/*/lib/, for normal install they are in basis3.4/program/). 5) Repeat steps 2) and 3), watch the increased time needed to complete the function name (second completion takes at most 1 second without the saved index and more than 5 seconds with it, and this is a fast machine). The problem presumably exists in other scenarios and other codebases, assuming they are large enough to make the slowness noticeable. Further information: - using dwarf4 instead of dwarf2 saves about 30% size of LibreOffice's binaries when built with debug info - the problem does not seem to exist when building with -gdwarf-2 - the debug flag passed to gcc/g++ is -ggdb2 (besides the -gdwarf-2/4) - the .gdb_index sections in the binaries appear to be loaded both with dwarf2 and dwarf4 by gdb, the load time is faster and memory usage is lower - when examining /proc//status of gdb, in the case of .gdb_index and dwarf4, VmHWM and VmData are almost the same, while in the dwarf2 case the VmHWM is about 20% larger than VmData (perhaps in the dwarf2 case gdb generates additional internal data that is not generated in the dwarf4 case and that causes this?) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.