🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3521

Re: gdb can't locate breakpoint of inline function

#3521
From: Fred Ma
Date: Wed, 16 Apr 2003 15:35
35 lines
2736 bytes
Dennis Melentyev wrote:

> Hello, Fred!
> You wrote  on Wed, 16 Apr 2003 01:33:56 -0400:
>
>  FM> Hello,
>
>  FM> I'm using g++ 3.2.1 on solaris 8.  I used both -g and "-gstabs+
>  FM> -DDBUG" options to get extra gnu debugging information.  The problem
>  FM> I'm seeing is that I can't view the source code and step through it
>  FM> if I set a breakpoint on an inline function (gdb 5.3).  If I try to
>  FM> display the frame, it just shows the starting point of main.
>  FM> However, if I make the same function non-inline and move it from its
>  FM> hpp file to a cpp file, I can breakpoint at that function and view
>  FM> the source code.
> I'm almost sure you have -O flag in command line. Remove it, or gdb will not
> be able to stop at most methods in *.h files.
> If this is not your case - I'm sorry.

Well, it's understandable why you think I have optimization
turned on.  That's the first thing I suspected.  But I've learned
the lesson long ago not to turn it on unless I really need the
speed.  Not only can I not debug with it, it takes way too long
to compile in the code development cycle.

In fact, that's not the only anomaly I've encountered.  I'm
finding that invoking member functions of STL containers
(such as "print MyVector.size()") does not do what it should, which
is to return the size in the above example.  It just continues
running the program as if I typed "continue".  Same with
trying to "print MyString", where MyString is of class string.

Anyway, thanks for your attempt to help.

Fred
Technical Details
Message-ID: <3E9D782D.49A576C@doe.carleton.ca>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news.uunet.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
References: <3E9CEB44.680118E6@doe.carleton.ca> <b7iu1n$6ff$1@queen.ksf.kiev.ua>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,befedf9fb6f7d8c1
X-Google-Attributes: gid11318c,public
X-Google-Thread: fc89c,befedf9fb6f7d8c1
X-Google-Attributes: gidfc89c,public
X-Google-ArrivalTime: 2003-04-16 08:55:47 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news.uunet.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
Message-ID: <3E9D782D.49A576C@doe.carleton.ca>
From: Fred Ma <fma@doe.carleton.ca>
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.unix.programmer,gnu.gcc.help
Subject: Re: gdb can't locate breakpoint of inline function
References: <3E9CEB44.680118E6@doe.carleton.ca> <b7iu1n$6ff$1@queen.ksf.kiev.ua>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 36
Date: Wed, 16 Apr 2003 11:35:09 -0400
NNTP-Posting-Host: 64.230.49.82
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1050507634 64.230.49.82 (Wed, 16 Apr 2003 11:40:34 EDT)
NNTP-Posting-Date: Wed, 16 Apr 2003 11:40:34 EDT
Organization: Bell Sympatico