1 # Trace dump window for Insight
2 # Copyright (C) 1998, 1999, 2001, 2002, 2004, 2008 Red Hat, Inc.
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License (GPL) as published by
6 # the Free Software Foundation; either version 2 of the License, or (at
7 # your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
15 # ----------------------------------------------------------------------
16 # Implements Tdump window for gdb
23 # reconfig ....... called when preferences change
26 # X11 OPTION DATABASE ATTRIBUTES
29 # ----------------------------------------------------------------------
31 itcl::class TdumpWin {
32 inherit ManagedWin GDBWin
34 # ------------------------------------------------------------------
35 # CONSTRUCTOR - create new tdump window
36 # ------------------------------------------------------------------
38 window_name "Trace Dump"
40 eval itk_initialize $args
44 # ------------------------------------------------------------------
45 # METHOD: build_win - build the main tdump window
46 # ------------------------------------------------------------------
48 itk_component add stext {
49 iwidgets::scrolledtext $itk_interior.stext -hscrollmode dynamic \
50 -vscrollmode dynamic -textfont global/fixed \
51 -background $::Colors(bg)
53 [$itk_component(stext) component text] configure \
54 -background $::Colors(bg)
55 pack $itk_component(stext) -side left -expand yes -fill both
60 # ------------------------------------------------------------------
61 # METHOD: update - update widget when PC changes
62 # ------------------------------------------------------------------
63 method update {event} {
64 #debug "tdump: update"
66 set tframe_num [gdb_get_trace_frame_num]
68 if { $tframe_num!=-1 } {
70 $itk_component(stext) delete 1.0 end
72 if {[catch {gdb_cmd "tdump $tframe_num" 0} tdump_output]} {
73 tk_messageBox -title "Error" -message $tdump_output -icon error \
76 #debug "tdum output is $tdump_output"
78 $itk_component(stext) insert end $tdump_output
79 $itk_component(stext) see insert
85 # ------------------------------------------------------------------
86 # METHOD: reconfig - used when preferences change
87 # ------------------------------------------------------------------
89 if {[winfo exists $itk_interior.stext]} { destroy $itk_interior.stext }