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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [gdbtk/] [library/] [tfind_args.tcl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# TfindArgs
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 tfind arguments dialogs
17
#
18
#   PUBLIC ATTRIBUTES:
19
#     
20
#     Type .........Type of dialog (tfind pc, tfind line, tfind tracepoint)
21
#
22
#     config ....... used to change public attributes
23
#
24
#     PRIVATE METHODS
25
#
26
#   X11 OPTION DATABASE ATTRIBUTES
27
#
28
#
29
# ----------------------------------------------------------------------
30
 
31
itcl_class TfindArgs {
32
  # ------------------------------------------------------------------
33
  #  CONSTRUCTOR - create new tfind arguments dialog
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
    build_win
47
  }
48
 
49
  # ------------------------------------------------------------------
50
  #  METHOD:  build_win - build the dialog
51
  # ------------------------------------------------------------------
52
  method build_win {} {
53
 
54
    frame $hull.f
55
    frame $hull.f.a
56
    frame $hull.f.b
57
    set f $hull.f.a
58
 
59
    switch $Type {
60
      LN   {
61
        set text "Enter argument: "
62
      }
63
      PC   {
64
        set text "Enter PC value: "
65
      }
66
      TP   {
67
        set text "Enter Tracepoint No.: "
68
      }
69
      FR  {
70
        set text "Enter Frame No.:"
71
    }
72
 
73
    if {[string compare $Type $last_type]} != 0} {
74
      global argument
75
      set argument ""
76
    }
77
 
78
    set last_type $Type
79
 
80
    label $f.1 -text $text
81
    entry $f.2 -textvariable argument -width 10
82
    $f.2 selection range 0 end
83
    grid $f.1 $f.2 -padx 4 -pady 4 -sticky nwe
84
 
85
    button $hull.f.b.ok -text OK -command "$this ok" -width 7 -default active
86
    button $hull.f.b.quit -text Cancel -command "delete object $this" -width 7
87
    grid $hull.f.b.ok $hull.f.b.quit  -padx 4 -pady 4  -sticky ews
88
 
89
    pack $hull.f.a $hull.f.b
90
    grid $hull.f
91
 
92
    focus $f.2
93
    bind $f.2 <Return> "$this.f.b.ok flash; $this.f.b.ok invoke"
94
 
95
  }
96
 
97
  # ------------------------------------------------------------------
98
  #  DESTRUCTOR - destroy window containing widget
99
  # ------------------------------------------------------------------
100
  destructor {
101
    set top [winfo toplevel $hull]
102
    manage delete $this 1
103
    destroy $this
104
      destroy $top
105
  }
106
 
107
 
108
 
109
  # ------------------------------------------------------------------
110
  #  METHOD:  ok - do it and quit
111
  # ------------------------------------------------------------------
112
  method ok {} {
113
    do_it
114
    delete
115
  }
116
 
117
 
118
  # ------------------------------------------------------------------
119
  #  METHOD:  do_it - call the gdb command
120
  # ------------------------------------------------------------------
121
  method do_it {} {
122
    global argument
123
 
124
 
125
    switch $Type {
126
      LN  { tfind_cmd "tfind line $argument"}
127
      PC  { tfind_cmd "tfind pc $argument"}
128
      TP  { tfind_cmd "tfind tracepoint $argument"}
129
      FR  { tfind_cmd "tfind $argument"}
130
    }
131
  }
132
 
133
 
134
  public Type
135
  common last_type {}
136
  private hull
137
 
138
 
139
}

powered by: WebSVN 2.1.0

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