Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / gdb / detach.py
1 # -*- python -*-
2 # Copyright (c) 2014 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import gdb_test
7
8
9 class DetachTest(gdb_test.GdbTest):
10
11   def test_detach(self):
12     # Test that you can stop on a breakpoint, then detach and have the debugged
13     # program run to completion.
14     self.gdb.Command('break test_detach')
15     self.gdb.ResumeAndExpectStop('continue', 'breakpoint-hit')
16     self.gdb.Detach()
17
18   def tearDown(self):
19     # sel_ldr exits first because the test program runs to completion.
20     # Intentionally bypass superclass's tearDown as it assumes gdb exits first.
21     self.AssertSelLdrExits(expected_returncode=0)
22     self.gdb.Quit()
23     self.gdb.Wait()
24
25
26 if __name__ == '__main__':
27   gdb_test.Main()