Subject: bug#3947: 23.1.50; gdb-mi does "list :1" and gets "No source file named ." on installed executables

From: Bruce Stephens <[email-masked]>
Date: Mon, 27 Jul 2009 15:01:02 +0100

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I have an executable compiled with -g and installed (copied to some
other directory, or just to another name).  gdb run by hand is fine with
debugging the installed file, and gdb-mi shows the source correctly (so
it's finding the source files fine), but something goes wrong in gdb-mi:

    (gdb) break main
    Breakpoint 1 at 0x80483fd: file test/hello.c, line 7.
    (gdb) list :1
    No source file named .

and subsequent commands all get the same error.  I presume this is
happening in gdb-place-breakpoints, where gdb-location-alist seems
always to be nil (I guess it should not be).

Everything works fine with the original executable.

In GNU Emacs 23.1.50.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
 of 2009-07-27 on tiny.isode.net, modified by Debian
 (emacs-snapshot package, version 1:20090725-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.1.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1.50/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Debugger

Minor modes in effect:
  show-paren-mode: t
  gud-tooltip-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
t C-s C-s C-e <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <return> ( r e q u i r 
e SPC ' a u t o c o n f - e d i t ) <return> C-p C-e 
C-x C-e C-x C-s C-x 0 C-x b * g u <tab> <return> <mouse-movement> 
<mouse-movement> C-x C-f / a r c h / e m a <tab> / 
l i s p <tab> p r o g <tab> g d b <tab> <return> C-s 
" l i s t C-s C-s C-s C-s C-s C-s C-a <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
C-x k * g u <tab> <return> y e s <return> M-x g d b 
<return> / t m p <M-backspace> <M-backspace> <M-backspace> 
/ t m p / h e l l o <return> b r e a k SPC m a i n 
<return> n <return> r u n <return> n <return> <return> 
<return> n <return> c <return> q <return> y e s <return> 
M-x g d b <return> <return> b r e a k SPC m a i n <return> 
r u n <return> q <return> y e s <return> M-x g d b 
<return> M-b M-b M-d a u t o / t m p f s / b i n <return> 
b r e a k SPC m a i n <return> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <help-echo> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-movement> 
<mouse-movement> <mouse-movement> <mouse-movement> 
<mouse-movement> <help-echo> <mouse-movement> <mouse-movement> 
M-x r e p o r t <tab> b <backspace> <return>

Recent messages:
Ispell process killed
Starting new Ispell process [default] ...
OVERVIEW
Mark set
The program is not being run.
Mark set [11 times]
The program is not being run.
Mark set
OVERVIEW
Mark set [5 times]

Load-path shadows:
/local/brs/elisp/prop hides /local/brs/elisp/graph/prop
/local/brs/elisp/graph/pqueue hides /local/brs/elisp/graph/graph/pqueue
/local/brs/elisp/graph/graph hides /local/brs/elisp/graph/graph/graph
/local/brs/elisp/jdee/jde/config/build hides /local/brs/elisp/jdee/jde/build/config/build
/local/brs/elisp/jdee/jde/lisp/jde-parse-class hides /local/brs/elisp/jdee/jde/build/lisp/jde-parse-class
/local/brs/elisp/jdee/jde/lisp/jde-project hides /local/brs/elisp/jdee/jde/build/lisp/jde-project
/local/brs/elisp/jdee/jde/lisp/jde-make hides /local/brs/elisp/jdee/jde/build/lisp/jde-make
/local/brs/elisp/jdee/jde/lisp/jde-setnu hides /local/brs/elisp/jdee/jde/build/lisp/jde-setnu
/local/brs/elisp/jdee/jde/lisp/jde-xemacs hides /local/brs/elisp/jdee/jde/build/lisp/jde-xemacs
/local/brs/elisp/jdee/jde/lisp/jde-checkstyle hides /local/brs/elisp/jdee/jde/build/lisp/jde-checkstyle
/local/brs/elisp/jdee/jde/lisp/setnu hides /local/brs/elisp/jdee/jde/build/lisp/setnu
/local/brs/elisp/jdee/jde/lisp/jde-dbs hides /local/brs/elisp/jdee/jde/build/lisp/jde-dbs
/local/brs/elisp/jdee/jde/lisp/jde-run hides /local/brs/elisp/jdee/jde/build/lisp/jde-run
/local/brs/elisp/jdee/jde/lisp/jde-xref hides /local/brs/elisp/jdee/jde/build/lisp/jde-xref
/local/brs/elisp/jdee/jde/lisp/jde-import hides /local/brs/elisp/jdee/jde/build/lisp/jde-import
/local/brs/elisp/jdee/jde/lisp/jde-parse hides /local/brs/elisp/jdee/jde/build/lisp/jde-parse
/local/brs/elisp/jdee/jde/lisp/jde-class hides /local/brs/elisp/jdee/jde/build/lisp/jde-class
/local/brs/elisp/jdee/jde/lisp/jcomplete hides /local/brs/elisp/jdee/jde/build/lisp/jcomplete
/local/brs/elisp/jdee/jde/lisp/efc-xemacs hides /local/brs/elisp/jdee/jde/build/lisp/efc-xemacs
/local/brs/elisp/jdee/jde/lisp/jde-stat hides /local/brs/elisp/jdee/jde/build/lisp/jde-stat
/local/brs/elisp/jdee/jde/lisp/jde-bug hides /local/brs/elisp/jdee/jde/build/lisp/jde-bug
/local/brs/elisp/jdee/jde/lisp/jde-widgets hides /local/brs/elisp/jdee/jde/build/lisp/jde-widgets
/local/brs/elisp/jdee/jde/lisp/jde-wiz hides /local/brs/elisp/jdee/jde/build/lisp/jde-wiz
/local/brs/elisp/jdee/jde/lisp/jde-javadoc-gen hides /local/brs/elisp/jdee/jde/build/lisp/jde-javadoc-gen
/local/brs/elisp/jdee/jde/lisp/jde-plugins hides /local/brs/elisp/jdee/jde/build/lisp/jde-plugins
/local/brs/elisp/jdee/jde/lisp/jde-compat hides /local/brs/elisp/jdee/jde/build/lisp/jde-compat
/local/brs/elisp/jdee/jde/lisp/jde-gen hides /local/brs/elisp/jdee/jde/build/lisp/jde-gen
/local/brs/elisp/jdee/jde/lisp/jde-package hides /local/brs/elisp/jdee/jde/build/lisp/jde-package
/local/brs/elisp/jdee/jde/lisp/jde-imenu hides /local/brs/elisp/jdee/jde/build/lisp/jde-imenu
/local/brs/elisp/jdee/jde/lisp/jde-sregex hides /local/brs/elisp/jdee/jde/build/lisp/jde-sregex
/local/brs/elisp/jdee/jde/lisp/jde-annotations hides /local/brs/elisp/jdee/jde/build/lisp/jde-annotations
/local/brs/elisp/jdee/jde/lisp/jde-jdb hides /local/brs/elisp/jdee/jde/build/lisp/jde-jdb
/local/brs/elisp/jdee/jde/lisp/jde-tree-widget hides /local/brs/elisp/jdee/jde/build/lisp/jde-tree-widget
/local/brs/elisp/jdee/jde/lisp/jde-db hides /local/brs/elisp/jdee/jde/build/lisp/jde-db
/local/brs/elisp/jdee/jde/lisp/jde-ant hides /local/brs/elisp/jdee/jde/build/lisp/jde-ant
/local/brs/elisp/jdee/jde/lisp/jde-custom hides /local/brs/elisp/jdee/jde/build/lisp/jde-custom
/local/brs/elisp/jdee/jde/lisp/jde-complete hides /local/brs/elisp/jdee/jde/build/lisp/jde-complete
/local/brs/elisp/jdee/jde/lisp/jde-compile hides /local/brs/elisp/jdee/jde/build/lisp/jde-compile
/local/brs/elisp/jdee/jde/lisp/jde-project-file hides /local/brs/elisp/jdee/jde/build/lisp/jde-project-file
/local/brs/elisp/jdee/jde/lisp/jde-java-grammar hides /local/brs/elisp/jdee/jde/build/lisp/jde-java-grammar
/local/brs/elisp/jdee/jde/lisp/jde-help hides /local/brs/elisp/jdee/jde/build/lisp/jde-help
/local/brs/elisp/jdee/jde/lisp/efc hides /local/brs/elisp/jdee/jde/build/lisp/efc
/local/brs/elisp/jdee/jde/lisp/jde-javadoc hides /local/brs/elisp/jdee/jde/build/lisp/jde-javadoc
/local/brs/elisp/jdee/jde/lisp/jde-util hides /local/brs/elisp/jdee/jde/build/lisp/jde-util
/local/brs/elisp/jdee/jde/lisp/jde hides /local/brs/elisp/jdee/jde/build/lisp/jde
/local/brs/elisp/jdee/jde/lisp/jde-ejb hides /local/brs/elisp/jdee/jde/build/lisp/jde-ejb
/local/brs/elisp/jdee/jde/lisp/jde-java-font-lock hides /local/brs/elisp/jdee/jde/build/lisp/jde-java-font-lock
/local/brs/elisp/jdee/jde/lisp/jde-junit hides /local/brs/elisp/jdee/jde/build/lisp/jde-junit
/local/brs/elisp/jdee/jde/lisp/jde-dbo hides /local/brs/elisp/jdee/jde/build/lisp/jde-dbo
/local/brs/elisp/jdee/jde/lisp/jde-open-source hides /local/brs/elisp/jdee/jde/build/lisp/jde-open-source
/local/brs/elisp/jdee/jde/lisp/which hides /local/brs/elisp/jdee/jde/build/lisp/which
/local/brs/elisp/jdee/jde/lisp/jde-juci hides /local/brs/elisp/jdee/jde/build/lisp/jde-juci
/local/brs/elisp/jdee/jde/lisp/regress hides /local/brs/elisp/jdee/jde/build/lisp/regress
/local/brs/elisp/jdee/jde/lisp/beanshell hides /local/brs/elisp/jdee/jde/build/lisp/beanshell
/local/brs/elisp/jdee/jde/lisp/jde-which-method hides /local/brs/elisp/jdee/jde/build/lisp/jde-which-method
/usr/source/CVS-cedet/cedet/common/test-p hides /usr/source/CVS-cedet/cedet/test-p
/usr/share/emacs-snapshot/site-lisp/debian-el/preseed hides /usr/share/emacs/site-lisp/debian-el/preseed
/usr/share/emacs-snapshot/site-lisp/debian-el/gnus-BTS hides /usr/share/emacs/site-lisp/debian-el/gnus-BTS
/usr/share/emacs-snapshot/site-lisp/debian-el/debian-el hides /usr/share/emacs/site-lisp/debian-el/debian-el
/usr/share/emacs-snapshot/site-lisp/debian-el/debian-bug hides /usr/share/emacs/site-lisp/debian-el/debian-bug
/usr/share/emacs-snapshot/site-lisp/debian-el/deb-view hides /usr/share/emacs/site-lisp/debian-el/deb-view
/usr/share/emacs-snapshot/site-lisp/debian-el/apt-utils hides /usr/share/emacs/site-lisp/debian-el/apt-utils
/usr/share/emacs-snapshot/site-lisp/debian-el/apt-sources hides /usr/share/emacs/site-lisp/debian-el/apt-sources
/usr/share/emacs-snapshot/site-lisp/debian-el/debian-el-loaddefs hides /usr/share/emacs/site-lisp/debian-el/debian-el-loaddefs
/usr/share/emacs/23.1.50/site-lisp/cmake/cmake-mode hides /usr/share/emacs/23.1.50/site-lisp/cmake-data/cmake-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-simple-indent hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-simple-indent
/usr/share/emacs/site-lisp/haskell-mode/inf-haskell hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/inf-haskell
/usr/share/emacs/site-lisp/haskell-mode/haskell-mode hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-indent hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-hugs hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-hugs
/usr/share/emacs/site-lisp/haskell-mode/haskell-font-lock hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-font-lock
/usr/share/emacs/site-lisp/haskell-mode/haskell-ghci hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-ghci
/usr/share/emacs/site-lisp/haskell-mode/haskell-decl-scan hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-decl-scan
/usr/share/emacs/site-lisp/haskell-mode/haskell-doc hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-doc
/usr/share/emacs/site-lisp/haskell-mode/haskell-c hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-c
/usr/share/emacs/site-lisp/haskell-mode/haskell-cabal hides /usr/share/emacs/23.1.50/site-lisp/haskell-mode/haskell-cabal
/usr/share/emacs/23.1.50/site-lisp/magit hides /usr/share/emacs/site-lisp/magit
/local/brs/elisp/id-utils hides /usr/share/emacs/site-lisp/id-utils
/usr/share/emacs/23.1.50/site-lisp/cmake/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs/23.1.50/site-lisp/crypt++ hides /usr/share/emacs/site-lisp/crypt++
/usr/share/emacs/23.1.50/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs-snapshot/site-lisp/flim/sha1 hides /usr/share/emacs/23.1.50/lisp/sha1
/usr/source/CVS-cedet/cedet/speedbar/sb-image hides /usr/share/emacs/23.1.50/lisp/sb-image
/usr/source/CVS-cedet/cedet/speedbar/speedbar hides /usr/share/emacs/23.1.50/lisp/speedbar
/usr/share/emacs-snapshot/site-lisp/flim/md4 hides /usr/share/emacs/23.1.50/lisp/md4
/usr/share/emacs-snapshot/site-lisp/flim/hex-util hides /usr/share/emacs/23.1.50/lisp/hex-util
/usr/source/CVS-cedet/cedet/common/ezimage hides /usr/share/emacs/23.1.50/lisp/ezimage
/usr/source/CVS-cedet/cedet/speedbar/dframe hides /usr/share/emacs/23.1.50/lisp/dframe
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/23.1.50/lisp/textmodes/rst
/usr/share/emacs-snapshot/site-lisp/flim/sasl hides /usr/share/emacs/23.1.50/lisp/net/sasl
/usr/share/emacs-snapshot/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/23.1.50/lisp/net/sasl-ntlm
/usr/share/emacs-snapshot/site-lisp/flim/sasl-digest hides /usr/share/emacs/23.1.50/lisp/net/sasl-digest
/usr/share/emacs-snapshot/site-lisp/flim/sasl-cram hides /usr/share/emacs/23.1.50/lisp/net/sasl-cram
/usr/share/emacs-snapshot/site-lisp/flim/ntlm hides /usr/share/emacs/23.1.50/lisp/net/ntlm
/usr/share/emacs-snapshot/site-lisp/flim/hmac-md5 hides /usr/share/emacs/23.1.50/lisp/net/hmac-md5
/usr/share/emacs-snapshot/site-lisp/flim/hmac-def hides /usr/share/emacs/23.1.50/lisp/net/hmac-def
/local/brs/elisp/hashcash hides /usr/share/emacs/23.1.50/lisp/mail/hashcash