unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Markus Grunwald <markus.grunwald@gmx.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: gud : Phase error in gdb-pre-prompt (got pre-emacs)
Date: Sat, 28 Jun 2008 11:49:53 +1200	[thread overview]
Message-ID: <18533.31905.273260.594090@kahikatea.snap.net.nz> (raw)
In-Reply-To: <4864f7c5$0$6607$9b4e6d93@newsspool2.arcor-online.net>

 > I tried again with "gdb --annotate=3" (= without binary as parameter) and
 > loaded the binary with
 > (gdb) file binary.bin
 > There was no "initialising..." message visible and I could start
 > immediately. What's the difference ?

Emacs just builds a list of filenames from GDB that were used to build the
executable.  If you specify the name later in the GUD buffer, it doesn't build
that list.  That makes it quicker but if there are relevant files in existing
buffers or you visit them they won't be enabled for debugging, e.g., you won't
be able to click in the fringe to set a breakpoint until execution has already
stopped there.

 > > There are several factors that might make this slow:
 > > 
 > > 1) An executable that was created from a large number of files.
 > 
 > gru@PT-AGCMLX1 >find . \( -name \*.cpp -o -name \*.h \) | wc -l
 > 3072
 > 
 > Would this qualify as "large" ? ;)

A similar command for Emacs gives 375, so, ..err yes, that does sound rather
large.

 > > 2) Using stabs debug format.
 > 
 > Hmm, not sure. I just compiled with gcc-2.95 (yes, that old....) and "-g".
 > "info gcc" gives me the impression that this means stabs or gdb ...

In GDB, once execution has started, e.g., after hitting a breakpoint, do

(gdb) info source
Current source file is myprog.c
Compilation directory is /home/nickrob
Located in /home/nickrob/myprog.c
Contains 262 lines.
Source language is c.
Compiled with DWARF 2 debugging format.
              ^^^^^^^
Includes preprocessor macro info.

Stabs is an old debug format and I suspect it might be the default for gcc-2.95.
Maybe you can compile with DWARF 2 instead (using `-gdwarf-2') then Emacs should
start up more qickly.

 > > 3) Using an old PC.
 > 
 > gru@CMDevLin2 >cat /proc/cpuinfo 
 > vendor_id       : GenuineIntel
 > cpu family      : 15
 > model           : 2
 > model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz
 > cpu MHz         : 2405.535
 > cache size      : 512 KB
 > 
 > Not that old...
 > CPU is at 20% while "initialising....".
 > /home is mounted via nfs but I can hardly see any network activity while
 > "initialising..."

By old, I guess I mean 100MHz.  It looks like it might not be CPU bound,
anyway.

 > > If this is the problem I can post a patch that might speed things up but
 > I would try this :)
 > 
 > > just turning off gud-tooltip-mode might help.
 > 
 > "gud-tooltip-mode is a variable defined in `gud.el'.
 > Its value is nil"
 > 
 > So it is turned off.
 >  
 > Many thanks for your help :) For the time beeing, I'll just load the
 > binary from within gdb. Everything seems to work and I don't have to wait
 > 1:30 minutes. If my colleages see this, I will have to hear their laughter
 > till the end of days ;)

I think that has the same effect as my patch would, i.e., just not build the
list.  It just means that initially you need to set breakpoints, etc, from the
GUD buffer

All these tasks that Emacs performs behind the users back should be benchmarked
and optimised really, but I just haven't found the time.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




  reply	other threads:[~2008-06-27 23:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27  8:52 gud : Phase error in gdb-pre-prompt (got pre-emacs) Markus Grunwald
2008-06-27 10:18 ` Nick Roberts
2008-06-30 11:37   ` Francis Moreau
2008-06-30 22:15     ` Nick Roberts
2008-07-01 14:07       ` Francis Moreau
2008-07-01 22:41         ` Nick Roberts
2008-07-07  7:59           ` Francis Moreau
2008-07-07  9:19             ` Nick Roberts
2008-07-15  7:49               ` Francis Moreau
2008-07-22 14:49               ` Francis Moreau
     [not found] ` <mailman.13892.1214569215.18990.help-gnu-emacs@gnu.org>
2008-06-27 14:23   ` Markus Grunwald
2008-06-27 23:49     ` Nick Roberts [this message]
2008-07-03  7:16       ` hui wang
2008-07-03  7:35         ` Nick Roberts
     [not found]     ` <mailman.13907.1214610613.18990.help-gnu-emacs@gnu.org>
2008-06-30 12:45       ` Markus Grunwald
2008-06-30 13:44         ` Francis Moreau
2008-07-01  2:04         ` Nick Roberts
     [not found]         ` <mailman.14044.1214879193.18990.help-gnu-emacs@gnu.org>
2008-07-02 14:18           ` Markus Grunwald
2008-07-03  0:22             ` Nick Roberts
     [not found]             ` <mailman.14136.1215044558.18990.help-gnu-emacs@gnu.org>
2008-07-03  7:51               ` Markus Grunwald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18533.31905.273260.594090@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=help-gnu-emacs@gnu.org \
    --cc=markus.grunwald@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).