[comp.sys.att] sdb behavior

pjh@mccc.edu (Peter J. Holsberg) (04/26/91)

I have a program that dumps core but when I invoke sdb with the name of
the executable, sdb says "no source file."  The command line I used is
simply "sdb program".  Program was built from "cc -g -o program program.c".

What am I doing wrong?  sdb is from AT&T's Std C Devel Environment
5.0/3 10/13/89 for SV/386 R3.2.x.

Thanks,
Pete

-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
UUCP:...!princeton!mccc!pjh  1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     Trenton Computer Festival -- 4/20-21/91

dnichols@ceilidh.beartrack.com (DoN Nichols) (04/27/91)

In article <1991Apr25.201206.12430@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
>I have a program that dumps core but when I invoke sdb with the name of
>the executable, sdb says "no source file."  The command line I used is
>simply "sdb program".  Program was built from "cc -g -o program program.c".
>
>What am I doing wrong?  sdb is from AT&T's Std C Devel Environment
>5.0/3 10/13/89 for SV/386 R3.2.x.

	I beleve that you must be in the directory containing the source
files, since sdb uses them for reference while displaying the details of
your object file/core dump.  I've not used sdb to any extent, but that is
what I remember from reading the man page for it.

	Good Luck
		DoN.

-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols@ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---

pjh@mccc.edu (Pete Holsberg) (04/29/91)

In article <1991Apr26.203951.24025@ceilidh.beartrack.com> dnichols@ceilidh.beartrack.com (DoN Nichols) writes:
=In article <1991Apr25.201206.12430@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
=>I have a program that dumps core but when I invoke sdb with the name of
=>the executable, sdb says "no source file."  The command line I used is
=>simply "sdb program".  Program was built from "cc -g -o program program.c".
=>
=>What am I doing wrong?  sdb is from AT&T's Std C Devel Environment
=>5.0/3 10/13/89 for SV/386 R3.2.x.
=
=	I beleve that you must be in the directory containing the source
=files, since sdb uses them for reference while displaying the details of
=your object file/core dump.

I believed that, too, Don, but failed to mention in my original posting
that the source file, the executable file and the core file are all in
the current directory

=I've not used sdb to any extent, but that is
=what I remember from reading the man page for it.

I see: it's a nice way of saying "RTFM"!  ;-)

Pete
-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
UUCP:...!princeton!mccc!pjh  1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     Trenton Computer Festival -- 4/20-21/91

adk@csd4.csd.uwm.edu (Andrew D Kailhofer) (04/30/91)

In article <1991Apr25.201206.12430@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
>I have a program that dumps core but when I invoke sdb with the name of
>the executable, sdb says "no source file."  The command line I used is
>simply "sdb program".  Program was built from "cc -g -o program program.c".

Being an habitual System V person, I've seen this sort of thing
before.  There are several ways that this can be caused, the best two
contenders being (1) you aren't in the directory containing the source
of your code, or (2) [and I believe this is your problem] the error
actually occurred someplace inside a library call or some such like
that.  You might want to try doing a 't' and seeing what the stack
trace says, if it says anything.  Sdb isn't really very smart, and
gets pretty confrused if pointers get screwed up, which is also one of
the things that causes library calls to blow up...

--------------------
Andy Kailhofer			Ameritech Services, Inc.
a907932@nast0.wi.ameritech.com  740 N. Broadway, Rm 430
414/678-7793			Milwaukee, WI  53202

pjh@mccc.edu (Pete Holsberg) (04/30/91)

In article <11537@uwm.edu> adk@csd4.csd.uwm.edu (Andrew D Kailhofer) writes:
=In article <1991Apr25.201206.12430@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
=>I have a program that dumps core but when I invoke sdb with the name of
=>the executable, sdb says "no source file."  The command line I used is
=>simply "sdb program".  Program was built from "cc -g -o program program.c".
=
=Being an habitual System V person, I've seen this sort of thing
=before.  There are several ways that this can be caused, the best two
=contenders being (1) you aren't in the directory containing the source
=of your code, or (2) [and I believe this is your problem] the error
=actually occurred someplace inside a library call or some such like
=that.

It turns out that the error was in the kernel's floating point driver.

=You might want to try doing a 't' and seeing what the stack
=trace says, if it says anything.  Sdb isn't really very smart, and
=gets pretty confrused if pointers get screwed up, which is also one of
=the things that causes library calls to blow up...

But why does it say "no source file"???  I'm in the directory that
contains core, program and program.c.

Pete
-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
UUCP:...!princeton!mccc!pjh  1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     Trenton Computer Festival -- 4/20-21/91

mtd@cbnewsb.cb.att.com (Mario T DeFazio) (05/02/91)

In article <1991Apr30.150441.12993@mccc.edu>, pjh@mccc.edu (Pete Holsberg) writes:
> In article <11537@uwm.edu> adk@csd4.csd.uwm.edu (Andrew D Kailhofer) writes:
> =In article <1991Apr25.201206.12430@mccc.edu> pjh@mccc.edu (Peter J. Holsberg) writes:
> =>I have a program that dumps core but when I invoke sdb with the name of
> =>the executable, sdb says "no source file."  The command line I used is
> =>simply "sdb program".  Program was built from "cc -g -o program program.c".
> =
> =Being an habitual System V person, I've seen this sort of thing
> =before.  There are several ways that this can be caused, the best two
> =contenders being (1) you aren't in the directory containing the source
> =of your code, or (2) [and I believe this is your problem] the error
> =actually occurred someplace inside a library call or some such like
> =that.
> 
> It turns out that the error was in the kernel's floating point driver.
> 
> =You might want to try doing a 't' and seeing what the stack
> =trace says, if it says anything.  Sdb isn't really very smart, and
> =gets pretty confrused if pointers get screwed up, which is also one of
> =the things that causes library calls to blow up...
> 
> But why does it say "no source file"???  I'm in the directory that
> contains core, program and program.c.
> 
> Pete

You just said the reason above, i.e. 
> It turns out that the error was in the kernel's floating point driver.

sdb is saying that it can't find a source file for the routine
where the bug was.  You don't have source for the floating point driver.
You probably don't have source for things like libc.a and libm.a either,
unless you have a source license.
I admit, though, that sdb's message could have been more explicit.


Mario T DeFazio			AT&T EasyLink Services, Lincroft, New Jersey
AT&T Mail: !mdefazio		
Internet:  mdefazio@attmail.com
           mtd@pegasus.att.com

dnichols@ceilidh.beartrack.com (DoN Nichols) (05/03/91)

In article <1991Apr30.150441.12993@mccc.edu> pjh@mccc.edu (Pete Holsberg) writes:

	[ ... ]

>It turns out that the error was in the kernel's floating point driver.

	[ ... ]

>But why does it say "no source file"???  I'm in the directory that
>contains core, program and program.c.

	Because you don't have the source code to the math library, which
includes the system call to the floating point driver, in your current
directory, so it can't find the source to the module where the error was
flagged.  If you had the library source, and the source to the kernel, in
your current directory, (and there were no name conflicts between your
program, the library, and the kernel :-), THEN it wouldn't say "no source
file".  It wants the source to the module WHERE THE ERROR OCCURRED.

	Good luck
		DoN.

-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols@ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---

rahim@cse.uta.edu (Khalid Rahim) (05/03/91)

I have question for UNIX programmers !!
I am working on developing a YACC specifications,
and I am not sure how to invoke a file from the
YACC code.  I want to open up a file and should
be able to read it from YACC code.
If any of you have done it before or worked exclusively
with YACC before, please do let me know the secret !!!!
Thank you very much