Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
8098e6a0
Commit
8098e6a0
authored
Aug 28, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the processing overhead in the debug line mapping writer a little.
parent
04edac6e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+10
-10
Cython/Debugger/DebugWriter.py
Cython/Debugger/DebugWriter.py
+4
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
8098e6a0
...
...
@@ -9,13 +9,14 @@ cython.declare(Naming=object, Options=object, PyrexTypes=object, TypeSlots=objec
error
=
object
,
warning
=
object
,
py_object_type
=
object
,
UtilityCode
=
object
,
EncodedString
=
object
,
re
=
object
)
from
collections
import
defaultdict
import
json
import
operator
import
os
import
re
import
operator
from
.PyrexTypes
import
CPtrType
from
.
import
Future
from
.
import
Annotate
from
.
import
Code
from
.
import
Naming
...
...
@@ -456,19 +457,18 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
tb
=
env
.
context
.
gdb_debug_outputwriter
markers
=
ccodewriter
.
buffer
.
allmarkers
()
d
=
{}
d
=
defaultdict
(
list
)
for
c_lineno
,
cython_lineno
in
enumerate
(
markers
):
if
cython_lineno
>
0
:
d
.
setdefault
(
cython_lineno
,
[])
.
append
(
c_lineno
+
1
)
d
[
cython_lineno
]
.
append
(
c_lineno
+
1
)
tb
.
start
(
'LineNumberMapping'
)
for
cython_lineno
,
c_linenos
in
sorted
(
d
.
items
()):
attrs
=
{
'c_linenos'
:
' '
.
join
(
map
(
str
,
c_linenos
)),
'cython_lineno'
:
str
(
cython_lineno
),
}
tb
.
start
(
'LineNumber'
,
attrs
)
tb
.
end
(
'LineNumber'
)
tb
.
add_entry
(
'LineNumber'
,
c_linenos
=
' '
.
join
(
map
(
str
,
c_linenos
)),
cython_lineno
=
str
(
cython_lineno
),
)
tb
.
end
(
'LineNumberMapping'
)
tb
.
serialize
()
...
...
Cython/Debugger/DebugWriter.py
View file @
8098e6a0
...
...
@@ -44,6 +44,10 @@ class CythonDebugWriter(object):
def
end
(
self
,
name
):
self
.
tb
.
end
(
name
)
def
add_entry
(
self
,
name
,
**
attrs
):
self
.
tb
.
start
(
name
,
attrs
)
self
.
tb
.
end
(
name
)
def
serialize
(
self
):
self
.
tb
.
end
(
'Module'
)
self
.
tb
.
end
(
'cython_debug'
)
...
...
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