diff options
Diffstat (limited to 'poky/scripts')
-rw-r--r-- | poky/scripts/lib/devtool/ide_plugins/__init__.py | 31 | ||||
-rw-r--r-- | poky/scripts/lib/devtool/ide_plugins/ide_code.py | 26 | ||||
-rwxr-xr-x | poky/scripts/lib/devtool/ide_sdk.py | 7 | ||||
-rw-r--r-- | poky/scripts/lib/wic/plugins/source/empty.py | 2 | ||||
-rwxr-xr-x | poky/scripts/patchtest | 4 |
5 files changed, 54 insertions, 16 deletions
diff --git a/poky/scripts/lib/devtool/ide_plugins/__init__.py b/poky/scripts/lib/devtool/ide_plugins/__init__.py index 3371b24264..19c2f61c5f 100644 --- a/poky/scripts/lib/devtool/ide_plugins/__init__.py +++ b/poky/scripts/lib/devtool/ide_plugins/__init__.py @@ -81,15 +81,15 @@ class GdbCrossConfig: if self.gdbserver_multi: temp_dir = "TEMP_DIR=/tmp/gdbserver_%s; " % self.id_pretty gdbserver_cmd_start = temp_dir - gdbserver_cmd_start += "test -f \$TEMP_DIR/pid && exit 0; " - gdbserver_cmd_start += "mkdir -p \$TEMP_DIR; " - gdbserver_cmd_start += "%s --multi :%s > \$TEMP_DIR/log 2>&1 & " % ( + gdbserver_cmd_start += "test -f \\$TEMP_DIR/pid && exit 0; " + gdbserver_cmd_start += "mkdir -p \\$TEMP_DIR; " + gdbserver_cmd_start += "%s --multi :%s > \\$TEMP_DIR/log 2>&1 & " % ( self.gdb_cross.gdbserver_path, self.gdbserver_port) - gdbserver_cmd_start += "echo \$! > \$TEMP_DIR/pid;" + gdbserver_cmd_start += "echo \\$! > \\$TEMP_DIR/pid;" gdbserver_cmd_stop = temp_dir - gdbserver_cmd_stop += "test -f \$TEMP_DIR/pid && kill \$(cat \$TEMP_DIR/pid); " - gdbserver_cmd_stop += "rm -rf \$TEMP_DIR; " + gdbserver_cmd_stop += "test -f \\$TEMP_DIR/pid && kill \\$(cat \\$TEMP_DIR/pid); " + gdbserver_cmd_stop += "rm -rf \\$TEMP_DIR; " gdbserver_cmd_l = [] gdbserver_cmd_l.append('if [ "$1" = "stop" ]; then') @@ -134,8 +134,23 @@ class GdbCrossConfig: if self.image_recipe.rootfs_dbg: gdbinit_lines.append( 'set solib-search-path "' + self.modified_recipe.solib_search_path_str(self.image_recipe) + '"') - gdbinit_lines.append('set substitute-path "/usr/src/debug" "' + os.path.join( - self.image_recipe.rootfs_dbg, 'usr', 'src', 'debug') + '"') + # First: Search for sources of this recipe in the workspace folder + if self.modified_recipe.pn in self.modified_recipe.target_dbgsrc_dir: + gdbinit_lines.append('set substitute-path "%s" "%s"' % + (self.modified_recipe.target_dbgsrc_dir, self.modified_recipe.real_srctree)) + else: + logger.error( + "TARGET_DBGSRC_DIR must contain the recipe name PN.") + # Second: Search for sources of other recipes in the rootfs-dbg + if self.modified_recipe.target_dbgsrc_dir.startswith("/usr/src/debug"): + gdbinit_lines.append('set substitute-path "/usr/src/debug" "%s"' % os.path.join( + self.image_recipe.rootfs_dbg, "usr", "src", "debug")) + else: + logger.error( + "TARGET_DBGSRC_DIR must start with /usr/src/debug.") + else: + logger.warning( + "Cannot setup debug symbols configuration for GDB. IMAGE_GEN_DEBUGFS is not enabled.") gdbinit_lines.append( '%s %s:%d' % (remote_cmd, self.gdb_cross.host, self.gdbserver_port)) gdbinit_lines.append('set remote exec-file ' + self.binary) diff --git a/poky/scripts/lib/devtool/ide_plugins/ide_code.py b/poky/scripts/lib/devtool/ide_plugins/ide_code.py index f44665ed87..a62b93224e 100644 --- a/poky/scripts/lib/devtool/ide_plugins/ide_code.py +++ b/poky/scripts/lib/devtool/ide_plugins/ide_code.py @@ -194,6 +194,7 @@ class IdeVSCode(IdeBase): properties_dict["configurationProvider"] = "ms-vscode.cmake-tools" elif modified_recipe.build_tool is BuildTool.MESON: properties_dict["configurationProvider"] = "mesonbuild.mesonbuild" + properties_dict["compilerPath"] = os.path.join(modified_recipe.staging_bindir_toolchain, modified_recipe.cxx.split()[0]) else: # no C/C++ build return @@ -241,8 +242,19 @@ class IdeVSCode(IdeBase): if gdb_cross_config.image_recipe.rootfs_dbg: launch_config['additionalSOLibSearchPath'] = modified_recipe.solib_search_path_str( gdb_cross_config.image_recipe) - src_file_map["/usr/src/debug"] = os.path.join( - gdb_cross_config.image_recipe.rootfs_dbg, "usr", "src", "debug") + # First: Search for sources of this recipe in the workspace folder + if modified_recipe.pn in modified_recipe.target_dbgsrc_dir: + src_file_map[modified_recipe.target_dbgsrc_dir] = "${workspaceFolder}" + else: + logger.error( + "TARGET_DBGSRC_DIR must contain the recipe name PN.") + # Second: Search for sources of other recipes in the rootfs-dbg + if modified_recipe.target_dbgsrc_dir.startswith("/usr/src/debug"): + src_file_map["/usr/src/debug"] = os.path.join( + gdb_cross_config.image_recipe.rootfs_dbg, "usr", "src", "debug") + else: + logger.error( + "TARGET_DBGSRC_DIR must start with /usr/src/debug.") else: logger.warning( "Cannot setup debug symbols configuration for GDB. IMAGE_GEN_DEBUGFS is not enabled.") @@ -254,8 +266,10 @@ class IdeVSCode(IdeBase): def vscode_launch(self, modified_recipe): """GDB Launch configuration for binaries (elf files)""" - configurations = [self.vscode_launch_bin_dbg( - gdb_cross_config) for gdb_cross_config in self.gdb_cross_configs] + configurations = [] + for gdb_cross_config in self.gdb_cross_configs: + if gdb_cross_config.modified_recipe is modified_recipe: + configurations.append(self.vscode_launch_bin_dbg(gdb_cross_config)) launch_dict = { "version": "0.2.0", "configurations": configurations @@ -279,6 +293,8 @@ class IdeVSCode(IdeBase): ] } for gdb_cross_config in self.gdb_cross_configs: + if gdb_cross_config.modified_recipe is not modified_recipe: + continue tasks_dict['tasks'].append( { "label": gdb_cross_config.id_pretty, @@ -393,6 +409,8 @@ class IdeVSCode(IdeBase): } if modified_recipe.gdb_cross: for gdb_cross_config in self.gdb_cross_configs: + if gdb_cross_config.modified_recipe is not modified_recipe: + continue tasks_dict['tasks'].append( { "label": gdb_cross_config.id_pretty, diff --git a/poky/scripts/lib/devtool/ide_sdk.py b/poky/scripts/lib/devtool/ide_sdk.py index 1467974480..7807b322b3 100755 --- a/poky/scripts/lib/devtool/ide_sdk.py +++ b/poky/scripts/lib/devtool/ide_sdk.py @@ -301,6 +301,7 @@ class RecipeModified: self.staging_incdir = None self.strip_cmd = None self.target_arch = None + self.target_dbgsrc_dir = None self.topdir = None self.workdir = None self.recipe_id = None @@ -345,6 +346,7 @@ class RecipeModified: self.base_libdir = recipe_d.getVar('base_libdir') self.bblayers = recipe_d.getVar('BBLAYERS').split() self.bpn = recipe_d.getVar('BPN') + self.cxx = recipe_d.getVar('CXX') self.d = recipe_d.getVar('D') self.fakerootcmd = recipe_d.getVar('FAKEROOTCMD') self.fakerootenv = recipe_d.getVar('FAKEROOTENV') @@ -360,10 +362,13 @@ class RecipeModified: recipe_d.getVar('RECIPE_SYSROOT')) self.recipe_sysroot_native = os.path.realpath( recipe_d.getVar('RECIPE_SYSROOT_NATIVE')) + self.staging_bindir_toolchain = os.path.realpath( + recipe_d.getVar('STAGING_BINDIR_TOOLCHAIN')) self.staging_incdir = os.path.realpath( recipe_d.getVar('STAGING_INCDIR')) self.strip_cmd = recipe_d.getVar('STRIP') self.target_arch = recipe_d.getVar('TARGET_ARCH') + self.target_dbgsrc_dir = recipe_d.getVar('TARGET_DBGSRC_DIR') self.topdir = recipe_d.getVar('TOPDIR') self.workdir = os.path.realpath(recipe_d.getVar('WORKDIR')) @@ -695,7 +700,7 @@ class RecipeModified: """find all executable elf files in the image directory""" binaries = [] d_len = len(self.d) - re_so = re.compile('.*\.so[.0-9]*$') + re_so = re.compile(r'.*\.so[.0-9]*$') for root, _, files in os.walk(self.d, followlinks=False): for file in files: if os.path.islink(file): diff --git a/poky/scripts/lib/wic/plugins/source/empty.py b/poky/scripts/lib/wic/plugins/source/empty.py index 0a9f5fa27c..4178912377 100644 --- a/poky/scripts/lib/wic/plugins/source/empty.py +++ b/poky/scripts/lib/wic/plugins/source/empty.py @@ -14,7 +14,7 @@ # partition. This is useful to overwrite old content like # filesystem signatures which may be re-recognized otherwise. # This feature can be enabled with -# '--soucreparams="[fill|size=<N>[S|s|K|k|M|G]][,][bs=<N>[S|s|K|k|M|G]]"' +# '--sourceparams="[fill|size=<N>[S|s|K|k|M|G]][,][bs=<N>[S|s|K|k|M|G]]"' # Conflicting or missing options throw errors. import logging diff --git a/poky/scripts/patchtest b/poky/scripts/patchtest index 3163420220..0be7062dc2 100755 --- a/poky/scripts/patchtest +++ b/poky/scripts/patchtest @@ -164,9 +164,9 @@ def run(patch, logfile=None): if premerge_result == 2 and postmerge_result == 2: logger.error('patchtest: No test cases found - did you specify the correct suite directory?') if premerge_result == 1 or postmerge_result == 1: - logger.error('WARNING: patchtest: At least one patchtest caused a failure or an error - please check') + logger.error('WARNING: patchtest: At least one patchtest caused a failure or an error - please check https://wiki.yoctoproject.org/wiki/Patchtest for further guidance') else: - logger.error('OK: patchtest: All patchtests passed') + logger.info('OK: patchtest: All patchtests passed') print('----------------------------------------------------------------------\n') return premerge_result or postmerge_result |