public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* User Defined Types and the Debugger
@ 2002-10-14 19:49 Matteucci, Cheryl A (N-B&M Assoicates)
  2002-10-15  9:12 ` Keith Seitz
  0 siblings, 1 reply; 2+ messages in thread
From: Matteucci, Cheryl A (N-B&M Assoicates) @ 2002-10-14 19:49 UTC (permalink / raw)
  To: 'insight@sources.redhat.com'

Support,

I am using the cygwin C++ debugger (Insight GNU Debugger) to look at some
code.  I have an expression:

A = B / C     where A = floating point class attribute (not static or const,
class scope)
                            B = locally defined floating point variable (not
static or const)
                            C = user defined floating point type that is
static and const (class scope).

All of the above is in the same class.

The debugger shows me a value of 0 for C, but it is statically initialized
to 70.0.  I set a breakpoint at this line of code and when I step through
this line of code, the debugger gives me a segmentation violation (I assume
because it thinks I am dividing by zero).  But if I set a breakpoint at some
point after this line of code, the debugger successfully executes it.  When
I run the program outside of the debugger, it is successfully executed.

Why do I get a segmentation violation when I step through this line?  The
value is initialized.  Why can't the debugger see it?  Do I need to set
something or do something in addition?   HHHHEEEELLLPPPP!!!  This is really
frustrating!!!!!!!!!!!!

Thank you,

Cheryl (Very Annoyed!)

============================================== 
Cheryl Matteucci 

UAE Test Station Software 
Lockheed Martin Aeronautics 
Ft. Worth, TX 
(817) 777-2350 
cheryl.a.matteucci@lmco.com 


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

* Re: User Defined Types and the Debugger
  2002-10-14 19:49 User Defined Types and the Debugger Matteucci, Cheryl A (N-B&M Assoicates)
@ 2002-10-15  9:12 ` Keith Seitz
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2002-10-15  9:12 UTC (permalink / raw)
  To: Matteucci, Cheryl A (N-B&M Assoicates)
  Cc: 'insight@sources.redhat.com'

On Mon, 14 Oct 2002, Matteucci, Cheryl A (N-B&M Assoicates) wrote:

> Support,

Please do not call me "support": I am not a support engineer, you don't 
have a support contract with me, no one has a support contract with me, no 
one pays me to work on Insight, and I get very, very little help from 
others.

> A = B / C     where A = floating point class attribute (not static or const,
> class scope)
>                             B = locally defined floating point variable (not
> static or const)
>                             C = user defined floating point type that is
> static and const (class scope).
> 
> All of the above is in the same class.

It would be much better to have an actual testcase or some lines of code 
to inspect. There has been some churn on c++ inside GDB over the past few 
months, and it is difficult to determine exactly what is going on without 
something more concrete.

> The debugger shows me a value of 0 for C, but it is statically initialized
> to 70.0.  I set a breakpoint at this line of code and when I step through
> this line of code, the debugger gives me a segmentation violation (I assume
> because it thinks I am dividing by zero).  But if I set a breakpoint at some
> point after this line of code, the debugger successfully executes it.  When
> I run the program outside of the debugger, it is successfully executed.

The debugger does not generate segmentation faults in programs: the 
programs do that all by themselves. There could be many reasons why your 
statically initialized variable does not appear initialized.

The best thing to do right now is to post a short testcase demonstrating 
the problem. What version of GDB/Insight are you using? What version of 
gcc? If you suppress Insight and use command-line GDB (gdb -nw/insight 
-nw), does the problem also exist?

Keith

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

end of thread, other threads:[~2002-10-15 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-14 19:49 User Defined Types and the Debugger Matteucci, Cheryl A (N-B&M Assoicates)
2002-10-15  9:12 ` Keith Seitz

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