blob: a93ee6494b2d2c1b0842a4f01104e2bb5324393b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# Trace dump window for Insight
# Copyright 1998, 1999, 2001, 2002 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# ----------------------------------------------------------------------
# Implements Tdump window for gdb
#
# PUBLIC ATTRIBUTES:
#
#
# METHODS:
#
# reconfig ....... called when preferences change
#
#
# X11 OPTION DATABASE ATTRIBUTES
#
#
# ----------------------------------------------------------------------
class TdumpWin {
inherit ManagedWin GDBWin
# ------------------------------------------------------------------
# CONSTRUCTOR - create new tdump window
# ------------------------------------------------------------------
constructor {args} {
window_name "Trace Dump"
build_win
eval itk_initialize $args
}
# ------------------------------------------------------------------
# METHOD: build_win - build the main tdump window
# ------------------------------------------------------------------
method build_win {} {
global tcl_platform
if {[string compare $tcl_platform(platform) "windows"] == 0} {
set mode static
ide_sizebox $itk_interior.sbox
place $itk_interior.sbox -relx 1.0 -rely 1.0 -anchor se
} else {
set mode dynamic
}
itk_component add stext {
iwidgets::scrolledtext $itk_interior.stext -hscrollmode $mode \
-vscrollmode $mode -textfont global/fixed \
-background $::Colors(bg)
} {}
[$itk_component(stext) component text] configure \
-background $::Colors(bg)
pack $itk_component(stext) -side left -expand yes -fill both
update dummy
}
# ------------------------------------------------------------------
# METHOD: update - update widget when PC changes
# ------------------------------------------------------------------
method update {event} {
#debug "tdump: update"
gdbtk_busy
set tframe_num [gdb_get_trace_frame_num]
if { $tframe_num!=-1 } {
debug "doing tdump"
$itk_component(stext) delete 1.0 end
if {[catch {gdb_cmd "tdump $tframe_num" 0} tdump_output]} {
tk_messageBox -title "Error" -message $tdump_output -icon error \
-type ok
} else {
#debug "tdum output is $tdump_output"
$itk_component(stext) insert end $tdump_output
$itk_component(stext) see insert
}
}
gdbtk_idle
}
# ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
method reconfig {} {
if {[winfo exists $itk_interior.sbox]} { destroy $itk_interior.sbox }
if {[winfo exists $itk_interior.stext]} { destroy $itk_interior.stext }
build_win
}
}
|