21def add_debuggable_node(
25 condition_name="debug",
27 extra_debug_args=None,
30 """Adds two versions of a Node to the launch description, one with gdb debugging, controlled by a launch config"""
33 executable=executable,
34 condition=UnlessCondition(LaunchConfiguration(condition_name)),
37 ld.add_action(standard_node)
40 dash_x_arg = f
"-x {commands_file} "
43 prefix = [f
"gdb {dash_x_arg}--ex run --args"]
45 if "arguments" in kwargs:
46 arguments = kwargs[
"arguments"]
48 arguments += extra_debug_args
49 del kwargs[
"arguments"]
55 executable=executable,
56 condition=IfCondition(LaunchConfiguration(condition_name)),
61 ld.add_action(debug_node)