Boost logo

Boost Users :

From: Chris Russell (cdr_at_[hidden])
Date: 2002-09-16 13:53:09


... "debugging visitor code at the C++ source level and not in assembly?"

I've moved the code I want to debug into a little scrap class that I
instantiate along with the visitor, and subsequently pass into the visitor's
constructor by reference. The event handler dispatches through the reference
back into my non-copied object so I can debug it at the source level and not
in assembly. This seems to be working okay and once I'm satisfied, I'll just
fold the operational code back into the visitor and eliminate the scrap
class entirely.

----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Monday, September 16, 2002 2:30 PM
Subject: Re: [BGL] setting a breakpoint in an algorithm visitor

Hi Chris,

On Mon, 16 Sep 2002, Chris Russell wrote:
cdr> p.156 of the BGL book: "... visitors are passed by value..."
cdr>
cdr> I was attempting to set a breakpoint in a visitor event handler (that
cdr> I know is executing) but the breakpoint is seemingly ignored by my
cdr> debugger. This is because the visitor I construct and subsequently
cdr> pass to the algorithm is not the object that is actually dispatched
cdr> by the algorithm. Correct? Using the Intel compiler under MS

Yes, that is correct.

cdr> DevStudio 6 on Windows, I inserted a ::DebugBreak() (asm int 3) into
cdr> the visitor and *do* hit that but only have assembly language and not
cdr> source to step through at that point.
cdr>
cdr> Why are visitors passed to algorithms by value? Any suggestions for

Well, visitors are like functors, and the STL passes functors by-value.
There are some non-trivial reasons for that decision that I don't have
time to go into now.

cdr> debugging visitor code at the C++ source level and not in assembly?
cdr>

Sorry, I don't have a lot of experience with that debugger.

Regards,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net