summaryrefslogtreecommitdiff
path: root/src/ToolBox/SOS/tests/dumpil.py
blob: 9539b618bb054a35412f1377a302882a4f02f579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import lldb
import lldbutil
import re
import os
import testutils

def runScenario(assemblyName, debugger, target):
	process = target.GetProcess()
	res = lldb.SBCommandReturnObject()
	ci = debugger.GetCommandInterpreter()

	testutils.stop_in_main(ci, process, assemblyName)
	addr = testutils.exec_and_find(ci, "name2ee " + assemblyName + " Program.Main", "MethodDesc:\s+([0-9a-fA-F]+)")

	result = False
	if addr is not None:
		ci.HandleCommand("dumpil " + addr, res)
		if res.Succeeded():
			result = True
		else:
			print("DumpIL failed:")
			print(res.GetOutput())
			print(res.GetError())

	process.Continue()
	return result