Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* [Q]: DECladebug - can't find sufficient debug info
@ 1995-04-01  5:00 Matthias Winkler
  1995-04-03  4:00 ` Peter Mayne
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthias Winkler @ 1995-04-01  5:00 UTC (permalink / raw)



Hi,

   ibdr121.inf.tu-dresden.de{winkler}17: uname -a
   OSF1 ibdr121.inf.tu-dresden.de V3.0 358 alpha

After having failed to convince cc of the correctness of an
ANSI-C statement I switched to gcc.  With this compiler I
do not seem to get the kind of debugging information cc is
used to producing.

When debugging programs DECladebug will not step into
functions but rather stepping over instead.  To step into
foo() I have to issue a 'stop in foo' before giving the
step command.

So, there is some debugging information available (I can
step over the lines of main()), but not enough to step
into any function without an breakpoint.

I tried the gcc options -g3 and -gcoff3 to no avail,
i.e. DECladebug will startup correctly but won't step
into.  -gstabs3 will prevent DECladebug even from
loading my application.

If you could give me any hint I would be very grateful.

Thank you,
  Matthias



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

* Re: [Q]: DECladebug - can't find sufficient debug info
  1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
@ 1995-04-03  4:00 ` Peter Mayne
  1995-04-03  4:00 ` Tom Carlson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Mayne @ 1995-04-03  4:00 UTC (permalink / raw)


In article <3ljq08$g5q@ibch10.inf.tu-dresden.de>,
winkler@ibc.inf.tu-dresden.de (Matthias Winkler) wrote:

> 
> Hi,
> 
>    ibdr121.inf.tu-dresden.de{winkler}17: uname -a
>    OSF1 ibdr121.inf.tu-dresden.de V3.0 358 alpha
> 
> After having failed to convince cc of the correctness of an
> ANSI-C statement I switched to gcc.

What was the ANSI C statement that cc didn't like? Our compiler
people are usually pretty much on the ball with ANSI stuff.

> Thank you,
>   Matthias

PJDM
--
Peter Mayne                     | My statements, not Digital's.
Digital Equipment Corporation   | Author of NTj.
Canberra, ACT, Australia        | "Shine on, you crazy Alpha."




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

* Re: [Q]: DECladebug - can't find sufficient debug info
  1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
  1995-04-03  4:00 ` Peter Mayne
  1995-04-03  4:00 ` Tom Carlson
@ 1995-04-03  4:00 ` Jeff Diewald
  1995-04-05  4:00 ` Tom Carlson
  1995-04-06  4:00 ` Jeff Diewald
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Diewald @ 1995-04-03  4:00 UTC (permalink / raw)



In article <3ljq08$g5q@ibch10.inf.tu-dresden.de>, winkler@ibc.inf.tu-dresden.de (Matthias Winkler) writes:
|>When debugging programs DECladebug will not step into
|>functions but rather stepping over instead.  To step into
|>foo() I have to issue a 'stop in foo' before giving the
|>step command.
|>
|>So, there is some debugging information available (I can
|>step over the lines of main()), but not enough to step
|>into any function without an breakpoint.

Matthias,

   This is what happens when DECladebug is not getting all
the information it needs.  I am working on improving DECladebug's
handling of these kinds of cases.  

|>
|>I tried the gcc options -g3 and -gcoff3 to no avail,
|>i.e. DECladebug will startup correctly but won't step
|>into.  -gstabs3 will prevent DECladebug even from
|>loading my application.

DECladebug has to depend on the compiler to describe the program
in a "reasonable" manner.  DECladebug reads COFF symbol information.
Anything other than that (e.g. Stabs) won't work.  Since different
compilers can describe the same program quite differently in COFF,
it's also not surprising that there might be problems with the 
symbolic information generated by some compilers.  (COFF may be a
"standard," but it's a very loose one.)

As suggested in another reply, just what is the C statement causing
the problem?  Can you rework it?  If it really is a problem with the
compiler, the compiler folks will want to know.
-----------------------------------------------------------------------------
	Jeff Diewald			EASYNET:   VIRRUS::DIEWALD
	DECladebug group		INTERNET:  diewald@virrus.zko.dec.com
	Digital Equipment Corp.

Note: I don't read every article in this group.  If you have debugger 
questions, I may be able to get you an answer.  You're much more likely to 
get an answer if you put "Debug" somewhere in your subject line.



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

* Re: [Q]: DECladebug - can't find sufficient debug info
  1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
  1995-04-03  4:00 ` Peter Mayne
@ 1995-04-03  4:00 ` Tom Carlson
  1995-04-03  4:00 ` Jeff Diewald
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tom Carlson @ 1995-04-03  4:00 UTC (permalink / raw)




In article <3ljq08$g5q@ibch10.inf.tu-dresden.de>, winkler@ibc.inf.tu-dresden.de (Matthias Winkler) writes:
|>
|>Hi,
|>
|>   ibdr121.inf.tu-dresden.de{winkler}17: uname -a
|>   OSF1 ibdr121.inf.tu-dresden.de V3.0 358 alpha
|>
|>After having failed to convince cc of the correctness of an
|>ANSI-C statement I switched to gcc.

Matthias,

Please post (or email me directly) sources which reproduce the problem
you feel cc is wrong on.  You might also try using the DEC C compiler,
which is invoked by specifying "cc -migrate" .

regards,

Tom

--

Thomas Carlson,   DEC C/ DEC C++     carlson@decc.enet.dec.com
Digital Equipment Corporation,  ZK2-3/N30           
110 Spitbrook Rd,
Nashua, NH  03062



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

* Re: [Q]: DECladebug - can't find sufficient debug info
  1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
                   ` (2 preceding siblings ...)
  1995-04-03  4:00 ` Jeff Diewald
@ 1995-04-05  4:00 ` Tom Carlson
  1995-04-06  4:00 ` Jeff Diewald
  4 siblings, 0 replies; 6+ messages in thread
From: Tom Carlson @ 1995-04-05  4:00 UTC (permalink / raw)



In article <3ljq08$g5q@ibch10.inf.tu-dresden.de>, winkler@ibc.inf.tu-dresden.de (Matthias Winkler) writes:

|>After having failed to convince cc of the correctness of an
|>ANSI-C statement I switched to gcc.  With this compiler I
|>do not seem to get the kind of debugging information cc is
|>used to producing.

Matthias,

Your test case reduces to the following:

  typedef struct {
      unsigned int  (*towupper) ();
      unsigned int  (*towlower) ();
  } _LC_core_ctype_t;

  struct _LC_ctype_t {
    _LC_core_ctype_t core;
  } *__lc_ctype;

  main()
  {
     char c;

    (*(__lc_ctype->core.towupper))(c, __lc_ctype);

  }

cc -warnprotos foo.c
/usr/lib/cmplrs/cc/cfe: Warning: foo.c, line 14: No prototype for this call
   (*(__lc_ctype->core.towupper))(c, __lc_ctype);
 --------------------------------^

From the man page on -warnprotos : 
"Cause the compiler to produce warning messages when a
 function is is called that is not declared with a full prototype.
 This checking is more strict than required by ANSI C.
"
cc is perfectly correct in warning you... there _is no_ prototype
for the pointer to function referenced in line 14.  This is just an additional
check cc made that gcc did not happen to pick up on. If you don't want this 
additional error checking, you can always not use -warnprotos . 

>  Besides compiling pretty
> closed to ANSI C gcc will give me a lot of useful warnings (about
> '/*' within comments, about unused variables and functions and
> so on).  That's why I switched to gcc.

As we discussed offline, you can alternately invoke the DEC C compiler
with checks enabled by compiling "cc -migrate -check" (or use lint)
in addition to or instead of the error checking of gcc.
Both cc and DEC C ("cc -migrate") compiler are fully ANSI compliant,
I assure you.

To be clear... the problem in your test case was in a common header 
file, used by both cc and gcc.  Therefore gcc can't 'fix' this 
problem for you.. it just failed to diagnose it. Unfortunately, 
the headers on the system are not quite all ANSI compliant yet.
You seemed happy with the debugging info generated by cc and DEC C

Regards,

Tom

--

Thomas Carlson,   DEC C/ DEC C++     carlson@decc.enet.dec.com
Digital Equipment Corporation,  ZK2-3/N30           
110 Spitbrook Rd,
Nashua, NH  03062



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

* Re: [Q]: DECladebug - can't find sufficient debug info
  1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
                   ` (3 preceding siblings ...)
  1995-04-05  4:00 ` Tom Carlson
@ 1995-04-06  4:00 ` Jeff Diewald
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Diewald @ 1995-04-06  4:00 UTC (permalink / raw)



In article <3ljq08$g5q@ibch10.inf.tu-dresden.de>, winkler@ibc.inf.tu-dresden.de (Matthias Winkler) writes:
|>
|>Hi,
|>
|>   ibdr121.inf.tu-dresden.de{winkler}17: uname -a
|>   OSF1 ibdr121.inf.tu-dresden.de V3.0 358 alpha
|>
|>After having failed to convince cc of the correctness of an
|>ANSI-C statement I switched to gcc.  With this compiler I
|>do not seem to get the kind of debugging information cc is
|>used to producing.
|>
|>When debugging programs DECladebug will not step into
|>functions but rather stepping over instead.  To step into
|>foo() I have to issue a 'stop in foo' before giving the
|>step command.
|>
|>So, there is some debugging information available (I can
|>step over the lines of main()), but not enough to step
|>into any function without an breakpoint.
|>
|>I tried the gcc options -g3 and -gcoff3 to no avail,
|>i.e. DECladebug will startup correctly but won't step
|>into.  -gstabs3 will prevent DECladebug even from
|>loading my application.
|>
|>If you could give me any hint I would be very grateful.

   I would like to thank Matthias again for supplying me with 
his small test program that demonstrated the problem and his
complete set of instructions for reproducing everything.  I want 
to report back to anyone else following this thread.  

   I suspect that Matthias' compiler is the source of the
problem here.  When I rebuilt his application locally, using a 
slightly different version of the gcc compiler, DECladebug 
worked as expected:

avette[jeff 98]> make
/usr/mylocal/bin/gcc -v
Reading specs from /usr/mylocal/lib/gcc-lib/alpha-dec-osf3.0/2.6.0/specs
gcc version 2.6.0
/usr/mylocal/bin/gcc -gcoff3 -O0 -o stepin stepin.c
/usr/mylocal/lib/gcc-lib/alpha-dec-osf3.0/2.6.0/ld:
avette[jeff 99]> $DECLADEBUG309 stepin
Welcome to the DECladebug Debugger Version 3.0-9   
------------------
object file name: stepin
Reading symbolic information ...done
(decladebug) stop in main
[#1: stop in main ]
(decladebug) run
[1] stopped at [main:7 0x1200015d8]
      7   printf("Going to enter will_you_step_into().\n");
(decladebug) s
Going to enter will_you_step_into().
stopped at [main:8 0x1200015ec]
      8   will_you_step_into();
(decladebug) s
stopped at [will_you_step_into:13 0x120001628]
     13   printf("Inside will_you_step_into().\n");
(decladebug) s
Inside will_you_step_into().
stopped at [will_you_step_into:14 0x12000163c]
     14 }
(decladebug) quit
avette[jeff 100]> uname -a
OSF1 avette V3.0 347 alpha	
avette[jeff 101]> 

I also tested this against DECladebug 3.0.16 and 4.0.4, with the
same results.  All three versions of DECladebug showed the symptoms
reported by Matthias when used with his binary.

These symptoms are typical of cases where the compiler is generating
symbol information in an unexpected manner.  There's some subtle 
differences in the addressing and line number correlation information 
generated by these compilers.  That may account for the differences.  
Note that once I reached line 8 (using Matthias' image), I could step 
by instruction (stepi) until I stepped into the called routine.  Once 
there, I could step normally.

Given the variety of symbol table information produced on various
systems, it would not be hard to do something in the gcc makefile
that would result in a compiler that produced slightly incompatible 
symbols.  DECladebug works very hard to read in and understand as 
many different flavors of symbols as it can - and we're working to 
improve it even more.  Unfortunately, you can describe the same set 
of symbols in a *lot* of different ways using COFF.  It's a 
"standard", but only in the loosest sense of the word.

Given Tom Carlson's posting, my suggestion would be to switch back
to the DEC C compiler.  You shouldn't have any problems with 
DECladebug then.
-----------------------------------------------------------------------------
	Jeff Diewald			EASYNET:   VIRRUS::DIEWALD
	DECladebug group		INTERNET:  diewald@virrus.zko.dec.com
	Digital Equipment Corp.

Note: I don't read every article in this group.  If you have debugger 
questions, I may be able to get you an answer.  You're much more likely to 
get an answer if you put "DECladebug" somewhere in your subject line.



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

end of thread, other threads:[~1995-04-06  4:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
1995-04-03  4:00 ` Peter Mayne
1995-04-03  4:00 ` Tom Carlson
1995-04-03  4:00 ` Jeff Diewald
1995-04-05  4:00 ` Tom Carlson
1995-04-06  4:00 ` Jeff Diewald

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