Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Help with Code in Multiple Directories
@ 2009-03-27  8:44 Nirf
  2009-03-27 15:33 ` Paul Pluzhnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Nirf @ 2009-03-27  8:44 UTC (permalink / raw)
  To: gdb


Hello,
I'm trying to get started with GDB but am having great trouble. I have a
fairly complicated program with code spread out over several directories and
GDB is refusing to recognize that I have any source at all. I have also
tried GDB on a hello world program and in that case it worked. To specify
the directory structure, I have:
.../UnixBuild/         which contains the make file and the executable
.../HysteresisFiles/      which contains most of the source
.../Console/              which contains the rest

i go into the konsole, go into UnixBuild and run gdb. Then I enter in the
commands "directory .../HysteresisFiles/" and then "directory .../Console/"
(at this point I should probably clarify that ... stands for the base
directory that I am typing in in full). Then I type "file HysteresisConsole"
which is the name of my executable. It loads fine and I am able to run it.
However when I type in a command like "list sourcecodename:5" it does not
find the source code regardless of which file name I insert for
sourcecodename. Any help with this would be greatly appreciated.

Nir
-- 
View this message in context: http://www.nabble.com/Help-with-Code-in-Multiple-Directories-tp22737823p22737823.html
Sent from the Sourceware - gdb list mailing list archive at Nabble.com.


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

* Re: Help with Code in Multiple Directories
  2009-03-27  8:44 Help with Code in Multiple Directories Nirf
@ 2009-03-27 15:33 ` Paul Pluzhnikov
  2009-03-27 21:40   ` Paul Pluzhnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Pluzhnikov @ 2009-03-27 15:33 UTC (permalink / raw)
  To: Nirf; +Cc: gdb

On Fri, Mar 27, 2009 at 1:43 AM, Nirf <quicknir@gmail.com> wrote:

> I'm trying to get started with GDB but am having great trouble.

On what platform? Using which version of GDB?

Note that on Linux, or any other platform that uses DWARF
debug format, you shouldn't need to specify 'directory ...'
at all if you build and debug on the same machine: compiler
already supplies all the info GDB needs to find sources
regardless of where in file system they are located.

> However when I type in a command like "list sourcecodename:5" it does not
> find the source code regardless of which file name I insert for
> sourcecodename.

Did you build your program with debugging info (the '-g' GCC option) ?

Cheers,
-- 
Paul Pluzhnikov


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

* Re: Help with Code in Multiple Directories
  2009-03-27 15:33 ` Paul Pluzhnikov
@ 2009-03-27 21:40   ` Paul Pluzhnikov
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Pluzhnikov @ 2009-03-27 21:40 UTC (permalink / raw)
  To: Nirf; +Cc: gdb

Summary for the list:

On Fri, Mar 27, 2009 at 8:33 AM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> Did you build your program with debugging info (the '-g' GCC option) ?


We discovered that this indeed was the cause: Nir added '-g'
to CFLAGS, but neglected to do 'make clean' and only relinked his binary.

-- 
Paul Pluzhnikov


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

end of thread, other threads:[~2009-03-27 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27  8:44 Help with Code in Multiple Directories Nirf
2009-03-27 15:33 ` Paul Pluzhnikov
2009-03-27 21:40   ` Paul Pluzhnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox