Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
a164e4c0
Commit
a164e4c0
authored
Jul 01, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more pyc debugging
ie for the "repeatedly failing to parse file" error.
parent
9abf0b58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/codegen/parser.cpp
src/codegen/parser.cpp
+13
-0
No files found.
src/codegen/parser.cpp
View file @
a164e4c0
...
...
@@ -37,6 +37,8 @@
namespace
pyston
{
bool
DEBUG_PARSING
=
false
;
class
BufferedReader
{
private:
static
const
int
BUFSIZE
=
1024
;
...
...
@@ -1043,6 +1045,11 @@ static ParseResult _reparse(const char* fn, const std::string& cache_fn, AST_Mod
if
(
!
cache_fp
)
return
ParseResult
::
PYC_UNWRITABLE
;
if
(
DEBUG_PARSING
)
{
fprintf
(
stderr
,
"_reparse('%s', '%s'), pypa=%d
\n
"
,
fn
,
cache_fn
.
c_str
(),
ENABLE_PYPA_PARSER
);
fprintf
(
stderr
,
"writing magic string: %d %d %d %d
\n
"
,
getMagic
()[
0
],
getMagic
()[
1
],
getMagic
()[
2
],
getMagic
()[
3
]);
}
fwrite
(
getMagic
(),
1
,
MAGIC_STRING_LENGTH
,
cache_fp
);
int
checksum_start
=
ftell
(
cache_fp
);
...
...
@@ -1094,6 +1101,9 @@ static ParseResult _reparse(const char* fn, const std::string& cache_fn, AST_Mod
// it's not a huge deal right now, but this caching version can significantly cut down
// on the startup time (40ms -> 10ms).
AST_Module
*
caching_parse_file
(
const
char
*
fn
)
{
if
(
DEBUG_PARSING
)
{
fprintf
(
stderr
,
"caching_parse_file('%s'), pypa=%d
\n
"
,
fn
,
ENABLE_PYPA_PARSER
);
}
UNAVOIDABLE_STAT_TIMER
(
t0
,
"us_timer_caching_parse_file"
);
static
StatCounter
us_parsing
(
"us_parsing"
);
Timer
_t
(
"parsing"
);
...
...
@@ -1214,6 +1224,9 @@ AST_Module* caching_parse_file(const char* fn) {
assert
(
!
good
);
tries
++
;
RELEASE_ASSERT
(
tries
<=
MAX_TRIES
,
"repeatedly failing to parse file"
);
if
(
tries
==
MAX_TRIES
)
DEBUG_PARSING
=
true
;
if
(
!
good
)
{
assert
(
!
fp
);
file_data
.
clear
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment