kopia lustrzana https://github.com/stlink-org/stlink
				
				
				
			Add optional -DDEBUG to Makefile.
							rodzic
							
								
									ca668a5a5f
								
							
						
					
					
						commit
						fc7b68944d
					
				|  | @ -1,4 +1,5 @@ | |||
| PRG := st-util | ||||
| DEBUG := #-DDEBUG | ||||
| 
 | ||||
| all: $(PRG) | ||||
| 
 | ||||
|  | @ -13,7 +14,7 @@ $(PRG): $(OBJS) | |||
| 
 | ||||
| %.o: ../src/%.c | ||||
| 	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)"\
 | ||||
| 		-o "$@" "$<" | ||||
| 
 | ||||
|  |  | |||
|  | @ -95,7 +95,9 @@ int serve(struct stlink* sl, int port) { | |||
| 			return 1; | ||||
| 		} | ||||
| 
 | ||||
| 		//printf("recv: %s\n", packet);
 | ||||
| 		#ifdef DEBUG | ||||
| 		printf("recv: %s\n", packet); | ||||
| 		#endif | ||||
| 
 | ||||
| 		char* reply = NULL; | ||||
| 
 | ||||
|  | @ -246,7 +248,9 @@ int serve(struct stlink* sl, int port) { | |||
| 		} | ||||
| 
 | ||||
| 		if(reply) { | ||||
| 			//printf("send: %s\n", reply);
 | ||||
| 			#ifdef DEBUG | ||||
| 			printf("send: %s\n", reply); | ||||
| 			#endif | ||||
| 
 | ||||
| 			int result = gdb_send_packet(client, reply); | ||||
| 			if(result != 0) { | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Peter Zotov
						Peter Zotov