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

Side by Side Diff: tools/gdb/gdb_chrome.py

Issue 91483002: Add gdb.printing import in gdb chrome python file for issue 226278 (gdb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add gdb.printing import Created 7 years 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
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """GDB support for Chrome types. 5 """GDB support for Chrome types.
6 6
7 Add this to your gdb by amending your ~/.gdbinit as follows: 7 Add this to your gdb by amending your ~/.gdbinit as follows:
8 python 8 python
9 import sys 9 import sys
10 sys.path.insert(0, "/path/to/tools/gdb/") 10 sys.path.insert(0, "/path/to/tools/gdb/")
11 import gdb_chrome 11 import gdb_chrome
12 end 12 end
13 13
14 This module relies on the WebKit gdb module already existing in 14 This module relies on the WebKit gdb module already existing in
15 your Python path. 15 your Python path.
16 16
17 Use 17 Use
18 (gdb) p /r any_variable 18 (gdb) p /r any_variable
19 to print |any_variable| without using any printers. 19 to print |any_variable| without using any printers.
20 """ 20 """
21 21
22 import datetime 22 import datetime
23 import gdb 23 import gdb
24 import gdb.printing
24 import webkit 25 import webkit
25 26
26 # When debugging this module, set the below variable to True, and then use 27 # When debugging this module, set the below variable to True, and then use
27 # (gdb) python del sys.modules['gdb_chrome'] 28 # (gdb) python del sys.modules['gdb_chrome']
28 # (gdb) python import gdb_chrome 29 # (gdb) python import gdb_chrome
29 # to reload. 30 # to reload.
30 _DEBUGGING = False 31 _DEBUGGING = False
31 32
32 33
33 pp_set = gdb.printing.RegexpCollectionPrettyPrinter("chromium") 34 pp_set = gdb.printing.RegexpCollectionPrettyPrinter("chromium")
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 yield ('sudden_termination_allowed_', 288 yield ('sudden_termination_allowed_',
288 self.val['sudden_termination_allowed_']) 289 self.val['sudden_termination_allowed_'])
289 yield ('ignore_input_events_', self.val['ignore_input_events_']) 290 yield ('ignore_input_events_', self.val['ignore_input_events_'])
290 yield ('is_guest_', self.val['is_guest_']) 291 yield ('is_guest_', self.val['is_guest_'])
291 pp_set.add_printer('content::RenderProcessHostImpl', 292 pp_set.add_printer('content::RenderProcessHostImpl',
292 '^content::RenderProcessHostImpl$', 293 '^content::RenderProcessHostImpl$',
293 RenderProcessHostImplPrinter) 294 RenderProcessHostImplPrinter)
294 295
295 296
296 gdb.printing.register_pretty_printer(gdb, pp_set, replace=_DEBUGGING) 297 gdb.printing.register_pretty_printer(gdb, pp_set, replace=_DEBUGGING)
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698