@ -26,7 +26,6 @@ set current_label {}
set screen_height 0
set screen_top 0
set screen_bot 0
set current_output_win .cmd.text
set cfunc NIL
set line_numbers 1
set breakpoint_file( -1 ) { [ garbage ] }
@ -65,10 +64,8 @@ if [info exists env(EDITOR)] then {
#
proc gdbtk_tcl_fputs { arg } {
global current_output_win
$current_output_win insert end " $ a r g "
$current_output_win yview - pickplace end
.cmd.text insert end " $ a r g "
.cmd.text yview - pickplace end
}
proc gdbtk_tcl_fputs_error { arg } {
@ -87,9 +84,7 @@ proc gdbtk_tcl_fputs_error {arg} {
#
proc gdbtk_tcl_flush { } {
global current_output_win
$current_output_win yview - pickplace end
.cmd.text yview - pickplace end
update idletasks
}
@ -149,18 +144,179 @@ proc gdbtk_tcl_end_variable_annotation {} {
# o f :
# c r e a t e - N o t i f y o f b r e a k p o i n t c r e a t i o n
# d e l e t e - N o t i f y o f b r e a k p o i n t d e l e t i o n
# e n a b l e - N o t i f y o f b r e a k p o i n t e n a b l i n g
# d i s a b l e - N o t i f y o f b r e a k p o i n t d i s a b l i n g
#
# A l l a c t i o n s t a k e t h e s a m e s e t o f a r g u m e n t s : B P N U M i s t h e b r e a k p o i n t
# n u m b e r , F I L E i s t h e s o u r c e f i l e a n d L I N E i s t h e l i n e n u m b e r , a n d P C i s
# t h e p c o f t h e a f f e c t e d b r e a k p o i n t .
# m o d i f y - N o t i f y o f b r e a k p o i n t m o d i f i c a t i o n
#
proc gdbtk_tcl_breakpoint { action bpnum file line pc} {
# f i l e l i n e p c t y p e e n a b l e d d i s p o s i t i o n s i l e n t i g n o r e _ c o u n t c o m m a n d s c o n d _ s t r i n g t h r e a d h i t _ c o u n t
proc gdbtk_tcl_breakpoint { action bpnum} {
set bpinfo [ gdb_get_breakpoint_info $bpnum ]
set file [ lindex $bpinfo 0 ]
set line [ lindex $bpinfo 1 ]
set pc [ lindex $bpinfo 2 ]
set enable [ lindex $bpinfo 4 ]
if { $action == " m o d i f y " } {
if { $enable == " e n a b l e d " } {
set action enable
} else {
set action disable
}
}
$ { action } _breakpoint $bpnum $file $line $pc
}
proc create_breakpoints_window { } {
global bpframe_lasty
if [ winfo exists .breakpoints] { raise .breakpoints ; return }
build_framework .breakpoints " B r e a k p o i n t s " " "
# 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
.breakpoints.menubar.view.menu delete 0 last
# G e t r i d o f l a b e l
destroy .breakpoints.label
# R e p l a c e t e x t w i t h a c a n v a s a n d f i x t h e s c r o l l b a r s
destroy .breakpoints.text
canvas .breakpoints.c - relief sunken - bd 2 \
-cursor hand2 - yscrollcommand { .breakpoints.scroll set}
.breakpoints.scroll configure - command { .breakpoints.c yview}
scrollbar .breakpoints.scrollx - orient horizontal \
-command { .breakpoints.c xview} - relief sunken
pack .breakpoints.scrollx - side bottom - fill x - in .breakpoints.info
pack .breakpoints.c - side left - expand yes - fill both \
-in .breakpoints.info
set bpframe_lasty 0
# C r e a t e a f r a m e f o r e a c h b r e a k p o i n t
foreach bpnum [ gdb_get_breakpoint_list ] {
add_breakpoint_frame $bpnum
}
}
# C r e a t e a f r a m e f o r b p n u m i n t h e . b r e a k p o i n t s c a n v a s
proc add_breakpoint_frame bpnum {
global bpframe_lasty
if ! [ winfo exists .breakpoints] return
set bpinfo [ gdb_get_breakpoint_info $bpnum ]
set file [ lindex $bpinfo 0 ]
set line [ lindex $bpinfo 1 ]
set pc [ lindex $bpinfo 2 ]
set type [ lindex $bpinfo 3 ]
set enabled [ lindex $bpinfo 4 ]
set disposition [ lindex $bpinfo 5 ]
set silent [ lindex $bpinfo 6 ]
set ignore_count [ lindex $bpinfo 7 ]
set commands [ lindex $bpinfo 8 ]
set cond [ lindex $bpinfo 9 ]
set thread [ lindex $bpinfo 10 ]
set hit_count [ lindex $bpinfo 11 ]
set f .breakpoints.c.$bpnum
if ! [ winfo exists $f ] {
frame $f - relief sunken - bd 2
label $f.id - text " # $ b p n u m $ f i l e : $ l i n e ( $ p c ) " \
-relief flat - bd 2 - anchor w
label $f.hit_count - text " H i t c o u n t : $ h i t _ c o u n t " - relief flat \
-bd 2 - anchor w
frame $f.thread
label $f.thread.label - text " T h r e a d : " - relief flat - bd 2 \
-width 11 - anchor w
entry $f.thread.entry - bd 2 - relief sunken - width 10
$f.thread.entry insert end $thread
pack $f.thread.label - side left
pack $f.thread.entry - side left - fill x
frame $f.cond
label $f.cond.label - text " C o n d i t i o n : " - relief flat - bd 2 \
-width 11 - anchor w
entry $f.cond.entry - bd 2 - relief sunken
$f.cond.entry insert end $cond
pack $f.cond.label - side left
pack $f.cond.entry - side left - fill x - expand yes
frame $f.ignore_count
label $f.ignore_count.label - text " I g n o r e c o u n t : " \
-relief flat - bd 2 - width 11 - anchor w
entry $f.ignore_count.entry - bd 2 - relief sunken - width 10
$f.ignore_count.entry insert end $ignore_count
pack $f.ignore_count.label - side left
pack $f.ignore_count.entry - side left - fill x
frame $f.disps
checkbutton $f.disps.enabled - text " E n a b l e d " \
-variable enabled - anchor w - relief flat
radiobutton $f.disps.delete - text Delete \
-variable disposition - anchor w - relief flat
radiobutton $f.disps.disable - text Disable \
-variable disposition - anchor w - relief flat
radiobutton $f.disps.donttouch - text " L e a v e a l o n e " \
-variable disposition - anchor w - relief flat
pack $f.disps.delete $f.disps.disable $f.disps.donttouch \
-side left - anchor w
pack $f.disps.enabled - side right - anchor e
text $f.commands - relief sunken - bd 2 - setgrid true \
-cursor hand2 - height 3 - width 30
foreach line $commands {
$f.commands insert end " $ { l i n e } \n "
}
pack $f.id - side top - anchor nw - fill x
pack $f.hit_count $f.cond $f.thread $f.ignore_count $f.disps \
$f.commands -side top - fill x - anchor nw
}
set tag [ .breakpoints.c create window 0 $bpframe_lasty - window $f - anchor nw]
update
set bbox [ .breakpoints.c bbox $tag ]
set bpframe_lasty [ lindex $bbox 3 ]
}
# D e l e t e a b r e a k p o i n t f r a m e
proc delete_breakpoint_frame bpnum {
global bpframe_lasty
if ! [ winfo exists .breakpoints] return
# F i r s t , c l e a r t h e c a n v a s
.breakpoints.c delete all
# N o w , r e p o p u l a t e i t w i t h a l l b u t t h e d o o m e d b r e a k p o i n t
set bpframe_lasty 0
foreach bp [ gdb_get_breakpoint_list ] {
if { $bp != $bpnum } {
add_breakpoint_frame $bp
}
}
}
proc asm_win_name { funcname } {
if { $funcname == " * N o n e * " } { return .asm.text}
@ -219,6 +375,10 @@ proc create_breakpoint {bpnum file line pc} {
if [ winfo exists $win ] {
insert_breakpoint_tag $win [ pc_to_line $pclist ( $cfunc ) $pc ]
}
# U p d a t e t h e b r e a k p o i n t s w i n d o w
add_breakpoint_frame $bpnum
}
#
@ -282,6 +442,8 @@ proc delete_breakpoint {bpnum file line pc} {
}
}
}
delete_breakpoint_frame $bpnum
}
#
@ -389,51 +551,51 @@ proc delete_breakpoint_tag {win line} {
proc gdbtk_tcl_busy { } {
if [ winfo exists .src] {
catch { .src.start configure - state disabled}
catch { .src.stop configure - state normal}
catch { .src.step configure - state disabled}
catch { .src.next configure - state disabled}
catch { .src.continue configure - state disabled}
catch { .src.finish configure - state disabled}
catch { .src.up configure - state disabled}
catch { .src.down configure - state disabled}
catch { .src.bottom configure - state disabled}
.src.start configure - state disabled
.src.stop configure - state normal
.src.step configure - state disabled
.src.next configure - state disabled
.src.continue configure - state disabled
.src.finish configure - state disabled
.src.up configure - state disabled
.src.down configure - state disabled
.src.bottom configure - state disabled
}
if [ winfo exists .asm] {
catch { .asm.stepi configure - state disabled}
catch { .asm.nexti configure - state disabled}
catch { .asm.continue configure - state disabled}
catch { .asm.finish configure - state disabled}
catch { .asm.up configure - state disabled}
catch { .asm.down configure - state disabled}
catch { .asm.bottom configure - state disabled}
catch { .asm.close configure - state disabled}
.asm.stepi configure - state disabled
.asm.nexti configure - state disabled
.asm.continue configure - state disabled
.asm.finish configure - state disabled
.asm.up configure - state disabled
.asm.down configure - state disabled
.asm.bottom configure - state disabled
}
return
}
proc gdbtk_tcl_idle { } {
if [ winfo exists .src] {
catch { .src.start configure - state normal}
catch { .src.stop configure - state disabled}
catch { .src.step configure - state normal}
catch { .src.next configure - state normal}
catch { .src.continue configure - state normal}
catch { .src.finish configure - state normal}
catch { .src.up configure - state normal}
catch { .src.down configure - state normal}
catch { .src.bottom configure - state normal}
.src.start configure - state normal
.src.stop configure - state disabled
.src.step configure - state normal
.src.next configure - state normal
.src.continue configure - state normal
.src.finish configure - state normal
.src.up configure - state normal
.src.down configure - state normal
.src.bottom configure - state normal
}
if [ winfo exists .asm] {
catch { .asm.stepi configure - state normal}
catch { .asm.nexti configure - state normal}
catch { .asm.continue configure - state normal}
catch { .asm.finish configure - state normal}
catch { .asm.up configure - state normal}
catch { .asm.down configure - state normal}
catch { .asm.bottom configure - state normal}
catch { .asm.close configure - state normal}
.asm.stepi configure - state normal
.asm.nexti configure - state normal
.asm.continue configure - state normal
.asm.finish configure - state normal
.asm.up configure - state normal
.asm.down configure - state normal
.asm.bottom configure - state normal
}
return
}
#
@ -499,6 +661,17 @@ menu .file_popup -cursor hand2
.file_popup add command - label " E d i t " - command { exec $editor + $selected_line $selected_file & }
.file_popup add command - label " S e t b r e a k p o i n t " - command { gdb_cmd " b r e a k $ s e l e c t e d _ f i l e : $ s e l e c t e d _ l i n e " }
# U s e t h i s p r o c e d u r e t o g e t t h e G D B c o r e t o e x e c u t e t h e s t r i n g ` c m d ' . T h i s i s
# a w r a p p e r a r o u n d g d b _ c m d , w h i c h w i l l c a t c h e r r o r s , a n d s e n d o u t p u t t o t h e
# c o m m a n d w i n d o w . I t w i l l a l s o c a u s e a l l o f t h e o t h e r w i n d o w s t o b e u p d a t e d .
proc interactive_cmd { cmd } {
catch { gdb_cmd " $ c m d " } result
.cmd.text insert end $result
.cmd.text yview - pickplace end
update_ptr
}
#
# B i n d i n g s :
#
@ -730,7 +903,7 @@ proc not_implemented_yet {message} {
# #
# L o c a l p r o c e d u r e :
#
# c r e a t e _ e x p r _ w i n - C r e a t e e x p r e s s i o n d i s p l a y w i n d o w
# c r e a t e _ e x p r _ w i n d o w - C r e a t e e x p r e s s i o n d i s p l a y w i n d o w
#
# D e s c r i p t i o n :
#
@ -818,7 +991,7 @@ proc update_exprs {} {
}
}
proc create_expr_win { } {
proc create_expr_window { } {
if [ winfo exists .expr] { raise .expr ; return }
@ -875,7 +1048,7 @@ proc create_expr_win {} {
#
proc display_expression { expression } {
create_expr_win
create_expr_window
add_expr $expression
}
@ -915,7 +1088,7 @@ proc create_file_win {filename debug_file} {
# F i l e c a n ' t b e r e a d . P u t e r r o r m e s s a g e i n t o . s r c . n o f i l e w i n d o w a n d r e t u r n .
catch { destroy .src.nofile}
text .src.nofile - height 25 - width 88 - relief raised \
text .src.nofile - height 25 - width 88 - relief sunken \
-borderwidth 2 - yscrollcommand textscrollproc \
-setgrid true - cursor hand2
.src.nofile insert 0.0 $fh
@ -927,22 +1100,21 @@ proc create_file_win {filename debug_file} {
# A c t u a l l y c r e a t e a n d d o b a s i c c o n f i g u r a t i o n o n t h e t e x t w i d g e t .
text $win - height 25 - width 88 - relief raised - borderwidth 2 \
text $win - height 25 - width 88 - relief sunken - borderwidth 2 \
-yscrollcommand textscrollproc - setgrid true - cursor hand2
# S e t u p a l l t h e b i n d i n g s
bind $win < Enter> { focus % W}
# b i n d $ w i n < 1 > { l i s t i n g _ w i n d o w _ b u t t o n _ 1 % W % X % Y % x % y }
bind $win < 1 > do_nothing
bind $win < B1-Motion> do_nothing
bind $win n { catch { gdb_cmd next} ; update_ptr }
bind $win s { catch { gdb_cmd step} ; update_ptr }
bind $win c { catch { gdb_cmd continue} ; update_ptr }
bind $win f { catch { gdb_cmd finish} ; update_ptr }
bind $win u { catch { gdb_cmd up} ; update_ptr }
bind $win d { catch { gdb_cmd down} ; update_ptr }
bind $win n { interactive_cmd next}
bind $win s { interactive_cmd step}
bind $win c { interactive_cmd continue}
bind $win f { interactive_cmd finish}
bind $win u { interactive_cmd up}
bind $win d { interactive_cmd down}
$win delete 0.0 end
$win insert 0.0 [ read $fh ]
@ -972,7 +1144,7 @@ proc create_file_win {filename debug_file} {
$win tag add margin $i.0 $i.8
}
# $ w i n t a g b i n d m a r g i n < 1 > { l i s t i n g _ w i n d o w _ b u t t o n _ 1 % W % X % Y % x % y }
$win tag bind margin < 1 > { listing_window_button_1 % W % X % Y % x % y }
$win tag bind source < 1 > {
% W mark set anchor " @ % x , % y w o r d s t a r t "
set last [ % W index " @ % x , % y w o r d e n d " ]
@ -1032,7 +1204,6 @@ proc create_file_win {filename debug_file} {
proc create_asm_win { funcname pc} {
global breakpoint_file
global breakpoint_line
global current_output_win
global pclist
global disassemble_with_source
@ -1043,7 +1214,7 @@ proc create_asm_win {funcname pc} {
# A c t u a l l y c r e a t e a n d d o b a s i c c o n f i g u r a t i o n o n t h e t e x t w i d g e t .
text $win - height 25 - width 80 - relief raised - borderwidth 2 \
text $win - height 25 - width 80 - relief sunken - borderwidth 2 \
-setgrid true - cursor hand2 - yscrollcommand asmscrollproc
# S e t u p a l l t h e b i n d i n g s
@ -1051,19 +1222,16 @@ proc create_asm_win {funcname pc} {
bind $win < Enter> { focus % W}
bind $win < 1 > { asm_window_button_1 % W % X % Y % x % y}
bind $win < B1-Motion> do_nothing
bind $win n { catch { gdb_cmd nexti} ; update_ptr }
bind $win s { catch { gdb_cmd stepi} ; update_ptr }
bind $win c { catch { gdb_cmd continue} ; update_ptr }
bind $win f { catch { gdb_cmd finish} ; update_ptr }
bind $win u { catch { gdb_cmd up} ; update_ptr }
bind $win d { catch { gdb_cmd down} ; update_ptr }
bind $win n { interactive_cmd nexti}
bind $win s { interactive_cmd stepi}
bind $win c { interactive_cmd continue}
bind $win f { interactive_cmd finish}
bind $win u { interactive_cmd up}
bind $win d { interactive_cmd down}
# D i s a s s e m b l e t h e c o d e , a n d r e a d i t i n t o t h e n e w t e x t w i d g e t
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 $ d i s a s s e m b l e _ w i t h _ s o u r c e $ p c "
set current_output_win $temp
$win insert end [ gdb_disassemble $disassemble_with_source $pc ]
set numlines [ $win index end]
set numlines [ lindex [ split $numlines .] 0 ]
@ -1272,18 +1440,18 @@ proc create_asm_window {} {
frame .asm.row2
button .asm.stepi - width 6 - text Stepi \
-command { catch { gdb_cmd stepi} ; update_ptr }
-command { interactive_cmd stepi}
button .asm.nexti - width 6 - text Nexti \
-command { catch { gdb_cmd nexti} ; update_ptr }
-command { interactive_cmd nexti}
button .asm.continue - width 6 - text Cont \
-command { catch { gdb_cmd continue} ; update_ptr }
-command { interactive_cmd continue}
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 }
-command { interactive_cmd finish}
button .asm.up - width 6 - text Up - command { interactive_cmd up}
button .asm.down - width 6 - text Down \
-command { catch { gdb_cmd down} ; update_ptr }
-command { interactive_cmd down}
button .asm.bottom - width 6 - text Bottom \
-command { catch { gdb _cmd { frame 0 } } ; update_ptr }
-command { interactive _cmd { frame 0 } }
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
@ -1691,6 +1859,9 @@ proc update_ptr {} {
if [ winfo exists .expr] {
update_exprs
}
if [ winfo exists .autocmd] {
update_autocmd
}
}
# 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
@ -1703,10 +1874,10 @@ proc files_command {} {
wm minsize .files_window 1 1
# w m o v e r r i d e r e d i r e c t . f i l e s _ w i n d o w t r u e
listbox .files_window.list - geometry 30 x20 - setgrid true \
-yscrollcommand { .files_window.scroll set} - relief raised \
-yscrollcommand { .files_window.scroll set} - relief sunken \
-borderwidth 2
scrollbar .files_window.scroll - orient vertical \
-command { .files_window.list yview}
-command { .files_window.list yview} - relief sunken
button .files_window.close - text Close - command { destroy .files_window}
tk_listboxSingleSelect .files_window.list
@ -1789,25 +1960,25 @@ proc build_framework {win {title GDBtk} {label {}}} {
-command " d e s t r o y $ { w i n } "
$ { win } .menubar.file.menu add separator
$ { win } .menubar.file.menu add command - label Quit \
-command { catch { gdb_cmd quit } }
-command { interactive_cmd quit}
menubutton $ { win } .menubar.commands - padx 12 - text Commands \
-menu $ { win } .menubar.commands.menu - underline 0
menu $ { win } .menubar.commands.menu
$ { win } .menubar.commands.menu add command - label Run \
-command { catch { gdb_cmd run } ; update_ptr }
-command { interactive_cmd run}
$ { win } .menubar.commands.menu add command - label Step \
-command { catch { gdb_cmd step } ; update_ptr }
-command { interactive_cmd step}
$ { win } .menubar.commands.menu add command - label Next \
-command { catch { gdb_cmd next } ; update_ptr }
-command { interactive_cmd next}
$ { win } .menubar.commands.menu add command - label Continue \
-command { catch { gdb_cmd continue } ; update_ptr }
-command { interactive_cmd continue}
$ { win } .menubar.commands.menu add separator
$ { win } .menubar.commands.menu add command - label Stepi \
-command { catch { gdb_cmd stepi } ; update_ptr }
-command { interactive_cmd stepi}
$ { win } .menubar.commands.menu add command - label Nexti \
-command { catch { gdb_cmd nexti } ; update_ptr }
-command { interactive_cmd nexti}
menubutton $ { win } .menubar.view - padx 12 - text Options \
-menu $ { win } .menubar.view.menu - underline 0
@ -1828,14 +1999,18 @@ proc build_framework {win {title GDBtk} {label {}}} {
-command create_command_window
$ { win } .menubar.window.menu add separator
$ { win } .menubar.window.menu add command - label Source \
-command { create_source_window ; update_ptr }
-command create_source_window
$ { win } .menubar.window.menu add command - label Assembly \
-command { create_asm_window ; update_ptr }
-command create_asm_window
$ { win } .menubar.window.menu add separator
$ { win } .menubar.window.menu add command - label Registers \
-command { create_registers_window ; update_ptr }
-command create_registers_window
$ { win } .menubar.window.menu add command - label Expressions \
-command { create_expr_win ; update_ptr }
-command create_expr_window
$ { win } .menubar.window.menu add command - label " A u t o C o m m a n d " \
-command create_autocmd_window
# $ { 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 B r e a k p o i n t s \
# - c o m m a n d c r e a t e _ b r e a k p o i n t 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 \
@ -1863,13 +2038,14 @@ proc build_framework {win {title GDBtk} {label {}}} {
pack $ { win } .menubar.help - side right
frame $ { win } .info
text $ { win } .text - height 25 - width 80 - relief raised - borderwidth 2 \
text $ { win } .text - height 25 - width 80 - relief sunken - borderwidth 2 \
-setgrid true - cursor hand2 - yscrollcommand " $ { w i n } . s c r o l l s e t "
set $ { win } .label $label
label $ { win } .label - textvariable $ { win } .label - borderwidth 2 - relief raised
label $ { win } .label - textvariable $ { win } .label - borderwidth 2 - relief sunken
scrollbar $ { win } .scroll - orient vertical - command " $ { w i n } . t e x t y v i e w "
scrollbar $ { win } .scroll - orient vertical - command " $ { w i n } . t e x t y v i e w " \
-relief sunken
pack $ { win } .label - side bottom - fill x - in $ { win } .info
pack $ { win } .scroll - side right - fill y - in $ { win } .info
@ -1911,26 +2087,25 @@ proc create_source_window {} {
frame .src.row2
button .src.start - width 6 - text Start - command \
{ catch { gdb_cmd { break main} }
catch { gdb_cmd { enable delete $bpnum } }
catch { gdb_cmd run}
update_ptr }
{ interactive_cmd { break main}
interactive_cmd { enable delete $bpnum }
interactive_cmd run }
button .src.stop - width 6 - text Stop - fg red - activeforeground red \
-state disabled - command gdb_stop
button .src.step - width 6 - text Step \
-command { catch { gdb_cmd step} ; update_ptr }
-command { interactive_cmd step}
button .src.next - width 6 - text Next \
-command { catch { gdb_cmd next} ; update_ptr }
-command { interactive_cmd next}
button .src.continue - width 6 - text Cont \
-command { catch { gdb_cmd continue} ; update_ptr }
-command { interactive_cmd continue}
button .src.finish - width 6 - text Finish \
-command { catch { gdb_cmd finish} ; update_ptr }
-command { interactive_cmd finish}
button .src.up - width 6 - text Up \
-command { catch { gdb_cmd up} ; update_ptr }
-command { interactive_cmd up}
button .src.down - width 6 - text Down \
-command { catch { gdb_cmd down} ; update_ptr }
-command { interactive_cmd down}
button .src.bottom - width 6 - text Bottom \
-command { catch { gdb _cmd { frame 0 } } ; update_ptr }
-command { interactive _cmd { frame 0 } }
pack .src.start .src.step .src.continue .src.up .src.bottom \
-side left - padx 3 - pady 5 - in .src.row1
@ -1950,6 +2125,50 @@ proc create_source_window {} {
set screen_bot [ lindex $args 3 ] }
}
proc update_autocmd { } {
global .autocmd.label
global accumulate_output
catch { gdb_cmd " $ { . a u t o c m d . l a b e l } " } result
if ! $accumulate_output { .autocmd.text delete 0.0 end }
.autocmd.text insert end $result
.autocmd.text yview - pickplace end
}
proc create_autocmd_window { } {
global .autocmd.label
if [ winfo exists .autocmd] { raise .autocmd ; return }
build_framework .autocmd " A u t o C o m m a n d " " "
# 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
.autocmd.menubar.view.menu delete 0 last
# A c c u m u l a t e o u t p u t o p t i o n
.autocmd.menubar.view.menu add checkbutton \
-variable accumulate_output \
-label " A c c u m u l a t e o u t p u t " - onvalue 1 - offvalue 0
# N o w , c r e a t e e n t r y w i d g e t w i t h l a b e l
frame .autocmd.entryframe
entry .autocmd.entry - borderwidth 2 - relief sunken
bind .autocmd < Enter> { focus .autocmd.entry}
bind .autocmd.entry < Key-Return> { set .autocmd.label [ .autocmd.entry get]
.autocmd.entry delete 0 end }
label .autocmd.entrylab - text " C o m m a n d : "
pack .autocmd.entrylab - in .autocmd.entryframe - side left
pack .autocmd.entry - in .autocmd.entryframe - side left - fill x - expand yes
pack .autocmd.entryframe - side bottom - fill x - before .autocmd.info
}
proc create_command_window { } {
global command_line
@ -1978,10 +2197,13 @@ proc create_command_window {} {
global command_line
% W insert end \ n
% W yview - pickplace end
catch " g d b _ c m d [ l i s t $ c o m m a n d _ l i n e ] "
interactive_cmd $command_line
# % W y v i e w - p i c k p l a c e e n d
# c a t c h " g d b _ c m d [ l i s t $ c o m m a n d _ l i n e ] " r e s u l t
# % W i n s e r t e n d $ r e s u l t
set command_line { }
update_ptr
# u p d a t e _ p t r
% W insert end " ( g d b ) "
% W yview - pickplace end
}
@ -2682,23 +2904,16 @@ create_command_window
# C r e a t e a c o p y r i g h t w i n d o w
update
toplevel .c
wm geometry .c + 300 + 300
wm overrideredirect .c true
text .t
set temp $current_output_win
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 - relief raised
destroy .t
message .c.m - text [ gdb_cmd " s h o w v e r s i o n " ] - aspect 500 - relief raised
pack .c.m
bind .c.m < Leave> { destroy .c}
update
if [ file exists ~ / .gdbtkinit] {
source ~ / .gdbtkinit
}
update