summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-02-26 07:57:12 +0000
committerFedor Indutny <fedor.indutny@gmail.com>2013-02-26 07:57:12 +0000
commit3d913fec83e7290fd0f694027f7f9904ffd09970 (patch)
treed419acf729b992eaa3c4016bb015b1ecfcf081fa /tools
parent88befa6021d136257939a2caba14e69ad9c43dd5 (diff)
downloadandroid-node-v8-3d913fec83e7290fd0f694027f7f9904ffd09970.tar.gz
android-node-v8-3d913fec83e7290fd0f694027f7f9904ffd09970.tar.bz2
android-node-v8-3d913fec83e7290fd0f694027f7f9904ffd09970.zip
Revert "sunos: unbreak build after v8 downgrade"
This reverts commit f80f3c5f62a3955636c1af1872ef9539a0b01cb0.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genv8constants.py52
1 files changed, 35 insertions, 17 deletions
diff --git a/tools/genv8constants.py b/tools/genv8constants.py
index 571b3e3329..45b4ae3171 100755
--- a/tools/genv8constants.py
+++ b/tools/genv8constants.py
@@ -32,8 +32,10 @@ except OSError, e:
sys.exit()
-pattern = re.compile('00000000 <(v8dbg_.*)>:');
-numpattern = re.compile('[0-9a-fA-F]{2}');
+pattern = re.compile('([0-9a-fA-F]{8}|[0-9a-fA-F]{16}) <(.*)>:');
+v8dbg = re.compile('^v8dbg.*$')
+numpattern = re.compile('^[0-9a-fA-F]{2} $');
+octets = 4
outfile.write("""
/*
@@ -46,13 +48,29 @@ outfile.write("""
#ifndef V8_CONSTANTS_H
#define V8_CONSTANTS_H
-#if defined(__i386)
""");
curr_sym = None;
curr_val = 0;
curr_octet = 0;
+def out_reset():
+ global curr_sym, curr_val, curr_octet
+ curr_sym = None;
+ curr_val = 0;
+ curr_octet = 0;
+
+def out_define():
+ global curr_sym, curr_val, curr_octet, outfile, octets
+ if curr_sym != None:
+ wrapped_val = curr_val & 0xffffffff;
+ if curr_val & 0x80000000 != 0:
+ wrapped_val = 0x100000000 - wrapped_val;
+ outfile.write("#define %s -0x%x\n" % (curr_sym.upper(), wrapped_val));
+ else:
+ outfile.write("#define %s 0x%x\n" % (curr_sym.upper(), wrapped_val));
+ out_reset();
+
for line in pipe:
if curr_sym != None:
#
@@ -65,32 +83,32 @@ for line in pipe:
for i in range (0, 3):
# 6-character margin, 2-characters + 1 space for each field
idx = 6 + i * 3;
- octetstr = line[idx:idx+2]
+ octetstr = line[idx:idx+3]
if not numpattern.match(octetstr):
break;
+ if curr_octet > octets:
+ break;
+
curr_val += int('0x%s' % octetstr, 16) << (curr_octet * 8);
curr_octet += 1;
- if curr_octet < 4:
- continue;
-
- outfile.write("#define %s 0x%x\n" % (curr_sym.upper(), curr_val));
- curr_sym = None;
- curr_val = 0;
- curr_octet = 0;
- continue;
-
match = pattern.match(line)
if match == None:
continue;
- curr_sym = match.group(1);
+ # Print previous symbol
+ out_define();
+
+ v8match = v8dbg.match(match.group(2));
+ if v8match != None:
+ out_reset();
+ curr_sym = match.group(2);
+
+# Print last symbol
+out_define();
outfile.write("""
-#else
-#error "only i386 is supported for DTrace ustack helper"
-#endif
#endif /* V8_CONSTANTS_H */
""");