all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gdb-ui problem
@ 2004-12-01  4:00 Sun Yijiang
  2004-12-01 21:03 ` Nick Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: Sun Yijiang @ 2004-12-01  4:00 UTC (permalink / raw)


When debug a large project, source files maybe in different
directories againt the executable.  gdb can point out where these
files locates, but gdb-ui simply find the source files under current
working directory, and if there is none, it will create one.  I think
this needs to be fixed, gdb-ui's behavior should be like ddd, who will
ask gdb for file paths it cannot find under current directory.  In
fact, I'm working on this feature.

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

* gdb-ui problem
  2004-12-01  4:00 gdb-ui problem Sun Yijiang
@ 2004-12-01 21:03 ` Nick Roberts
       [not found]   ` <5065e29004120117356b09f8d1@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Roberts @ 2004-12-01 21:03 UTC (permalink / raw)
  Cc: emacs-devel

 > When debug a large project, source files maybe in different
 > directories againt the executable.  gdb can point out where these
 > files locates, but gdb-ui simply find the source files under current
 > working directory, and if there is none, it will create one.

I think GDB will find these files if the program has been compiled with
the DWARF 2 debugging format. If the operating system uses stabs (or possibly
COFF) it won't.

 >  I think this needs to be fixed, gdb-ui's behavior should be like ddd, who
 > will ask gdb for file paths it cannot find under current directory.

What version are you using? I can't see this feature in GNU DDD 3.3.1.

 > In fact, I'm working on this feature.

Yes, please do. I'm not sure how it should be done because GDB's output "No
such file or directory." is not wrapped in any annotations, so it could
conceivably come from the program being debugged. Also note that you may have
to sign papers before your changes can be included in Emacs.

Nick

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

* Re: gdb-ui problem
       [not found]   ` <5065e29004120117356b09f8d1@mail.gmail.com>
@ 2004-12-02  4:09     ` Nick Roberts
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Roberts @ 2004-12-02  4:09 UTC (permalink / raw)
  Cc: emacs-devel


[Please use reply-to-all so the thread keeps going to the mailing list]

 > > >  I think this needs to be fixed, gdb-ui's behavior should be like ddd, who
 > > > will ask gdb for file paths it cannot find under current directory.
 > > 
 > > What version are you using? I can't see this feature in GNU DDD 3.3.1.
 > 
 > I'm using the same version as yours.  Pay attention to it's status
 > line, you can see when you select "Open Source" from menu and click on
 > a file, the status line will display the file's absolute path, and
 > when you click "open", DDD will open it.  Some time DDD said the file
 > is "not found", and then it will read the file "from GDB".  After all,
 > DDD promises to find out any source file you can see from "info
 > sources" command in GDB.

OK, I misunderstood. I thought you were talking about finding files
during execution.

 > It's better to say I'm studying it ^_^ I found there's no easy way to
 > get a source file's absolute path.  Now I can only use "list this.cpp"
 > and then "info source" to check the absolute path of "this.cpp", but
 > there is no annotation infomation.  I'm wondering how DDD make it.

DDD uses "gdb -fullname", sometimes called level 1 annotatons. You can
see some of the commands that it runs behind the users back by typing
"show commands 5", "show commands +"... in the console window. I guess
it just parses the output of "info source".

You could something similar to that in gdb-ann3, for finding the source
containing the main routine (gdb-main-file) e.g

(gdb-enqueue-input (list "server list this.cpp\n" 'ignore))
(gdb-enqueue-input (list "server info source\n" 'gdb-find-file))

gdb-find-file acts as a handler for "info source" and can access its output in
the partial-output buffer. However, I'm not sure how gdb-find-file should work
so that it doesn't interfere with find-file.

Also, note that I haven't tested this mode with C++ (I have had a report
that it doesn't always parse the breakpoints table correctly for the
breakpoints buffer).

Nick

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

end of thread, other threads:[~2004-12-02  4:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-01  4:00 gdb-ui problem Sun Yijiang
2004-12-01 21:03 ` Nick Roberts
     [not found]   ` <5065e29004120117356b09f8d1@mail.gmail.com>
2004-12-02  4:09     ` Nick Roberts

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.