summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-10 14:09:36 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-10 14:09:36 +0200
commitf9c0263cf8be714194a0745c19096bc97b452933 (patch)
treec80474a670a48cd92177a726fbed47660c5224ba
parent2320bfb86e2bb1ff263f8dca71e4729ba6a7e152 (diff)
Fix: shared library files not found by gdb
Old behavior assume a PATH that do not exists using XDS-server this patch intends to make a list of bindings using a regex, as GDB interprets the argument. Change-Id: I67caa1853be67813e8de02cdbb34f107f1e1676c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--cmake/cmake.d/02-macros.cmake14
-rw-r--r--cmake/cmake.d/03-extra_targets.cmake3
-rw-r--r--cmake/common.cmake1
-rw-r--r--gdb/gdb-on-target.ini.in4
4 files changed, 17 insertions, 5 deletions
diff --git a/cmake/cmake.d/02-macros.cmake b/cmake/cmake.d/02-macros.cmake
index 08a56f0..9da4464 100644
--- a/cmake/cmake.d/02-macros.cmake
+++ b/cmake/cmake.d/02-macros.cmake
@@ -79,6 +79,7 @@ macro(project_targets_populate)
endif()
if(${T} STREQUAL "BINDING")
+ list(APPEND BINDINGS_LIST "${P}${OUT}")
add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${P}${OUT}.so
COMMAND mkdir -p ${PACKAGE_LIBDIR}
COMMAND cp ${BD}/${P}${OUT}.so ${PACKAGE_LIBDIR}
@@ -135,6 +136,19 @@ macro(remote_targets_populate)
COMMAND exit -1
)
else()
+ set(BINDINGS_REGEX "not_set")
+ if(DEFINED BINDINGS_LIST)
+ list(LENGTH BINDINGS_LIST BINDINGS_LIST_LENGTH)
+ if(BINDINGS_LIST_LENGTH EQUAL 1)
+ list(GET BINDINGS_LIST 0 BINDINGS_REGEX)
+ string(APPEND BINDINGS_REGEX ".so")
+ elseif(BINDINGS_LIST_LENGTH GREATER 1)
+ foreach(B IN LISTS BINDINGS_LIST)
+ STRING(APPEND BINDINGS_STR "${B}|")
+ endforeach()
+ STRING(REGEX REPLACE "^(.*)\\|$" "(\\1).so" BINDINGS_REGEX ${BINDINGS_STR})
+ endif()
+ endif()
configure_files_in_dir(${SSH_TEMPLATE_DIR})
configure_files_in_dir(${GDB_TEMPLATE_DIR})
diff --git a/cmake/cmake.d/03-extra_targets.cmake b/cmake/cmake.d/03-extra_targets.cmake
index f6a2915..61f5adb 100644
--- a/cmake/cmake.d/03-extra_targets.cmake
+++ b/cmake/cmake.d/03-extra_targets.cmake
@@ -33,9 +33,6 @@ if(EXTRA_DEPENDENCIES_ORDER)
)
endif()
-# Add RSYNCTARGET
-remote_targets_populate()
-
# ----------------------------------------------------------------------------
# Archive target
# ----------------------------------------------------------------------------
diff --git a/cmake/common.cmake b/cmake/common.cmake
index e9b8e4c..19ee6eb 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -46,5 +46,6 @@ configure_files_in_dir($ENV{HOME}/.config/app-templates/scripts)
configure_files_in_dir(/etc/app-templates/scripts)
project_targets_populate()
+remote_targets_populate()
project_package_build()
project_closing_msg()
diff --git a/gdb/gdb-on-target.ini.in b/gdb/gdb-on-target.ini.in
index 0478e90..32af784 100644
--- a/gdb/gdb-on-target.ini.in
+++ b/gdb/gdb-on-target.ini.in
@@ -24,6 +24,6 @@ end
# Manually load project libraries when loaded by afb-daemon
break execute_command
commands
-sharedlibrary $ENV{PROJECT_DIR}/build/@PKGOUT_DIR@
+sharedlibrary @BINDINGS_REGEX@
continue
-end \ No newline at end of file
+end