Boost Users :
Subject: Re: [Boost-users] can't debug into BOOST_FOREACH?
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2009-03-02 08:19:23
Searching on the topic of Macro expansion and gdb, I found this page:
Might be of interest for you, but that doc is for gdb 7.0. Might also apply
On Mon, Mar 2, 2009 at 2:14 PM, Ovanes Markarian <om_boost_at_[hidden]>wrote:
> On Mon, Mar 2, 2009 at 1:43 PM, Stephan Menzel <stephan.menzel_at_gmx.eu>wrote:
>> Hi there,
>> I just noticed there seems to be no way of debugging into a BOOST_FOREACH
>> loop... Is that true?
>> I use g++ 4.3 / gdb 6.8 here and neither would the debugger stop any any
>> breakpoint inside such loops nor can I step into them from outside. Is this
>> supposed to be like that?
> AFAIK BOOST_FOREACH is a macro. Therefore it is expanded by pre-processor
> into the real code. Can you debug into macros with g++/gdb anyway? MSVC
> supports that, but what about g++/gdb?
> There might be some workarounds, like temorary modifying the BOOST_FOREACH
> code and placing a debug break compiler intrinsic call into it. I think than
> you might be able to stop the debugger inside, but not sure what is shown
> Good Luck,
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