Esempio n. 1
0
 def test_with_client(self):
     options = DynamoRIOOptions('-vm_size 2')
     self.assertEqual(options.options_string, '-vm_size 2')
     options = options.with_client('client0', 0, 'arg0')
     self.assertEqual(options.options_string,
                      '-vm_size 2 -client_lib client0;0;arg0')
     options = options.with_client('client1', 1, 'arg1')
     self.assertEqual(options.options_string,
                      '-vm_size 2 -client_lib client0;0;arg0;client1;1;arg1')
Esempio n. 2
0
 def test_create_from_file(self):
     (fd, path) = tempfile.mkstemp()
     tmp_file = os.fdopen(fd, 'w')
     tmp_file.write('test \ndr \r\noptions string')
     tmp_file.flush()
     options = DynamoRIOOptions.create_from_file(path)
     self.assertEqual('test  dr   options string', options.options_string)
Esempio n. 3
0
def main(gdb_stub):
    debugger = GDBDebugger(gdb_stub)
    machine = QEMU.create_from_running_vm('akshayk', 5556)
    shell = machine.get_shell()
    loader = RemoteLoader(shell, debugger,
                          LoaderOptions(),
                          DynamoRIOOptions.create_from_file('dr_options'))
    debugger.set_main_symbol_file('../debugging/linux-2.6.32/vmlinux')
    loader.load()
    machine.attach_debugger(debugger)
    for bp in ['external_error', 'os_terminate', 'panic', 'oops_begin',
               'handle_unknown_interrupt','non_maskable_interrupt',
               'null_next_tag_curiosity']:
        debugger.add_breakpoint(bp)
    debugger.resume()
    loader.init()
Esempio n. 4
0
 def test_client_names(self):
     dr_options = DynamoRIOOptions('')
     self.assertEqual([], dr_options.get_client_names())
     dr_options = DynamoRIOOptions('-client_lib one;0;1;two;1;1;three;2;1')
     self.assertEqual(['one', 'two', 'three'], dr_options.get_client_names())