kopia lustrzana https://github.com/stlink-org/stlink
Add optional -DDEBUG to Makefile.
rodzic
ca668a5a5f
commit
fc7b68944d
|
|
@ -1,4 +1,5 @@
|
||||||
PRG := st-util
|
PRG := st-util
|
||||||
|
DEBUG := #-DDEBUG
|
||||||
|
|
||||||
all: $(PRG)
|
all: $(PRG)
|
||||||
|
|
||||||
|
|
@ -13,7 +14,7 @@ $(PRG): $(OBJS)
|
||||||
|
|
||||||
%.o: ../src/%.c
|
%.o: ../src/%.c
|
||||||
gcc -O3 -g3 -Wall -Werror -c -std=gnu99 -MMD -MP \
|
gcc -O3 -g3 -Wall -Werror -c -std=gnu99 -MMD -MP \
|
||||||
-fno-strict-aliasing -Wno-unused \
|
-fno-strict-aliasing -Wno-unused $(DEBUG) \
|
||||||
-MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"\
|
-MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"\
|
||||||
-o "$@" "$<"
|
-o "$@" "$<"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,9 @@ int serve(struct stlink* sl, int port) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("recv: %s\n", packet);
|
#ifdef DEBUG
|
||||||
|
printf("recv: %s\n", packet);
|
||||||
|
#endif
|
||||||
|
|
||||||
char* reply = NULL;
|
char* reply = NULL;
|
||||||
|
|
||||||
|
|
@ -246,7 +248,9 @@ int serve(struct stlink* sl, int port) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reply) {
|
if(reply) {
|
||||||
//printf("send: %s\n", reply);
|
#ifdef DEBUG
|
||||||
|
printf("send: %s\n", reply);
|
||||||
|
#endif
|
||||||
|
|
||||||
int result = gdb_send_packet(client, reply);
|
int result = gdb_send_packet(client, reply);
|
||||||
if(result != 0) {
|
if(result != 0) {
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue