Enabled debugging symbols

This commit is contained in:
Xavi Del Campo 2020-02-01 07:20:36 +01:00
parent 3ccdeed57a
commit a8fb879457
3 changed files with 53 additions and 50 deletions

View File

@ -58,8 +58,8 @@ CPP = mipsel-unknown-elf-gcc
OBJCOPY = mipsel-unknown-elf-objcopy
# Uncomment the lines below if you want to have a debug build
# CFLAGS += -g -DPSXSDK_DEBUG
# CXXFLAGS += -g -DPSXSDK_DEBUG
CFLAGS += -g -DPSXSDK_DEBUG
CXXFLAGS += -g -DPSXSDK_DEBUG
# HOST_* variables specify the programs for compiling code on the host computer

View File

@ -90,12 +90,15 @@ void *malloc(size_t size)
alloc_size[x] = size;
// printf("malloc(): alloc_size[%d] = %d\n", x, size);
printf("finished malloc(%d)\n", size);
return (void*)((unsigned int)0x80000000 + (x<<10));
}
malloc_keep_finding:
; // Useless statement to make GCC not bail out...
}
printf("failed malloc(%d)\n", size);
// We couldn't find anything, return NULL
return NULL;
}

View File

@ -75,8 +75,8 @@ SECTIONS
" > playstation.x
echo "#!/bin/sh
mipsel-unknown-elf-gcc -D__PSXSDK__ -fno-strict-overflow -fsigned-char -msoft-float -mno-gpopt -fno-builtin -G0 -I$1/include -T $1/mipsel-unknown-elf/lib/ldscripts/playstation.x \$*"> psx-gcc
mipsel-unknown-elf-gcc -D__PSXSDK__ -fno-strict-overflow -fsigned-char -msoft-float -mno-gpopt -fno-builtin -g -I$1/include -T $1/mipsel-unknown-elf/lib/ldscripts/playstation.x \$*"> psx-gcc
chmod +x psx-gcc
echo "#!/bin/sh
mipsel-unknown-elf-g++ -D__PSXSDK__ -fno-strict-overflow -fsigned-char -msoft-float -mno-gpopt -fno-builtin -G0 -I$1/include -T $1/mipsel-unknown-elf/lib/ldscripts/playstation.x -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-use-cxa-atexit \$*" > psx-g++
mipsel-unknown-elf-g++ -D__PSXSDK__ -fno-strict-overflow -fsigned-char -msoft-float -mno-gpopt -fno-builtin -g -I$1/include -T $1/mipsel-unknown-elf/lib/ldscripts/playstation.x -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-use-cxa-atexit \$*" > psx-g++
chmod +x psx-g++