public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Help on gdb and gcc???
@ 2002-01-18  3:50 Phil Prentice
  0 siblings, 0 replies; only message in thread
From: Phil Prentice @ 2002-01-18  3:50 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 2607 bytes --]

Hi
  I was wondering if someone might be able to help me regarding some problems that I am having with vxgdb (vxWorks gdb) and the gcc cross-compiler.  I am using the gcc compiler version 3.0.2 and the vxgdb version 4.13.  The vxgdb version is probably quite old now(??), but it worked fine with gcc version 1.39 ( I know pretty old too!!!!).  I will look into building a more up to date vxgdb, but just in case there is an extra flag or something else that I can try, I thought that I would ask the question first.  I built the cross-compiler 3.0.2 with the following flags:-

./configure --with-gnu-as --with-gnu-ld --enable-languages=c --target=m68k-wrs-vxworks  
  --with-headers=/S765AT/auto/third_party/vxworks/vw5.1.1/vw/h

This built fine and appears to work fine.

My Problem
==========
The code that is being debugged is being generated and so to some extent is not in normal format, but that is not really the issue.  The main problem is that my system is designed to set break points on lines like (of which there may be many instances of in a file):-

{ __analog_shell_debug_variable;}

where _analog_shell_debug_variable is declared as

static volatile char _analog_shell_debug_variable = '\0';

If I compile this with the older version of the compiler it always happily sets break points.  However if I compile it with the new version of the compiler it does not always find the line in the source......I get errors like:-

break t1.c:22
No source file named t1.c                                                                      which I find very worrying...the file does exist!!!!!

or

No line 61 in file "t1.c"

where line 61 is { __analog_shell_debug_variable;}.

I have tried -g, -g1, -g2 etc with the same results.  I realise that the { __analog_shell_debug_variable;} is doing nothing and that maybe the compiler is compiling it out. In fact if I change it to something like { int i = __analog_shell_debug_variable;} it seems to fix this problem.

However is there any better method...compiler flags for example that I could try.  I also sometimes get a problem after I have set a break point, in that when I try and run to it, it seems to think that its running to a break point in a different file???  But most of the time it seems to work.  However is there any known problems regarding 3.0.2 and gdb.  Should I rebuild a new version of vxgdb?

I have attached some vxgdb output when I attempt to set break points that do not work  at all.

Thanks for your help. If I need to give more info, then please let me know.

  Phil Prentice




[-- Attachment #2: x.c --]
[-- Type: text/plain, Size: 1329 bytes --]

ir /s760hp02/atemgr/phil/Ccmm /s760hp02/localscatedev/config
target vxworks cpuhp02
target vxworks cpuhp02
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (hppa1.1-hp-hpux --target vxworks68), 
Copyright 1994 Free Software Foundation, Inc.
(vxgdb) attach -2
Source directories searched: /s760hp02/atemgr/phil/Ccmm:/s760hp02/localscatedev/config:$cdir:$cwd
(vxgdb) Attaching remote machine across net...
Connected to cpuhp02.
Looking in Unix path for all loaded modules:
	/s760hp02/localscatedev/ATE/lib/data/vxWorks.C_VXI: ok
	Ccmm: Ccmm: No such file or directory.
	cmm: cmm: No such file or directory.
	new: new: No such file or directory.
	firmware_object.o: firmware_object.o: No such file or directory.
Done.
(vxgdb) (vxgdb) (vxgdb) load /s760hp02/atemgr/phil/Ccmm/Ccmm
Reading symbols from /s760hp02/atemgr/phil/Ccmm/Ccmm...done.
(vxgdb) dir /s760hp02/atemgr/phil/Ccmm
Source directories searched: /s760hp02/atemgr/phil/Ccmm:/s760hp02/localscatedev/config:$cdir:$cwd
(vxgdb) set prompt (vxgdb) 
set prompt (vxgdb) 
(vxgdb) (vxgdb) break t1.c:22
Breakpoint 1 at 0x6319b0: file t1.c, line 22.
(vxgdb) break t1.c:61
No line 61 in file "t1.c".
(vxgdb) 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-18 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-18  3:50 Help on gdb and gcc??? Phil Prentice

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).