Skip to content

Commit 6b11dca

Browse files
authored
Merge pull request #179 from smartobjectoriented/178-enhance-debugging-capabilities-on-lvperf-docker-images
chore: enhance debugging capabilities on lvperf docker images
2 parents 98b15cf + 21fb7cf commit 6b11dca

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

docker/scripts/run.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
ROOTFS_PATH="/persistence/rootfs.fat.$PLATFORM"
66
FILESYSTEM_PATH="/persistence/sdcard.img.$PLATFORM"
77

8+
89
mount_loop_partition() {
910
image_path="$1"
1011
mount_point="$2"
@@ -54,7 +55,12 @@ build_usr() {
5455

5556
cd usr
5657

57-
./build.sh -r
58+
if [ -n "$SO3_USR_DEBUG" ]; then
59+
./build.sh
60+
else
61+
./build.sh -r
62+
fi
63+
5864
if [ $? -ne '0' ]; then
5965
exit 1
6066
fi
@@ -105,7 +111,11 @@ else
105111
exit 1
106112
fi
107113

108-
qemu-system-${QEMU_ARCH} \
114+
if [ -n "$SO3_USR_DEBUG" ]; then
115+
QEMU_DEBUG_ARGS="-S -gdb tcp::1234"
116+
fi
117+
118+
qemu-system-${QEMU_ARCH} ${QEMU_DEBUG_ARGS} \
109119
-semihosting \
110120
-smp 2 \
111121
-icount shift=0,sleep=on,align=on \

usr/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ add_link_options(-T ${CMAKE_SOURCE_DIR}/lib/libc/aarch64.lds -N -warn-common
5252

5353
endif()
5454

55+
if(CMAKE_BUILD_TYPE MATCHES "Debug")
56+
add_compile_options(-ggdb)
57+
endif()
58+
5559
# All related libraries used by the linker
5660
add_subdirectory(lib)
5761

0 commit comments

Comments
 (0)