🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1499

Re: problem with gdb

#1499
From: Gordie Freedman
Date: Wed, 11 Nov 1992 07:00
19 lines
1339 bytes
In article <BxIo9p.142.2@cs.cmu.edu> hill@norman.VI.RI.CMU.EDU (Robert  
Hill) writes: 
> I missed the original thread, but I have been having problems with gdb  
> printing the wrong values for variables under 3.0.  I'll type something  
> like "print x".  I am really sure x has the value of 1, but it says x is  
> 0.  At first I thought I was wrong about the value of x, but adding a  
> printf said that x was 1.  Very strange.
> 
> Is there any reported bugs for gdb under 3.0?
> 
> Rob

If you are compiling with optimization (cc -O) sometimes variables get  
compiled out or reused. Debugging gets a little weird. I don't know if  
this is your problem but I have seen similar things when using gdb on an  
-O'd file. (It's really fun with C++ !)
-- 
Gordie Freedman gordie@yamanote.dolphin.com   ->   NextMail encouraged
(Disclaimer: Opinions expressed are my own and represent no one else.)
Technical Details
Message-ID: <1992Nov11.070028.8132@dolphin.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!netcomsv!dolphin!yamanote!gordie
References: <BxIo9p.142.2@cs.cmu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!netcomsv!dolphin!yamanote!gordie
From: gordie@yamanote.dolphin.com (Gordie Freedman)
Subject: Re: problem with gdb
Message-ID: <1992Nov11.070028.8132@dolphin.com>
Sender: gordie@dolphin.com
Reply-To: gordie@yamanote.dolphin.com
Organization: Dolphin Software
References: <BxIo9p.142.2@cs.cmu.edu>
Date: Wed, 11 Nov 1992 07:00:28 GMT
Lines: 20