Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tests/gdb/gdb_test.py

Issue 11896007: GDB: Test for executing nacl-manifest command twice. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # -*- python -*- 1 # -*- python -*-
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import json 6 import json
7 import optparse 7 import optparse
8 import os 8 import os
9 import re 9 import re
10 import socket 10 import socket
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 'GDB reported stop reason %r but we expected %r (full info is %r)' 240 'GDB reported stop reason %r but we expected %r (full info is %r)'
241 % (stop_info.get('reason'), expected_stop_reason, stop_info)) 241 % (stop_info.get('reason'), expected_stop_reason, stop_info))
242 242
243 def Quit(self): 243 def Quit(self):
244 status, items = self._GetResultRecord(self._SendRequest('-gdb-exit')) 244 status, items = self._GetResultRecord(self._SendRequest('-gdb-exit'))
245 AssertEquals(status, '^exit') 245 AssertEquals(status, '^exit')
246 246
247 def Eval(self, expression): 247 def Eval(self, expression):
248 return self.Command('-data-evaluate-expression ' + expression)['value'] 248 return self.Command('-data-evaluate-expression ' + expression)['value']
249 249
250 def LoadManifestFile(self):
251 assert self._manifest_file is not None
252 self.Command('nacl-manifest ' + self._manifest_file)
Mark Seaborn 2013/01/21 15:52:35 Why no FilenameToUnix() here?
halyavin 2013/01/22 08:04:27 Done.
253
250 def Connect(self): 254 def Connect(self):
251 self._GetResponse() 255 self._GetResponse()
252 if self._options.irt is not None: 256 if self._options.irt is not None:
253 self.Command('nacl-irt ' + FilenameToUnix(self._options.irt)) 257 self.Command('nacl-irt ' + FilenameToUnix(self._options.irt))
254 if self._options.ld_so is not None: 258 if self._options.ld_so is not None:
255 # gdb uses bash-like escaping which removes slashes from Windows paths. 259 # gdb uses bash-like escaping which removes slashes from Windows paths.
256 manifest_file = GenerateManifest(self._options.output_dir, 260 self._manifest_file = GenerateManifest(self._options.output_dir,
257 self._options.nexe, 261 self._options.nexe,
258 self._options.ld_so, 262 self._options.ld_so,
259 self._name) 263 self._name)
260 self.Command('nacl-manifest ' + FilenameToUnix(manifest_file)) 264 self.Command('nacl-manifest ' + FilenameToUnix(self._manifest_file))
Mark Seaborn 2013/01/21 15:52:35 Call LoadManifestFile() here?
halyavin 2013/01/22 08:04:27 Done.
261 self.Command('set breakpoint pending on') 265 self.Command('set breakpoint pending on')
262 else: 266 else:
263 self.Command('file ' + FilenameToUnix(self._options.nexe)) 267 self.Command('file ' + FilenameToUnix(self._options.nexe))
264 self.Command('target remote :4014') 268 self.Command('target remote :4014')
265 269
266 270
267 def RunTest(test_func, test_name): 271 def RunTest(test_func, test_name):
268 parser = optparse.OptionParser() 272 parser = optparse.OptionParser()
269 parser.add_option('--output_dir', help='Output directory for log files') 273 parser.add_option('--output_dir', help='Output directory for log files')
270 parser.add_option('--gdb', help='Filename of GDB') 274 parser.add_option('--gdb', help='Filename of GDB')
271 parser.add_option('--irt', help='Filename of irt.nexe (optional)') 275 parser.add_option('--irt', help='Filename of irt.nexe (optional)')
272 parser.add_option('--ld_so', help='Filename of dynamic linker (optional)') 276 parser.add_option('--ld_so', help='Filename of dynamic linker (optional)')
273 parser.add_option('--library_path', 277 parser.add_option('--library_path',
274 help='Directory containing dynamic libraries, ' 278 help='Directory containing dynamic libraries, '
275 'if using dynamic linking (optional)') 279 'if using dynamic linking (optional)')
276 parser.add_option('--nexe', help='Filename of main NaCl executable') 280 parser.add_option('--nexe', help='Filename of main NaCl executable')
277 options, sel_ldr_command = parser.parse_args() 281 options, sel_ldr_command = parser.parse_args()
278 282
279 sel_ldr = LaunchSelLdr(sel_ldr_command, options, test_name) 283 sel_ldr = LaunchSelLdr(sel_ldr_command, options, test_name)
280 try: 284 try:
281 with Gdb(options, test_name) as gdb: 285 with Gdb(options, test_name) as gdb:
282 gdb.Connect() 286 gdb.Connect()
283 test_func(gdb) 287 test_func(gdb)
284 finally: 288 finally:
285 KillProcess(sel_ldr) 289 KillProcess(sel_ldr)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698