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

Unified Diff: tools/gdb/gdb_chrome.py

Issue 6621017: Add FilePath to the gdb pretty printers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gdb/gdb_chrome.py
diff --git a/tools/gdb/gdb_chrome.py b/tools/gdb/gdb_chrome.py
index b19312243630fc1bc421980043400efff083f1a1..2c2583402a45de0f83aab5412ccfe927a5c380eb 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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698