summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/devtool/ide_plugins/__init__.py19
-rw-r--r--scripts/lib/devtool/ide_plugins/ide_code.py16
-rwxr-xr-xscripts/lib/devtool/ide_sdk.py3
3 files changed, 32 insertions, 6 deletions
diff --git a/scripts/lib/devtool/ide_plugins/__init__.py b/scripts/lib/devtool/ide_plugins/__init__.py
index 02707bfc37..19c2f61c5f 100644
--- a/scripts/lib/devtool/ide_plugins/__init__.py
+++ b/scripts/lib/devtool/ide_plugins/__init__.py
@@ -134,8 +134,23 @@ class GdbCrossConfig:
134 if self.image_recipe.rootfs_dbg: 134 if self.image_recipe.rootfs_dbg:
135 gdbinit_lines.append( 135 gdbinit_lines.append(
136 'set solib-search-path "' + self.modified_recipe.solib_search_path_str(self.image_recipe) + '"') 136 'set solib-search-path "' + self.modified_recipe.solib_search_path_str(self.image_recipe) + '"')
137 gdbinit_lines.append('set substitute-path "/usr/src/debug" "' + os.path.join( 137 # First: Search for sources of this recipe in the workspace folder
138 self.image_recipe.rootfs_dbg, 'usr', 'src', 'debug') + '"') 138 if self.modified_recipe.pn in self.modified_recipe.target_dbgsrc_dir:
139 gdbinit_lines.append('set substitute-path "%s" "%s"' %
140 (self.modified_recipe.target_dbgsrc_dir, self.modified_recipe.real_srctree))
141 else:
142 logger.error(
143 "TARGET_DBGSRC_DIR must contain the recipe name PN.")
144 # Second: Search for sources of other recipes in the rootfs-dbg
145 if self.modified_recipe.target_dbgsrc_dir.startswith("/usr/src/debug"):
146 gdbinit_lines.append('set substitute-path "/usr/src/debug" "%s"' % os.path.join(
147 self.image_recipe.rootfs_dbg, "usr", "src", "debug"))
148 else:
149 logger.error(
150 "TARGET_DBGSRC_DIR must start with /usr/src/debug.")
151 else:
152 logger.warning(
153 "Cannot setup debug symbols configuration for GDB. IMAGE_GEN_DEBUGFS is not enabled.")
139 gdbinit_lines.append( 154 gdbinit_lines.append(
140 '%s %s:%d' % (remote_cmd, self.gdb_cross.host, self.gdbserver_port)) 155 '%s %s:%d' % (remote_cmd, self.gdb_cross.host, self.gdbserver_port))
141 gdbinit_lines.append('set remote exec-file ' + self.binary) 156 gdbinit_lines.append('set remote exec-file ' + self.binary)
diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py b/scripts/lib/devtool/ide_plugins/ide_code.py
index 09f0bb2a07..a62b93224e 100644
--- a/scripts/lib/devtool/ide_plugins/ide_code.py
+++ b/scripts/lib/devtool/ide_plugins/ide_code.py
@@ -242,9 +242,19 @@ class IdeVSCode(IdeBase):
242 if gdb_cross_config.image_recipe.rootfs_dbg: 242 if gdb_cross_config.image_recipe.rootfs_dbg:
243 launch_config['additionalSOLibSearchPath'] = modified_recipe.solib_search_path_str( 243 launch_config['additionalSOLibSearchPath'] = modified_recipe.solib_search_path_str(
244 gdb_cross_config.image_recipe) 244 gdb_cross_config.image_recipe)
245 src_file_map[os.path.join("/usr/src/debug", modified_recipe.pn, modified_recipe.pv)] = "${workspaceFolder}" 245 # First: Search for sources of this recipe in the workspace folder
246 src_file_map["/usr/src/debug"] = os.path.join( 246 if modified_recipe.pn in modified_recipe.target_dbgsrc_dir:
247 gdb_cross_config.image_recipe.rootfs_dbg, "usr", "src", "debug") 247 src_file_map[modified_recipe.target_dbgsrc_dir] = "${workspaceFolder}"
248 else:
249 logger.error(
250 "TARGET_DBGSRC_DIR must contain the recipe name PN.")
251 # Second: Search for sources of other recipes in the rootfs-dbg
252 if modified_recipe.target_dbgsrc_dir.startswith("/usr/src/debug"):
253 src_file_map["/usr/src/debug"] = os.path.join(
254 gdb_cross_config.image_recipe.rootfs_dbg, "usr", "src", "debug")
255 else:
256 logger.error(
257 "TARGET_DBGSRC_DIR must start with /usr/src/debug.")
248 else: 258 else:
249 logger.warning( 259 logger.warning(
250 "Cannot setup debug symbols configuration for GDB. IMAGE_GEN_DEBUGFS is not enabled.") 260 "Cannot setup debug symbols configuration for GDB. IMAGE_GEN_DEBUGFS is not enabled.")
diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py
index 289bbbf47c..7807b322b3 100755
--- a/scripts/lib/devtool/ide_sdk.py
+++ b/scripts/lib/devtool/ide_sdk.py
@@ -301,6 +301,7 @@ class RecipeModified:
301 self.staging_incdir = None 301 self.staging_incdir = None
302 self.strip_cmd = None 302 self.strip_cmd = None
303 self.target_arch = None 303 self.target_arch = None
304 self.target_dbgsrc_dir = None
304 self.topdir = None 305 self.topdir = None
305 self.workdir = None 306 self.workdir = None
306 self.recipe_id = None 307 self.recipe_id = None
@@ -357,7 +358,6 @@ class RecipeModified:
357 'PACKAGE_DEBUG_SPLIT_STYLE') 358 'PACKAGE_DEBUG_SPLIT_STYLE')
358 self.path = recipe_d.getVar('PATH') 359 self.path = recipe_d.getVar('PATH')
359 self.pn = recipe_d.getVar('PN') 360 self.pn = recipe_d.getVar('PN')
360 self.pv = recipe_d.getVar('PV')
361 self.recipe_sysroot = os.path.realpath( 361 self.recipe_sysroot = os.path.realpath(
362 recipe_d.getVar('RECIPE_SYSROOT')) 362 recipe_d.getVar('RECIPE_SYSROOT'))
363 self.recipe_sysroot_native = os.path.realpath( 363 self.recipe_sysroot_native = os.path.realpath(
@@ -368,6 +368,7 @@ class RecipeModified:
368 recipe_d.getVar('STAGING_INCDIR')) 368 recipe_d.getVar('STAGING_INCDIR'))
369 self.strip_cmd = recipe_d.getVar('STRIP') 369 self.strip_cmd = recipe_d.getVar('STRIP')
370 self.target_arch = recipe_d.getVar('TARGET_ARCH') 370 self.target_arch = recipe_d.getVar('TARGET_ARCH')
371 self.target_dbgsrc_dir = recipe_d.getVar('TARGET_DBGSRC_DIR')
371 self.topdir = recipe_d.getVar('TOPDIR') 372 self.topdir = recipe_d.getVar('TOPDIR')
372 self.workdir = os.path.realpath(recipe_d.getVar('WORKDIR')) 373 self.workdir = os.path.realpath(recipe_d.getVar('WORKDIR'))
373 374