can't debug into BOOST_FOREACH?
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? puzzled... Stephan
On Mon, Mar 2, 2009 at 1:43 PM, Stephan Menzel
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?
puzzled...
Stephan
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 than. Good Luck, Ovanes
Searching on the topic of Macro expansion and gdb, I found this page:
http://www.delorie.com/gnu/docs/gdb/gdb_70.html
Might be of interest for you, but that doc is for gdb 7.0. Might also apply
for 6.8...
Regards,
Ovanes
On Mon, Mar 2, 2009 at 2:14 PM, Ovanes Markarian
On Mon, Mar 2, 2009 at 1:43 PM, Stephan Menzel
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?
puzzled...
Stephan
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 than.
Good Luck, Ovanes
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?
BOOST_FOREACH is a macro, but that doesn't affect the following block of code. Breakpoints inside the block following a BOOST_FOREACH work fine here (g++-4.3.2, gdb-6.8) Chris -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3
Stephan Menzel 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?
For me, breakpoint inside BOOST_FOREACH works. Stepping into it also works, except that you have to pass by untold millions of axillary functions. g++ 4.2, gdb 6.8 - Volodya
Am Montag, 2. März 2009 14:21:33 schrieb Vladimir Prus:
For me, breakpoint inside BOOST_FOREACH works. Stepping into it also works, except that you have to pass by untold millions of axillary functions. g++ 4.2, gdb 6.8
Gees, both you and Christoph wrote that. I still can't do it. The debugger won't stop at a breakpoint inside the loop. Weird. I reckon it might be a build issue. I'll look into it. Thanks for the info that it SHOULD work. Cheers... Stephan
Stephan Menzel wrote:
Am Montag, 2. März 2009 14:21:33 schrieb Vladimir Prus:
For me, breakpoint inside BOOST_FOREACH works. Stepping into it also works, except that you have to pass by untold millions of axillary functions. g++ 4.2, gdb 6.8
Gees, both you and Christoph wrote that. I still can't do it. The debugger won't stop at a breakpoint inside the loop. Weird. I reckon it might be a build issue. I'll look into it. Thanks for the info that it SHOULD work.
Yes, it should work. Dumb question, but you're sure there elements in the sequence, right? -- Eric Niebler BoostPro Computing http://www.boostpro.com
Eric Niebler wrote:
Yes, it should work. Dumb question, but you're sure there elements in the sequence, right?
:-) Yeah, pretty much so. The program wouldn't work otherwise and it does so the functionality itself is all right. I guess it must've been a build issue with this project. I just tested with a standalone test program and it works there. Sun activity perhaps or hallucinations caused by bad coffee. Sorry for the noise. Cheers... Stephan
participants (5)
-
Christoph Gysin
-
Eric Niebler
-
Ovanes Markarian
-
Stephan Menzel
-
Vladimir Prus