This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Insight unable to view source/single stepping is Fixed...


Chris  Faylor,

thanks for helping me out, your suggestion was right on the money,

it solved the problem I was having with not being able to single step or
list/view source code from cygwin gdb and Insight was because the search
path gdb was using apparently did not include the current working directory
where my source code was.

by using the --directory option at the command line or the directory command
within
gdb console, I was able to add my source code directory to the front of the
search
path and all problems related to viewing source, single stepping, etc have
gone away.

I just added an alias to my .bashrc for gdb to automatically pick up the pwd
alias gdb 'gdb --directory=`pwd` ' so now all I have to do is just type
gdb <executeable> from the directory where the source is at.

I'm very happy, Insight is an excellent product!
/dave


-----Original Message-----
From: Chris Faylor <cgf@cygnus.com>
To: Dave Arnold <avr_fan@mailandnews.com>
Cc: insight@sourceware.cygnus.com <insight@sourceware.cygnus.com>
Date: Saturday, July 08, 2000 2:28 PM
Subject: Re: Any Clues about this problem? Close but...


>On Fri, Jul 07, 2000 at 11:00:30PM -0700, Dave Arnold wrote:
>>>cgf wrote:
>>>Try 'list main'.
>>>
>>>Are you *sure* you're both compiling and linking with the '-g' option?
>>>When I type just 'list' I get my 'main'.
>>
>>That is a good question because after taking a close look I discovered
>>a big mistake on my part.  I commented out the -g variable definition
>>in the top of the makefile.
>>
>>CC = gcc
>># CFLAGS = -g
>>load: load5.o btlib.o
>> $(CC) $(CFLAGS) load5.o btlib.o -o load
>>
>>However I recompiled with -g for sure and still I got this output:
>>
>>(gdb) list 1
>>frame.c: No such file or directory.
>
>??? I don't see a 'frame.c' above.
>
>However, if gdb is unable to find a file that means that you are either
>not cd'ed to the directory that holds the file or you have not used
>the gdb 'directory' command:
>
>(gdb) help directory
>Add directory DIR to beginning of search path for source files.
>Forget cached info on source file locations and line positions.
>DIR can also be $cwd for the current working directory, or $cdir for the
>directory in which the source file was compiled into object code.
>With no argument, reset the search path to $cdir:$cwd, the default.
>
>>(gdb) list main
>>Error: No line number known for main.
>
>I.e., the file containing your main() has not been compiled with -g.
>
>>(gdb)
>
>It *still* sounds like not all of your objects are being compiled with
>-g.
>
>Is it possible that you have both a 'load' file and a 'load.exe'?  You
>know that you have to use 'load.exe', right?  It is safest to add
>a .exe whenever you are generating an executable, so the above makefile
>should look like this:
>
>CC = gcc
>CFLAGS = -g
>load.exe: load5.o btlib.o
> $(CC) $(CFLAGS) load5.o btlib.o -o load.exe
>
>cgf
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]