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

Unified Diff: tools/gen-postmortem-metadata.py

Issue 1435643002: Make gen-postmortem-metadata.py more reliable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gen-postmortem-metadata.py
diff --git a/tools/gen-postmortem-metadata.py b/tools/gen-postmortem-metadata.py
index 1b6a6bbcf05fd57c602f84f58db6098bfcb6a166..f7d5832f6764e9bff1214c8619dff8d29671aec1 100644
--- a/tools/gen-postmortem-metadata.py
+++ b/tools/gen-postmortem-metadata.py
@@ -227,6 +227,20 @@ footer = '''
'''
#
+# Get the base class
+#
+def get_base_class(klass):
+ if (klass == 'Object'):
+ return klass;
+
+ if (not (klass in klasses)):
+ return None;
+
+ k = klasses[klass];
+
+ return get_base_class(k['parent']);
+
+#
# Loads class hierarchy and type information from "objects.h".
#
def load_objects():
@@ -264,12 +278,14 @@ def load_objects():
typestr += line;
continue;
- match = re.match('class (\w[^\s:]*)(: public (\w[^\s{]*))?\s*{',
+ match = re.match('class (\w[^:]*)(: public (\w[^{]*))?\s*{\s*',
line);
if (match):
- klass = match.group(1);
+ klass = match.group(1).rstrip().lstrip();
pklass = match.group(3);
+ if (pklass):
+ pklass = pklass.rstrip().lstrip();
klasses[klass] = { 'parent': pklass };
#
@@ -520,6 +536,9 @@ def emit_config():
keys.sort();
for klassname in keys:
pklass = klasses[klassname]['parent'];
+ bklass = get_base_class(klassname);
+ if (bklass != 'Object'):
+ continue;
if (pklass == None):
continue;
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698