Add gdb support if DEBUGMODE is enabled

This commit is contained in:
attilavs2 2024-07-28 22:08:32 +02:00
parent 32764e675a
commit f29fbf73de
2 changed files with 13 additions and 7 deletions

View file

@ -104,11 +104,11 @@ target_link_libraries(myaddin LibProf::LibProf Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G) if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
# fx colormode # fx colormode
if("${COLORMODE_fx}" STREQUAL 1b) if("${COLORMODE_fx}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR1BIT)
endif() endif()
if("${COLORMODE_fx}" STREQUAL 2b) if("${COLORMODE_fx}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR2BIT)
endif() endif()
if("${COLORMODE_fx}" STREQUAL 1b) if("${COLORMODE_fx}" STREQUAL 1b)
@ -126,15 +126,15 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50) elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
# cg colormode # cg colormode
if("${COLORMODE_cg}" STREQUAL 1b) if("${COLORMODE_cg}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR1BIT)
endif() endif()
if("${COLORMODE_cg}" STREQUAL 2b) if("${COLORMODE_cg}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR2BIT)
endif() endif()
if("${COLORMODE_cg}" STREQUAL EGA64) if("${COLORMODE_cg}" STREQUAL EGA64)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOREGA) target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOREGA)
endif() endif()
if("${COLORMODE_cg}" STREQUAL 1b) if("${COLORMODE_cg}" STREQUAL 1b)

View file

@ -1,4 +1,3 @@
#include <gint/display.h> #include <gint/display.h>
#include <gint/keyboard.h> #include <gint/keyboard.h>
#include <gint/timer.h> #include <gint/timer.h>
@ -20,6 +19,10 @@
#include <gint/gray.h> #include <gint/gray.h>
#endif //GRAYMODEOK #endif //GRAYMODEOK
#if DEBUGMODE
#include <gint/gdb.h>
#endif /*DEBUGMODE*/
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
@ -92,6 +95,10 @@ int update_time(void) {
int main(void) { int main(void) {
#if DEBUGMODE
gdb_start_on_exception();
#endif /*DEBUGMODE*/
__printf_enable_fp(); __printf_enable_fp();
int timer; int timer;
@ -113,7 +120,6 @@ int main(void) {
usb_open(interfaces, GINT_CALL_NULL); usb_open(interfaces, GINT_CALL_NULL);
#endif #endif
/* start grayscale engine */ /* start grayscale engine */
#if GRAYMODEOK #if GRAYMODEOK