build: fix ns3 run from source file path, add lldb option and tests

This commit is contained in:
Gabriel Ferreira
2022-02-06 16:56:08 -03:00
parent 42e320d676
commit 6e45febbf7
2 changed files with 17 additions and 4 deletions

9
ns3
View File

@@ -182,6 +182,9 @@ def parse_args(argv):
parser_run.add_argument('--gdb',
help='Change the default command template to run programs with gdb',
action="store_true", default=None)
parser_run.add_argument('--lldb',
help='Change the default command template to run programs with lldb',
action="store_true", default=None)
parser_run.add_argument('--valgrind',
help='Change the default command template to run programs with valgrind',
action="store_true", default=None)
@@ -571,7 +574,7 @@ def get_program_shortcuts(build_profile, ns3_version):
# Check if there is a .cc file for that specific program
source_file_path = os.sep.join(temp_path) + ".cc"
source_shortcut = False
if os.path.exists(ns3_path + source_file_path):
if os.path.exists(os.path.join(ns3_path, source_file_path)):
source_shortcut = True
program = program.strip()
@@ -872,6 +875,10 @@ def run_step(args, target_to_run, target_args):
if args.gdb:
debugging_software.extend([shutil.which("gdb"), "--args"])
# running lldb?
if args.lldb:
debugging_software.extend([shutil.which("lldb"), "--"])
# running with the visualizer?
if args.visualize:
target_args.append("--SimulatorImplementationType=ns3::VisualSimulatorImpl")