OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [gdbtcl/] [tdump.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Trace dump window for GDBtk.
2
# Copyright 1998, 1999 Cygnus Solutions
3
#
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.
8
#
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.
13
 
14
 
15
# ----------------------------------------------------------------------
16
# Implements Tdump window for gdb
17
#
18
#   PUBLIC ATTRIBUTES:
19
#
20
#
21
#   METHODS:
22
#
23
#     reconfig ....... called when preferences change
24
#
25
#
26
#   X11 OPTION DATABASE ATTRIBUTES
27
#
28
#
29
# ----------------------------------------------------------------------
30
 
31
itcl_class TdumpWin {
32
  # ------------------------------------------------------------------
33
  #  CONSTRUCTOR - create new tdump window
34
  # ------------------------------------------------------------------
35
  constructor {config} {
36
    #
37
    #  Create a window with the same name as this object
38
    #
39
    set class [$this info class]
40
    set hull [namespace tail $this]
41
    set old_name $this
42
    ::rename $this $this-tmp-
43
    ::frame $hull -class $class
44
    ::rename $hull $old_name-win-
45
    ::rename $this $old_name
46
 
47
    set top [winfo toplevel [namespace tail $this]]
48
    wm withdraw $top
49
 
50
    build_win
51
    after idle [list wm deiconify $top]
52
 
53
  }
54
 
55
 
56
  # ------------------------------------------------------------------
57
  #  METHOD:  build_win - build the main tdump window
58
  # ------------------------------------------------------------------
59
  method build_win {} {
60
 
61
     tixScrolledText [namespace tail $this].stext -scrollbar y -height 200 -width 500
62
     set twin [[namespace tail $this].stext subwidget text]
63
 
64
    # make window non editable
65
    $twin configure -insertwidth 0
66
 
67
    pack append  [namespace tail $this] [namespace tail $this].stext {left expand fill}
68
    update dummy
69
  }
70
 
71
 
72
  # ------------------------------------------------------------------
73
  #  METHOD:  update - update widget when PC changes
74
  # ------------------------------------------------------------------
75
  method update {event} {
76
    #debug "tdump: update"
77
    gdbtk_busy
78
    set tframe_num [gdb_get_trace_frame_num]
79
 
80
    if { $tframe_num!=-1 } {
81
      debug "doing tdump"
82
      $twin delete 1.0 end
83
 
84
      if {[catch {gdb_cmd "tdump $tframe_num" 0} tdump_output]} {
85
        tk_messageBox -title "Error" -message $tdump_output -icon error \
86
          -type ok
87
      } else {
88
        #debug "tdum output is $tdump_output"
89
 
90
        $twin insert end $tdump_output
91
        $twin see insert
92
      }
93
    }
94
    gdbtk_idle
95
  }
96
 
97
  # ------------------------------------------------------------------
98
  #  DESTRUCTOR - destroy window containing widget
99
  # ------------------------------------------------------------------
100
  destructor {
101
    set top [winfo toplevel [namespace tail $this]]
102
    destroy $this
103
    destroy $top
104
  }
105
 
106
  # ------------------------------------------------------------------
107
  #  METHOD:  config - used to change public attributes
108
  # ------------------------------------------------------------------
109
  method config {config} {}
110
 
111
  # ------------------------------------------------------------------
112
  #  METHOD:  reconfig - used when preferences change
113
  # ------------------------------------------------------------------
114
  method reconfig {} {
115
  }
116
 
117
  #
118
  #  PROTECTED DATA
119
  #
120
  protected maxwidth 0
121
  protected twin
122
}
123
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.