@ -10,6 +10,7 @@ set current_output_win .cmd.text
set cfunc NIL
set line_numbers 1
set breakpoint_file( -1 ) { [ garbage ] }
set disassemble_with_source nosource
# o p t i o n a d d * F o r e g r o u n d B l a c k
# o p t i o n a d d * B a c k g r o u n d W h i t e
@ -729,14 +730,15 @@ proc add_expr {expr} {
checkbutton $e.update - text " " - relief flat \
-variable expr_update_list( $expr_num )
message $e.expr - text $expr - aspect 200
text $e.expr - width 20 - height 1
$e.expr insert 0.0 $expr
bind $e.expr < 1 > " u p d a t e _ e x p r $ e x p r _ n u m "
message $e.val - aspect 200
text $e.val - width 20 - height 1
update_expr $expr_num
pack $e.update - side left - anchor nw
pack $e.expr $e.val - side left - expand yes - anchor w
pack $e.expr $e.val - side left - expand yes - fill x
pack $e - side top - fill x - anchor w
}
@ -761,6 +763,7 @@ proc delete_expr {} {
proc update_expr { expr_num } {
global delete_expr_flag
global expr_update_list
set e .expr.e$ { expr_num }
@ -770,15 +773,34 @@ proc update_expr {expr_num} {
tk_butUp .expr.delete
tk_butLeave .expr.delete
bind .expr.delete < Any-Leave> { }
unset expr_update_list( $expr_num )
return
}
set expr [ lindex [ $e.expr configure - text] 4 ]
set expr [ $e.expr get 0.0 end]
$e.val delete 0.0 end
if [ catch " g d b _ e v a l $ e x p r " val] {
} else {
$e.val insert 0.0 $val
}
}
proc update_exprs { } {
global expr_update_list
$e.val config - text [ gdb_eval $expr ]
foreach expr_num [ array names expr_update_list] {
if $expr_update_list ( $expr_num ) {
update_expr $expr_num
}
}
}
proc create_expr_win { } {
if [ winfo exists .expr] { raise .expr ; return }
toplevel .expr
wm minsize .expr 1 1
wm title .expr Expression
@ -832,7 +854,7 @@ proc create_expr_win {} {
#
proc display_expression { expression } {
if ! [ winfo exists .expr] { create_expr_win }
create_expr_win
add_expr $expression
}
@ -991,6 +1013,7 @@ proc create_asm_win {funcname pc} {
global breakpoint_line
global current_output_win
global pclist
global disassemble_with_source
# R e p l a c e a l l t h e d i r t y c h a r a c t e r s i n $ f i l e n a m e w i t h c l e a n o n e s , a n d g e n e r a t e
# a u n i q u e n a m e f o r t h e t e x t w i d g e t .
@ -1018,7 +1041,7 @@ proc create_asm_win {funcname pc} {
set temp $current_output_win
set current_output_win $win
catch " g d b _ d i s a s s e m b l e s o u r c e $ p c "
catch " g d b _ d i s a s s e m b l e $ d i s a s s e m b l e _ w i t h _ so u r c e $ p c "
set current_output_win $temp
set numlines [ $win index end]
@ -1041,7 +1064,6 @@ proc create_asm_win {funcname pc} {
$win insert $i.0 " "
}
# S c a n t h o u g h t h e b r e a k p o i n t d a t a b a s e a n d i n s t a l l a n y d e s t i n e d f o r t h i s f i l e
# f o r e a c h b p n u m [ a r r a y n a m e s b r e a k p o i n t _ f i l e ] {
@ -1212,53 +1234,64 @@ proc update_listing {linespec} {
proc create_asm_window { } {
global cfunc
if ! [ winfo exists .asm] {
set cfunc * None*
set win [ asm_win_name $cfunc ]
if [ winfo exists .asm] { raise .asm ; return }
set cfunc * None*
set win [ asm_win_name $cfunc ]
build_framework .asm Assembly " * N I L * "
build_framework .asm Assembly " * N I L * "
# F i r s t , d e l e t e a l l t h e o l d m e n u e n t r i e s
.asm.menubar.view.menu delete 0 last
.asm.menubar.view.menu delete 0 last
.asm.text configure - yscrollcommand asmscrollproc
.asm.text configure - yscrollcommand asmscrollproc
frame .asm.row1
frame .asm.row2
frame .asm.row1
frame .asm.row2
button .asm.stepi - width 6 - text Stepi \
-command { catch { gdb_cmd stepi} ; update_ptr }
button .asm.nexti - width 6 - text Nexti \
-command { catch { gdb_cmd nexti} ; update_ptr }
button .asm.continue - width 6 - text Cont \
-command { catch { gdb_cmd continue} ; update_ptr }
button .asm.finish - width 6 - text Finish \
-command { catch { gdb_cmd finish} ; update_ptr }
button .asm.up - width 6 - text Up - command { catch { gdb_cmd up} ; update_ptr }
button .asm.down - width 6 - text Down \
-command { catch { gdb_cmd down} ; update_ptr }
button .asm.bottom - width 6 - text Bottom \
-command { catch { gdb_cmd { frame 0 } } ; update_ptr }
button .asm.stepi - width 6 - text Stepi \
-command { catch { gdb_cmd stepi} ; update_ptr }
button .asm.nexti - width 6 - text Nexti \
-command { catch { gdb_cmd nexti} ; update_ptr }
button .asm.continue - width 6 - text Cont \
-command { catch { gdb_cmd continue} ; update_ptr }
button .asm.finish - width 6 - text Finish \
-command { catch { gdb_cmd finish} ; update_ptr }
button .asm.up - width 6 - text Up - command { catch { gdb_cmd up} ; update_ptr }
button .asm.down - width 6 - text Down \
-command { catch { gdb_cmd down} ; update_ptr }
button .asm.bottom - width 6 - text Bottom \
-command { catch { gdb_cmd { frame 0 } } ; update_ptr }
pack .asm.stepi .asm.continue .asm.up .asm.bottom - side left - padx 3 - pady 5 - in .asm.row1
pack .asm.nexti .asm.finish .asm.down - side left - padx 3 - pady 5 - in .asm.row2
pack .asm.stepi .asm.continue .asm.up .asm.bottom - side left - padx 3 - pady 5 - in .asm.row1
pack .asm.nexti .asm.finish .asm.down - side left - padx 3 - pady 5 - in .asm.row2
pack .asm.row2 .asm.row1 - side bottom - anchor w - before .asm.info
pack .asm.row2 .asm.row1 - side bottom - anchor w - before .asm.info
update
update
update_assembly [ gdb_loc ]
update_assembly [ gdb_loc ]
# W e d o t h i s u p d a t e _ a s s e m b l y t o g e t t h e p r o p e r v a l u e o f d i s a s s e m b l e - f r o m - e x e c .
# e x e c f i l e m e n u i t e m
.asm.menubar.view.menu add radiobutton - label " E x e c f i l e " \
-variable disassemble-from-exec - value 1
.asm.menubar.view.menu add radiobutton - label " E x e c f i l e " \
-variable disassemble-from-exec - value 1
# t a r g e t m e m o r y m e n u i t e m
.asm.menubar.view.menu add radiobutton - label " T a r g e t m e m o r y " \
-variable disassemble-from-exec - value 0
}
.asm.menubar.view.menu add radiobutton - label " T a r g e t m e m o r y " \
-variable disassemble-from-exec - value 0
# D i s a s s e m b l e w i t h s o u r c e
.asm.menubar.view.menu add checkbutton - label " S o u r c e " \
-variable disassemble_with_source - onvalue source \
-offvalue nosource - command {
foreach asm [ info command .asm.func_* ] {
destroy $asm
}
set cfunc NIL
update_assembly [ gdb_loc ]
}
}
proc reg_config_menu { } {
@ -1333,7 +1366,7 @@ proc reg_config_menu {} {
proc create_registers_window { } {
global reg_format
if [ winfo exists .reg] return
if [ winfo exists .reg] { raise .reg ; return }
# C r e a t e a n i n i t i a l r e g i s t e r d i s p l a y l i s t c o n s i s t i n g o f a l l r e g i s t e r s
@ -1634,6 +1667,9 @@ proc update_ptr {} {
if [ winfo exists .reg] {
update_registers changed
}
if [ winfo exists .expr] {
update_exprs
}
}
# M a k e t o p l e v e l w i n d o w d i s a p p e a r
@ -1747,10 +1783,10 @@ proc build_framework {win {title GDBtk} {label {}}} {
menu $ { win } .menubar.window.menu
$ { win } .menubar.window.menu add command - label Command \
-command { echo Command}
-command create_command_window
$ { win } .menubar.window.menu add separator
$ { win } .menubar.window.menu add command - label Source \
-command { echo Source}
-command { create_source_window ; update_ptr }
$ { win } .menubar.window.menu add command - label Assembly \
-command { create_asm_window ; update_ptr }
$ { win } .menubar.window.menu add separator
@ -1759,9 +1795,9 @@ proc build_framework {win {title GDBtk} {label {}}} {
$ { win } .menubar.window.menu add command - label Expressions \
-command { create_expr_win ; update_ptr }
$ { win } .menubar.window.menu add separator
$ { win } .menubar.window.menu add command - label Files \
-command { not_implemented_yet " f i l e s w i n d o w " }
# $ { w i n } . m e n u b a r . w i n d o w . m e n u a d d s e p a r a t o r
# $ { w i n } . m e n u b a r . w i n d o w . m e n u a d d c o m m a n d - l a b e l F i l e s \
# - c o m m a n d { n o t _ i m p l e m e n t e d _ y e t " f i l e s w i n d o w " }
menubutton $ { win } .menubar.help - padx 12 - text Help \
-menu $ { win } .menubar.help.menu - underline 0
@ -1805,6 +1841,8 @@ proc create_source_window {} {
global wins
global cfile
if [ winfo exists .src] { raise .src ; return }
build_framework .src Source " * N o f i l e * "
# F i r s t , d e l e t e a l l t h e o l d v i e w m e n u e n t r i e s
@ -1873,6 +1911,8 @@ proc create_source_window {} {
proc create_command_window { } {
global command_line
if [ winfo exists .cmd] { raise .cmd ; return }
build_framework .cmd Command " * C o m m a n d B u f f e r * "
set command_line { }
@ -2602,7 +2642,7 @@ set current_output_win .t
gdb_cmd " s h o w v e r s i o n "
set current_output_win $temp
message .c.m - text [ .t get 0.0 end] - aspect 500
message .c.m - text [ .t get 0.0 end] - aspect 500 - relief raised
destroy .t
pack .c.m
bind .c.m < Leave> { destroy .c}