title: gdb single stepping until exit from function
body: <p>I'm working on a project which have following architecture.</p>
  <pre><code>sync
    |--- CMakeLists.txt
    |--- SyncManager
             |---  CMakeLists.txt
             |---  src
    |--- SyncCommon
             |---  CMakeLists.txt
             |---  src
    |--- SyncProcessor
             |---  CMakeLists.txt
             |---  src
  </code></pre>
  <p>Both SyncManager and SyncProcessor use functions in SyncCommon.
  Contents of CMakeLists.txt are as follow.</p>
  <p>sync/CMakeLists.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.10)
  project(sync)
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_STANDARD_REQUIRED True)
  
  add_subdirectory(SyncManager)
  add_subdirectory(SyncProcessor) 
  add_subdirectory(SyncCommon)
  </code></pre>
  <p>sync/SyncManager/CMakeLists.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.10)
  project(SyncManager VERSION 2.0)
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_STANDARD_REQUIRED True)
  set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -g -O0&quot;)
  
  file(GLOB project_SRCS src/*.cpp src/*.h)
  
  include_directories(src/ ../SyncCommon/src)
  
  add_executable(syncManager ${project_SRCS})
  target_link_libraries(syncManager syncCommon)
  </code></pre>
  <p>sync/SyncCommon/CMakeLists.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.10)
  project(ingester VERSION 2.0)
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_STANDARD_REQUIRED True)
  set(CMAKE_CXX_FLAGS &quot; -g -Wall -O2 -w -fpermissive -pthread&quot;)
  
  file(GLOB project_SRCS src/*.cpp src/*.h mhmc/*.c mhmc/*.h)
  
  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} &quot;${CMAKE_CURRENT_SOURCE_DIR}/src/cmake/&quot;)
  find_package(MYSQL REQUIRED)
  find_package(CURL REQUIRED)
  
  add_library(syncCommon STATIC ${project_SRCS})
  target_include_directories(syncCommon 
                             PUBLIC
                             ${CMAKE_CURRENT_SOURCE_DIR}/src
                             ${CURL_INCLUDE_DIRS}
                             ${MYSQL_INCLUDE_DIRS}
                     
  )
  target_link_libraries(syncCommon ${CURL_LIBRARIES} ${MYSQL_LIBRARY})
  </code></pre>
  <p>sync/SyncProcessor/CMakeLists.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.10)
  project(SyncProcessor VERSION 2.0)
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_FLAGS &quot; -std=c++11 -Wall -O2 -w -g -O0 -fpermissive -pthread&quot;)
  set(CMAKE_CXX_STANDARD_REQUIRED True)
  
  file(GLOB project_SRCS src/*.cpp src/*.h)
  find_package(CURL REQUIRED)
  
  include_directories(src/ ../SyncCommon/src)
  
  add_executable(syncProcessor ${project_SRCS})
  target_include_directories(syncProcessor 
                             PUBLIC
                             ${CMAKE_CURRENT_SOURCE_DIR}/src
                             ${CURL_INCLUDE_DIRS}
  )
  target_link_libraries(syncProcessor syncCommon ${CURL_LIBRARIES})
  </code></pre>
  <p>Now I'm trying to debug SyncManager. Functions in SyncCommon can be executed step by step. But when it comes to functions in SyncManager, I got this error &quot;single stepping until exit from function&quot;. I already updated gdb to newest version, but it still does not work.</p>