build: fix ns3 run from source file path, add lldb option and tests
This commit is contained in:
9
ns3
9
ns3
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user