Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Kirill Smelkov
cpython
Commits
6f4f7424
Commit
6f4f7424
authored
Sep 25, 1996
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed PM debugging
Added different arrow-icons for running/calling/returning/exception
parent
4097d1c3
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
871 additions
and
392 deletions
+871
-392
Mac/Tools/twit/TwitCore.py
Mac/Tools/twit/TwitCore.py
+35
-4
Mac/Tools/twit/mac_widgets.py
Mac/Tools/twit/mac_widgets.py
+4
-3
Mac/Tools/twit/mactwit_app.py
Mac/Tools/twit/mactwit_app.py
+1
-0
Mac/Tools/twit/twit.rsrc.hqx
Mac/Tools/twit/twit.rsrc.hqx
+831
-385
No files found.
Mac/Tools/twit/TwitCore.py
View file @
6f4f7424
...
...
@@ -13,6 +13,13 @@ SIMPLE_TYPES=(
types
.
StringType
)
# XXXX Mac-specific
ICON_NORMAL
=
512
ICON_RETURN
=
515
ICON_CALL
=
516
ICON_ZERO
=
517
ICON_DEAD
=
518
def
Initialize
():
pass
...
...
@@ -23,6 +30,7 @@ class DebuggerStuff(bdb.Bdb):
self
.
parent
=
parent
self
.
exception_info
=
(
None
,
None
)
self
.
reason
=
'Not running'
self
.
icon
=
ICON_NORMAL
self
.
reset
()
def
reset
(
self
):
...
...
@@ -30,6 +38,7 @@ class DebuggerStuff(bdb.Bdb):
self
.
forget
()
def
forget
(
self
):
print
'FORGET'
self
.
lineno
=
None
self
.
stack
=
[]
self
.
curindex
=
0
...
...
@@ -37,6 +46,7 @@ class DebuggerStuff(bdb.Bdb):
def
setup
(
self
,
f
,
t
):
self
.
forget
()
print
'SETUP'
,
f
,
t
self
.
stack
,
self
.
curindex
=
self
.
get_stack
(
f
,
t
)
self
.
curframe
=
self
.
stack
[
self
.
curindex
][
0
]
...
...
@@ -46,19 +56,23 @@ class DebuggerStuff(bdb.Bdb):
self
.
exception_info
=
(
None
,
None
)
def
user_call
(
self
,
frame
,
argument_list
):
self
.
reason
=
'Calling function'
self
.
reason
=
'Calling'
self
.
icon
=
ICON_CALL
self
.
interaction
(
frame
,
None
)
def
user_line
(
self
,
frame
):
self
.
reason
=
'Stopped'
self
.
icon
=
ICON_NORMAL
self
.
interaction
(
frame
,
None
)
def
user_return
(
self
,
frame
,
return_value
):
self
.
reason
=
'Returning from function'
self
.
reason
=
'Returning'
self
.
icon
=
ICON_RETURN
self
.
interaction
(
frame
,
None
)
def
user_exception
(
self
,
frame
,
(
exc_type
,
exc_value
,
exc_traceback
)):
self
.
reason
=
'Exception occurred'
self
.
icon
=
ICON_DEAD
self
.
exception_info
=
(
exc_type
,
exc_value
)
self
.
interaction
(
frame
,
exc_traceback
)
...
...
@@ -71,6 +85,7 @@ class DebuggerStuff(bdb.Bdb):
return
tp
,
value
def
getstacktrace
(
self
):
print
'DBG GETSTACKTRACE'
,
self
.
stack
names
,
locations
=
[],
[]
for
frame
,
lineno
in
self
.
stack
:
name
=
frame
.
f_code
.
co_name
...
...
@@ -89,6 +104,7 @@ class DebuggerStuff(bdb.Bdb):
if
not
modname
:
modname
=
"<unknown>"
locations
.
append
(
"%s:%d"
%
(
modname
,
lineno
))
print
'DBG RETURNS'
,
names
,
locations
return
names
,
locations
def
getframe
(
self
,
number
):
...
...
@@ -128,11 +144,13 @@ class Application:
self
.
run_dialog
.
open
()
self
.
module_dialog
=
None
self
.
initial_cmd
=
None
self
.
cur_string_name
=
None
if
pm_args
:
while
pm_args
.
tb_next
<>
None
:
pm_args
=
pm_args
.
tb_next
self
.
dbg
.
setup
(
pm_args
.
tb_frame
,
pm_args
)
self
.
run_dialog
.
setsession_pm
()
self
.
run_dialog
.
update_views
()
elif
run_args
:
self
.
run_dialog
.
setsession_run
()
self
.
initial_cmd
=
run_args
...
...
@@ -164,6 +182,12 @@ class Application:
def
run
(
self
):
cmd
=
AskString
(
'Statement to execute:'
)
self
.
cur_string_name
=
'<string: "%s">'
%
cmd
try
:
cmd
=
compile
(
cmd
,
self
.
cur_string_name
,
'exec'
)
except
SyntaxError
,
arg
:
ShowMessage
(
'Syntax error: %s'
%
`arg`
)
return
self
.
initial_cmd
=
(
cmd
,
None
,
None
)
self
.
run_dialog
.
setsession_run
()
self
.
exit_mainloop
()
...
...
@@ -247,12 +271,19 @@ class StackBrowser:
self
.
cur_line
=
optnextline
if
self
.
cur_source
==
'<string>'
:
self
.
cur_source
=
None
msg
=
"Executing from <string>"
msg
=
"Executing from unknown <string>"
elif
type
(
self
.
cur_source
)
==
types
.
StringType
and
\
self
.
cur_source
[:
8
]
==
'<string:'
:
msg
=
"Executing from "
+
self
.
cur_source
self
.
cur_source
=
None
print
'SOURCE'
,
self
.
cur_source
print
'LINE'
,
self
.
cur_line
self
.
setsource
(
msg
)
self
.
source
.
setcurline
(
self
.
cur_line
)
if
not
self
.
cur_line
:
self
.
source
.
setcurline
(
1
,
ICON_ZERO
)
else
:
self
.
source
.
setcurline
(
self
.
cur_line
,
self
.
parent
.
dbg
.
icon
)
self
.
breaks_changed
(
self
.
cur_source
)
...
...
Mac/Tools/twit/mac_widgets.py
View file @
6f4f7424
...
...
@@ -14,7 +14,6 @@ MARGIN=2
ICONSIZE
=
16
TEXTWIDTH
=
4096
# More-or-less random value
PIC_CURRENT
=
512
PIC_BREAK
=
513
picture_cache
=
{}
...
...
@@ -179,14 +178,16 @@ class MT_IconTextWidget(MT_TextWidget):
self
.
terect
[
0
]
-
1
,
self
.
terect
[
3
]
-
1
)
self
.
curlinerange
=
(
self
.
terect
[
1
]
+
self
.
ted
.
lineHeight
,
self
.
terect
[
3
]
-
2
*
self
.
ted
.
lineHeight
)
self
.
piccurrent
=
512
def
setbreaks
(
self
,
list
):
self
.
breakpointlist
=
list
[:]
Qd
.
SetPort
(
self
.
wid
)
Win
.
InvalRect
(
self
.
iconrect
)
def
setcurline
(
self
,
line
):
def
setcurline
(
self
,
line
,
pic
=
512
):
self
.
curline
=
line
self
.
piccurrent
=
pic
Qd
.
SetPort
(
self
.
wid
)
self
.
showline
(
line
)
...
...
@@ -224,7 +225,7 @@ class MT_IconTextWidget(MT_TextWidget):
if
topline
<=
i
<=
botline
:
self
.
draw1icon
(
i
,
PIC_BREAK
)
if
self
.
curline
<>
None
and
topline
<=
self
.
curline
<=
botline
:
self
.
draw1icon
(
self
.
curline
,
PIC_CURRENT
)
self
.
draw1icon
(
self
.
curline
,
self
.
piccurrent
)
def
draw1icon
(
self
,
line
,
which
):
offset
=
self
.
line_index
[
line
]
...
...
Mac/Tools/twit/mactwit_app.py
View file @
6f4f7424
...
...
@@ -18,6 +18,7 @@ _watch = Qd.GetCursor(4).data
# Made available to TwitCore:
AskString
=
EasyDialogs
.
AskString
ShowMessage
=
EasyDialogs
.
Message
def
SetCursor
():
Qd
.
SetCursor
(
_arrow
)
...
...
Mac/Tools/twit/twit.rsrc.hqx
View file @
6f4f7424
This diff is collapsed.
Click to expand it.
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