OLD | NEW |
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/") |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return 'SiteInstanceImpl@%s for %s' % ( | 276 return 'SiteInstanceImpl@%s for %s' % ( |
277 self.val.address, self.val['site_']) | 277 self.val.address, self.val['site_']) |
278 | 278 |
279 def children(self): | 279 def children(self): |
280 yield ('id_', self.val['id_']) | 280 yield ('id_', self.val['id_']) |
281 yield ('has_site_', self.val['has_site_']) | 281 yield ('has_site_', self.val['has_site_']) |
282 if self.val['browsing_instance_']['ptr_']: | 282 if self.val['browsing_instance_']['ptr_']: |
283 yield ('browsing_instance_', self.val['browsing_instance_']['ptr_']) | 283 yield ('browsing_instance_', self.val['browsing_instance_']['ptr_']) |
284 if self.val['process_']: | 284 if self.val['process_']: |
285 yield ('process_', typed_ptr(self.val['process_'])) | 285 yield ('process_', typed_ptr(self.val['process_'])) |
286 if self.val['render_process_host_factory_']: | |
287 yield ('render_process_host_factory_', | |
288 self.val['render_process_host_factory_']) | |
289 pp_set.add_printer('content::SiteInstanceImpl', '^content::SiteInstanceImpl$', | 286 pp_set.add_printer('content::SiteInstanceImpl', '^content::SiteInstanceImpl$', |
290 SiteInstanceImplPrinter) | 287 SiteInstanceImplPrinter) |
291 | 288 |
292 | 289 |
293 class RenderProcessHostImplPrinter(object): | 290 class RenderProcessHostImplPrinter(object): |
294 def __init__(self, val): | 291 def __init__(self, val): |
295 self.val = val.cast(val.dynamic_type) | 292 self.val = val.cast(val.dynamic_type) |
296 | 293 |
297 def to_string(self): | 294 def to_string(self): |
298 pid = '' | 295 pid = '' |
(...skipping 26 matching lines...) Expand all Loading... |
325 yield ('sudden_termination_allowed_', | 322 yield ('sudden_termination_allowed_', |
326 self.val['sudden_termination_allowed_']) | 323 self.val['sudden_termination_allowed_']) |
327 yield ('ignore_input_events_', self.val['ignore_input_events_']) | 324 yield ('ignore_input_events_', self.val['ignore_input_events_']) |
328 yield ('is_guest_', self.val['is_guest_']) | 325 yield ('is_guest_', self.val['is_guest_']) |
329 pp_set.add_printer('content::RenderProcessHostImpl', | 326 pp_set.add_printer('content::RenderProcessHostImpl', |
330 '^content::RenderProcessHostImpl$', | 327 '^content::RenderProcessHostImpl$', |
331 RenderProcessHostImplPrinter) | 328 RenderProcessHostImplPrinter) |
332 | 329 |
333 | 330 |
334 gdb.printing.register_pretty_printer(gdb, pp_set, replace=_DEBUGGING) | 331 gdb.printing.register_pretty_printer(gdb, pp_set, replace=_DEBUGGING) |
OLD | NEW |