Permalink
Please sign in to comment.
Browse files
Fix a horrible bug in util.Enum that I introduced on Monday.
__hash__ and __eq__ have to match. That was my fault. However, I believe this exposed a bug in Python 2.7. It led some reason this led to non-determinism that depended on whether there's a .pyc file or not!!! There is a repro in test/unit.sh. Tested under multiple Python interpreter, and under GDB. (TODO later: investigate the root cause.) Simplify lookups keyed by Id -- use enum_value instead. Also: - Automate the re2c dependency. Upgrade to 1.0.3. - Got uftrace working on a stock Python interpreter! - Trace in Python too (benchmarks/pytrace.py).
- Loading branch information...
Showing
with
200 additions
and 23 deletions.
- +1 −0 .gitignore
- +1 −0 README.md
- +16 −2 benchmarks/pytrace.py
- +34 −0 benchmarks/uftrace.sh
- +16 −2 build/codegen.sh
- +16 −4 build/prepare.sh
- +9 −8 core/id_kind.py
- +8 −0 core/id_kind_test.py
- +7 −4 core/lexer_gen.py
- +3 −3 core/util.py
- +36 −0 native/fastlex_test.py
- +53 −0 test/unit.sh
| @@ -0,0 +1,34 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Usage: | ||
| # ./uftrace.sh <function name> | ||
| set -o nounset | ||
| set -o pipefail | ||
| set -o errexit | ||
| #uftrace() { | ||
| # ~/src/uftrace-0.8.1/uftrace "$@" | ||
| #} | ||
| python-demo() { | ||
| uftrace _devbuild/cpython-instrumented/python -h | ||
| } | ||
| # https://github.com/namhyung/uftrace/wiki/Tutorial | ||
| hello-demo() { | ||
| cat >_tmp/hello.c <<EOF | ||
| #include <stdio.h> | ||
| int main(void) { | ||
| printf("Hello world\n"); | ||
| return 0; | ||
| } | ||
| EOF | ||
| gcc -o _tmp/hello -pg _tmp/hello.c | ||
| uftrace _tmp/hello | ||
| } | ||
| "$@" |
0 comments on commit
3cb2205