编译时在Debug下的subdir.mk文件下的g++行加上 -g 参数
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
CPP_SRCS += \
../src/MyString.cpp \
../src/main.cpp \
../src/utils.cpp
OBJS += \
./src/MyString.o \
./src/main.o \
./src/utils.o
CPP_DEPS += \
./src/MyString.d \
./src/main.d \
./src/utils.d
# Each subdirectory must supply rules for building sources it contributes
src/%.o: ../src/%.cpp
@echo 'Building file: $<'
@echo 'Invoking: Cygwin C++ Compiler'
g++ -g -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '