|
|
|
|
|
|
| Author |
Message |
sagi.perel@gmail.com *nix forums beginner
Joined: 24 May 2006
Posts: 3
|
Posted: Wed May 24, 2006 4:44 pm Post subject:
cvd does not always show source code for executables
|
|
|
I read the archives of the group- but could not find something similar,
so here goes.
(1) I have IRIX6.5 with CVD installed from the ProDev Workshop 2.9.3
CD.
(2) My application comprised of a few executables, which use the same
makefile: they all get compiled with:
-64 -mips4 -g
(3) After compilation, I issue "cvd <exec_name>" from the same
directory as the exec, and cvd loads. I see in the "Status:" upper
section of the Debugger Main Window the name of the exec, the source
file name and line number. BUT the source window is empty.
The "File:" line says: "Source not available".
(4) For one out of 5 executables, I do get the source code, but for the
rest- I get what I described above.
Now, if I issue: "gdb <exec_name>", then gdb loads and show me the
source code of that executable - for all the execs!
The only reason for me to use CVD is that gdb cannot handle
posix_thread functions on IRIX (I get a "signal ?" error when gdb tries
to load an executable that has posix_thread functions), so I need cvd
to handle the executables.
I guess the issue is that cvd does not find the source code for the
execs, but I cannot figure out why - since the sturcture of my
application directories is:
<main dir>
|
|-----<Module 1 source>
|-----<Module 2 source>
|-----<Module 3 source>
|-----<makefile & execs>
So the makefile and all of the execs are located in one directory,
while the sources are in the other directories. I slinked the modules
execs from <Module X source> to the <makefile & execs> directory; and I
am running cvd from each module's directory.
If cvd can find the source for one module, it should find it for all...
Thanks for your help. |
|
| Back to top |
|
 |
davea *nix forums beginner
Joined: 15 Mar 2006
Posts: 6
|
Posted: Mon May 29, 2006 12:46 am Post subject:
Re: cvd does not always show source code for executables
|
|
|
Correct, gdb cannot handle IRIX threads. Unfortunate.
SGI never published the documentation to give the
gdb folks something to work with.
I'm somewhat surprised (given you compile with -g) that
cvd does not find the source, but I suspect the cause is
your unusual symlinked directory structure.
If you use dbx you can work around this by telling it to
try alternate locations.
The 'dir' command lets you list alternate directories.
Look it up.
One non-traditional property of 'dir' is the following:
Do dwarfdump -a <something.o> and look at the
file names in the line section.
Say it says /a/b/c/d.cpp
and you know the sourc is in /x/y/d.cpp
dir /a/b/c/:/x/y/
tells dbx to try that substitution.
You can add additional dir commands with like stuff.
But type those commands in a file, say dcom for example
and type
pi dcom
to read in the commands. Typing them live to dbx
is too irritating when you have to restart dbx.
In the case of cvd, you should be able to tell it
(there is a path panel somewhere) to look where the
Module <n> sources are by giving various names.
I don't have an IRIX machine here at home any more
and redirecting X from the office IRIX to ubuntu Linux at home
is not working though I did xhosts + at home
and am on the internal sgi network
.... Well there is something I just have overlooked.
Anyway , so no way for me to run cvd to find the
right window/panel name for you -- to give the source paths.
Not much help.
Sorry.
davea |
|
| Back to top |
|
 |
sagi.perel@gmail.com *nix forums beginner
Joined: 24 May 2006
Posts: 3
|
Posted: Mon May 29, 2006 4:05 am Post subject:
Re: cvd does not always show source code for executables
|
|
|
Hi Davea
I saw a panel in CVD where you could enter alternate directories: I
tried substituing "." with the absolute path for the exec I am
debugging (given that CVD will first look in ".") but it did not help.
The funny thing is that for the same exec that I wrote I do get source
code - it does not always work. Sometimes I do get the source code, and
sometimes I don't.
This is also the only exec compiled with lpthreads. Maybe it is
related somehow, and maybe it doesn't.
BUT it is the only exec that sometimes shows me the source code. All
the others never show source code.
I have only ssh to the office (never bothered to try and forward the X
), so I will try this again on Tuesday.
Maybe I will try dbx as well.
Thanks,
Sagi |
|
| Back to top |
|
 |
davea *nix forums beginner
Joined: 15 Mar 2006
Posts: 6
|
Posted: Mon May 29, 2006 9:13 pm Post subject:
Re: cvd does not always show source code for executables
|
|
|
One thing that could be the problem is that before 2.9.4, cvd had lots
of places
in the cvd front-end code
where pathnames were stored in fixed-length buffers -- some for
variables/functions,and some for path names. I think very few of the
'file name'
buffers were really too small (but a couple were!).
I changed hundreds of places to use an already-existing self-sizing
string-buffer class
in December 2003 for 2.9.4, and back=ported these to the 2.9.3 cvd, but
I don't know
what cvd patch release of 2.9.3 those would be in.
I have no specific evidence this is at all relevant to your problem
though.
Additionally, a number of places used sprintf, and I changed those to
use snprintf
where I had to actually use sprintf-like code.
I guess this is suggesting that *if you have a way* to get 2.9.5
latest-patch
WorkShop it's worth getting it.
By all means try dbx to see if it can find the source code to
your executable. That would be valuable addtional information.
If you could build a tiny simple example that showed cvd unable to find
the source along with instructions to reproduce the problem (with
a shell script, don't expect me to type a bunch of commands by hand
to set up the directory structure) then maybe I could find time to
actually try it
(I'd have to go to the office to do it).
email davea -at-- sgi 'dot' com
No guarantees though, I might not find time...
But perhaps just the example might give a clue.
davea |
|
| Back to top |
|
 |
Brent L. Bates *nix forums beginner
Joined: 05 Aug 2005
Posts: 12
|
Posted: Tue May 30, 2006 12:06 pm Post subject:
Re: cvd does not always show source code for executables
|
|
|
There is something one needs to do with threaded applications and
Workshop that I'm not sure is documented any place. Before trying to do any
debugging, in the command window, do a `stop at line_#'. The line number
being the first executable line in `main'. After that, then one can actually
run, set break points, etc.. SGI support told me to do that when I was having
problems debugging threaded executables. I hope this helps some. Good luck.
--
Brent L. Bates (UNIX Sys. Admin.)
M.S. 912 Phone:(757) 865-1400, x204
NASA Langley Research Center FAX:(757) 865-8177
Hampton, Virginia 23681-0001
Email: B.L.BATES@larc.nasa.gov http://www.vigyan.com/~blbates/ |
|
| Back to top |
|
 |
sagi.perel@gmail.com *nix forums beginner
Joined: 24 May 2006
Posts: 3
|
Posted: Tue May 30, 2006 2:08 pm Post subject:
Re: cvd does not always show source code for executables
|
|
|
Thanks, Brent.
When I try that, I can actually debug the code - but without seeing it.
I can load the source in the main window after debug started, but then
the lines do not advance with the code (I have to do it manually, and
when you jump between different files, it becomes a little
complicated).
I think that I will go for trying to get 2.9.5 and see if it is a path
length problem, or try dbx.
Sagi |
|
| Back to top |
|
 |
davea *nix forums beginner
Joined: 15 Mar 2006
Posts: 6
|
Posted: Mon Jun 05, 2006 4:45 pm Post subject:
Re: cvd does not always show source code for executables
|
|
|
sagi.perel@gmail.com wrote:
| Quote: | I think that I will go for trying to get 2.9.5 and see if it is a path
length problem, or try dbx.
Sagi
|
Try dbx as soon as convenient to see if you can 'see' the source.
If not, and you can construct a tiny complete source example that shows
the problem in dbx, then I can make suggestions about the situation and
even test
from home. Right now I'd have to say I just don't really understand
your
directory/symlink/build setup.
davea |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Tue Dec 02, 2008 12:37 pm | All times are GMT
|
|
Mobile Phones | Mortgage Calculator | Web Advertising | Credit Cards UK | Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|