MCPcopy Create free account
hub / github.com/FDio/vpp / start_vpp_in_gdb

Function start_vpp_in_gdb

test/debug.py:32–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31
32def start_vpp_in_gdb():
33 # here we use SanityTestCase as a dummy to inherit functionality,
34 # but any test case class could be used ...
35 SanityTestCase.set_debug_flags("attach")
36 SanityTestCase.tempdir = SanityTestCase.get_tempdir()
37 SanityTestCase.assign_cpus(available_cpus[: SanityTestCase.get_cpus_required()])
38 SanityTestCase.setUpConstants()
39 vpp_cmdline = SanityTestCase.vpp_cmdline
40 print("Hacking cmdline to make VPP interactive.")
41 vpp_cmdline.insert(vpp_cmdline.index("nodaemon"), "interactive")
42 print("VPP cmdline is %s" % " ".join(vpp_cmdline))
43 print("Running GDB.")
44
45 if os.path.isfile(gdb_path) and os.access(gdb_path, os.X_OK):
46 gdb_cmdline = "%s --args %s " % (gdb_path, " ".join(vpp_cmdline))
47 print("GDB cmdline is %s" % gdb_cmdline)
48 gdb = pexpect.spawn(gdb_cmdline)
49 gdb.interact()
50 try:
51 gdb.terminate(True)
52 except:
53 pass
54 if gdb.isalive():
55 raise Exception("GDB refused to die...")
56 else:
57 sys.stderr.write(
58 "Debugger '%s' does not exist or is not an executable..\n" % gdb_path
59 )

Callers

nothing calls this directly

Calls 9

printFunction · 0.85
set_debug_flagsMethod · 0.45
get_tempdirMethod · 0.45
assign_cpusMethod · 0.45
get_cpus_requiredMethod · 0.45
setUpConstantsMethod · 0.45
insertMethod · 0.45
terminateMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected