Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* cc -g3 -O
@ 1994-06-14 20:52 Andrew Staniszewski
  1994-06-15 12:37 ` Christopher Samuel
  1994-06-21 17:26 ` Eric Werme
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Staniszewski @ 1994-06-14 20:52 UTC (permalink / raw)



Help !!!!!

What exactly does the man pages for cc, c89 and cxx mean when they say
that use of the -g3 flag may make the debugger inacurate? What I have
actully witnessed is that use of this flag causes the debuger to:
	A) not know where it is in the source code
	B) not be able to accurately report the value of a variable
is the -g3 flag at all usefull, and if so what for.

BTW: when I try to use the -O -g1 flag I get an warning saying use -g3
 
-- 
------------------------------------------------------------------------------
Andrew Staniszewski
staniszewski@mayo.edu
------------------------------------------------------------------------------


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

* Re: cc -g3 -O
  1994-06-14 20:52 cc -g3 -O Andrew Staniszewski
@ 1994-06-15 12:37 ` Christopher Samuel
  1994-06-21 17:26 ` Eric Werme
  1 sibling, 0 replies; 3+ messages in thread
From: Christopher Samuel @ 1994-06-15 12:37 UTC (permalink / raw)


In article <2tl5ai$qm9@fermat.mayo.edu> of comp.unix.osf.osf1,
        staniszewski@mayo.edu doodled:

> is the -g3 flag at all usefull, and if so what for.

I've not tried this under OSF/1 yet, but I know that under Ultrix 4.4
specifying "-O -g3" whilst building BASH is a recipe for disaster. I
suspect a compiler bug as GCC builds it OK, as does cc -O -g.

> BTW: when I try to use the -O -g1 flag I get an warning saying use -g3

I ignore them. :-)   (or take -O out)

Chris
-- 
 Christopher Samuel     Phone:  +44 684 895311       chris@rivers.dra.hmg.gb  
 N-115, Defence Research Agency, St Andrews Road, Great Malvern, England, UK
   The UK-PAGANS mailing list - solely for pagans in the United Kingdom.
    Send "info uk-pagans" to majordomo@mono.city.ac.uk for information.


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

* Re: cc -g3 -O
  1994-06-14 20:52 cc -g3 -O Andrew Staniszewski
  1994-06-15 12:37 ` Christopher Samuel
@ 1994-06-21 17:26 ` Eric Werme
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Werme @ 1994-06-21 17:26 UTC (permalink / raw)


stan@chirpa.mayo.edu (Andrew Staniszewski) writes:
>What exactly does the man pages for cc, c89 and cxx mean when they say
>that use of the -g3 flag may make the debugger inacurate?

That disables the code that leaves variables on the stack or wherever
things must be left for dbx to track them down.  The key things you
lose are:

1) Any trace of local variables.  (Though some people say you can
   believe some of them.)
2) A lot of the function arguments.  If an argument gets passed several
   levels deep, you can sometime figure out which stack trace line
   has an accurate value.

> What I have
>actully witnessed is that use of this flag causes the debuger to:
>	A) not know where it is in the source code

The source line numbers generally stay accurate, but beware of a lot
of optimizations that restructure code, like strength reduction.
Also, the instruction scheduler often interleaves code from nearby lines
to reduce CPU waiting for data to come in from memory.  If you
type "main/40i" you'll get some idea of what's happening.

>	B) not be able to accurately report the value of a variable
>is the -g3 flag at all usefull, and if so what for.

Well, data structure definitions are still around, as are global
variable.

>BTW: when I try to use the -O -g1 flag I get an warning saying use -g3

Don't know about -g1 - I usually work on the kernel and that's -g3.

The stack trace really annoys me, because I wrote one for the Intel
i860 that could hunt down most arguments without help from dbx.  It
scanned each routine in the trace looking at where arguments were moved
to and reported them.  It had to emulate part of the i860 instruction set
and execute backwards.  Not easy code to write, but I sure miss it!
-- 
Eric (Ric) Werme		| werme@zk3.dec.com
Digital Equipment Corp.		| This space intentionally left blank.


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

end of thread, other threads:[~1994-06-21 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-06-14 20:52 cc -g3 -O Andrew Staniszewski
1994-06-15 12:37 ` Christopher Samuel
1994-06-21 17:26 ` Eric Werme

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