diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 20:07:38 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 20:07:38 +0000 |
commit | 59c4dd56e427e29eb26e81512c3066fe3f8b13b8 (patch) | |
tree | 2681f4fd73de6e888434b98b08d20e7f6750f278 /tools/gdb | |
parent | 1a679f4a1a1cfbbd2877290da161c415d79a914a (diff) | |
download | chromium_src-59c4dd56e427e29eb26e81512c3066fe3f8b13b8.zip chromium_src-59c4dd56e427e29eb26e81512c3066fe3f8b13b8.tar.gz chromium_src-59c4dd56e427e29eb26e81512c3066fe3f8b13b8.tar.bz2 |
Add FilePath to the gdb pretty printers.
Review URL: http://codereview.chromium.org/6621017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gdb')
-rw-r--r-- | tools/gdb/gdb_chrome.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/gdb/gdb_chrome.py b/tools/gdb/gdb_chrome.py index b193122..2c25834 100644 --- a/tools/gdb/gdb_chrome.py +++ b/tools/gdb/gdb_chrome.py @@ -26,12 +26,24 @@ class GURLPrinter(webkit.StringPrinter): def to_string(self): return self.val['spec_'] +class FilePathPrinter(object): + def __init__(self, val): + self.val = val + + def to_string(self): + return self.val['path_']['_M_dataplus']['_M_p'] + + def lookup_function(val): - typ = str(val.type) - if typ == 'string16': - return String16Printer(val) - elif typ == 'GURL': - return GURLPrinter(val) + type_to_printer = { + 'string16': String16Printer, + 'GURL': GURLPrinter, + 'FilePath': FilePathPrinter, + } + + printer = type_to_printer.get(str(val.type), None) + if printer: + return printer(val) return None gdb.pretty_printers.append(lookup_function) |