Why can I not put a break in this part of asio sample code?

Hi, I am using the async_tcp_echo_server.cpp<http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp>sample code to understand asio. when I am tracing code in visual studio, it doeasn't let me put a breakpoint inside start() function in session class. Will it be run in another thread? is that the reason for not being able to put a breakpoint? Though it seems I can put breakpints for other codes that run in other threads... Why can I not put here? I tried to break at the point calling this function and step into from there. it jumps to async_receive(...) function in win_iocp_socket_service.hpp file. Could someone help me understand what is going on, or give me some pointers about how to trace such code? TIA, Ozgur PS: here is the related code: class session { //... //this is the part I can not put breakpoint. void start() { socket_.async_read_some(boost::asio::buffer(data_, max_length), boost::bind(&session::handle_read, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } Best regards, Ozgur (Oscar) Ozturk www.DrOzgur.com +1 (614) 805-4370

I tried to break at the point calling this function and step into from there. it jumps to async_receive(...) function in win_iocp_socket_service.hpp file.
Probably, you compile in release mode (i.e. with optimisations).

Hi,
Probably, you compile in release mode (i.e. with optimisations). Thanks, Yes, you are right. I tried to compile in debug mode but I have a problem. What change is needed?
Here is what Visual Studio complains: Compiling... cl : Command line warning D9025 : overriding '/MDd' with '/MD' infobayserver.cpp Using the /RTC option without specifying a debug runtime will lead to linker errors Hint: go to the code generation options and switch to one of the debugging runtimes c:\program files\boost\boost_1_38\boost\config\auto_link.hpp(106) : fatal error C1189: #error : "Incompatible build options" Build log was saved at "file://c:\Documents and Settings\oozturk7\My Documents\Visual Studio 2008\Projects\InfobayServer\Debug\BuildLog.htm" InfobayServer - 1 error(s), 1 warning(s) I have installed boost libraries and headers using the installer from: http://www.boostpro.com/download I chose both multithread and multithread debug downloads. (I have four versions of most libraries, ex: libboost_serialization-vc90-mt-1_38.lib, libboost_serialization-vc90-mt-gd-1_38.lib, libboost_serialization-vc90-mt-s-1_38.lib, libboost_serialization-vc90-mt-sgd-1_38.lib) Best regards, Ozgur (Oscar) Ozturk www.DrOzgur.com +1 (614) 805-4370 On Mon, Jul 13, 2009 at 4:22 AM, Igor R <boost.lists@gmail.com> wrote:
I tried to break at the point calling this function and step into from there. it jumps to async_receive(...) function in win_iocp_socket_service.hpp file.
Probably, you compile in release mode (i.e. with optimisations). _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Thanks, Yes, you are right. I tried to compile in debug mode but I have a problem. What change is needed?
Ensure that the CRT settings are consistent for all *.cpp's. Probably, you ocasionally overriden Code-generation settings for some specific *.cpp in Debug configuration? Check Project->Properties->Configuration properties->C/C++->Code generation->Runtime library, then the same for each *.cpp.
participants (2)
-
Igor R
-
Ozgur Ozturk