qemu-arm: Support building in debug mode with DEBUG=1.
Fixes issue #6095.
This commit is contained in:
@@ -45,7 +45,7 @@ CFLAGS += $(INC) -Wall -Wpointer-arith -Wdouble-promotion -Wfloat-conversion -We
|
|||||||
|
|
||||||
# Debugging/Optimization
|
# Debugging/Optimization
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -g -DPENDSV_DEBUG
|
CFLAGS += -g
|
||||||
COPT = -O0
|
COPT = -O0
|
||||||
else
|
else
|
||||||
COPT += -Os -DNDEBUG
|
COPT += -Os -DNDEBUG
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
@@ -73,6 +74,14 @@ __attribute__((naked)) void exit(int status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
void __assert_func(const char *file, int line, const char *func, const char *expr) {
|
||||||
|
(void)func;
|
||||||
|
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// The following are needed for tinytest
|
// The following are needed for tinytest
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user