summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/library/srcwin.ith
blob: 03e9b4ee8e40e8055291b4a72d6bb4b6dc79adbd (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
105
106
# Source window class definition for GDBtk.
# Copyright (C) 1997, 1998, 1999, 2000, 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 a source display widget using primitive widgets as the
# building blocks.
#
# The main display for SrcWin is a SrcTextWin widget.  This file
# should contain all the code for controlling the SrcTextWin.
# SrcTextWin should just display the requested file and lines, without
# having to be very intelligent.  If there are problems, error codes
# should be returned and SrcWin should figure out what to do.
# ----------------------------------------------------------------------

itcl::class SrcWin {
  inherit TopLevelWin GDBWin

  public {
    method constructor {args}
    method destructor {}
    method download_progress { section num tot {msg ""} }
    method edit {}
    method enable_ui { on }
    method fillNameCB {}
    method fillFuncCB {name}
    method goto_func {w {val ""}}
    method location {tag linespec}
    method mode {w new_mode {go 1}}
    method no_inferior {}
    method print {}
    method reconfig {}
    method reset {}
    method set_status { {msg ""} {tmp 0} }
    method set_execution_status { {line ""} {pc ""}}
    method stack {cmd}
    method test_get {var {private_func 0}}
    method toggle_updates {value}
    method toolbar {state}
    method inferior {action}
    method clear_file {}
    method get_file {}
    method is_fixed {}
    method search {direction string}

    proc choose_and_update {}
    proc choose_and_display {tag linespec}
    proc point_to_main {}

    #
    # GDB Events
    #
    method busy {event}
    method idle {event}
    method update {event}
  }

  private {
    method _build_win {}
    method _exit {}
    method _name {w {val ""}}
    method _set_name { val {found 1} }
    method _set_state {varname}
    method _update_title {name}
    method _update {loc}
    method get_top {}
    method _set_tag_to_stack {}
    proc _choose_window {file}
    variable _statbar
    variable _status
    variable _toolbar
    variable _statusframe
    variable top
    variable twin
    variable current
    variable need_files 0
    variable do_updates 1	;# if the window does updates
    variable _mangled_func
    variable Tracing  
    variable saved_msg ""	;# static

    # statics used for downloads
    variable last_section ""
    variable last_section_start 0
    variable last_done 0

    # These keep track of the current PC window and the list of all
    # source windows.
    common window_list ""
    common pc_window ""

    # fenceposts
    variable Running 0
    variable NoRun 0
  }  
}