This is some nice text which describes the help window, its role
9 | in deugging, and perhaps some of the nifty things people can do with
10 | this window.
11 |
12 |
2 | - Reintroduce insight in the release script.
3 |
4 | --- a/src-release.sh 2014-09-01 14:30:28.755141563 +0200
5 | +++ b/src-release.sh 2014-09-01 15:18:34.535809761 +0200
6 | @@ -295,6 +295,16 @@ gdb_release()
7 | gdb_tar_compress $package $tool "$GDB_SUPPORT_DIRS" "$compressors"
8 | }
9 |
10 | +# Insight: gui interface to gdb.
11 | +INSIGHT_SUPPORT_DIRS="${GDB_SUPPORT_DIRS} tcl tk itcl itk iwidgets libgui"
12 | +insight_release()
13 | +{
14 | + compressors=$1
15 | + package=insight
16 | + tool=gdb
17 | + tar_compress $package $tool "$INSIGHT_SUPPORT_DIRS" "$compressors"
18 | +}
19 | +
20 | # Corresponding to the CVS "sim" module.
21 | SIM_SUPPORT_DIRS="bfd opcodes libiberty include intl gdb/version.in gdb/common/create-version.sh makefile.vms zlib"
22 | sim_release()
23 | @@ -326,6 +336,8 @@ build_release()
24 | gas_release "$compressors";;
25 | gdb)
26 | gdb_release "$compressors";;
27 | + insight)
28 | + insight_release "$compressors";;
29 | sim)
30 | sim_release "$compressors";;
31 | *)
32 |
--------------------------------------------------------------------------------
/gdbtk/library/help/help.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Help Window Help
4 |
5 |
6 | The Help Window
7 | Overview
8 | This is some nice text which describes the help window, its role
9 | in deugging, and perhaps some of the nifty things people can do with
10 | this window.
11 |
12 | Help Window topics:
13 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/gdbtk/library/help/session.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Sessions
4 |
5 |
6 |
7 | Sessions
8 |
9 | Insight will save your session for you automatically. The ``session''
10 | is essentially a group of settings which are keyed by the name of the
11 | inferior which you are debugging.
12 |
13 | Insight will show a list of the five most recent previous sessions on
14 | the File menu. Choosing an item from this list will cause
15 | Insight to load the indicated executable and restore all the settings
16 | saved in the session.
17 |
18 | The settings stored in a session are:
19 |
20 | - The name of the executable.
21 |
22 |
- The inferior's command-line arguments.
23 |
24 |
- The target.
25 |
26 |
- The path used when searching for source files.
27 |
28 |
- The current working directory.
29 |
30 |
- The breakpoints and watchpoints, including conditions, actions,
31 | and the like.
32 |
33 |
34 |
35 | More items may be added to this list as the need arises.
36 |
37 | At present there is no way to disable session saving.
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/gdbtk/library/cspref.ith:
--------------------------------------------------------------------------------
1 | # Color Scheme preferences dialog class definition for GDBtk.
2 | # Copyright (C) 2004, Red Hat Inc.
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 | itcl::class CSPref {
16 | inherit ManagedWin ModalDialog
17 |
18 | private {
19 | variable _saved ;# These are the saved values...
20 | variable _new ;# These are the changed values
21 | variable w
22 | method _apply {}
23 | method _build_win {}
24 | method _cancel {}
25 | method _init_var {}
26 | method _pick {color win num}
27 | method _save {}
28 | method _setcolors {}
29 | }
30 |
31 | public {
32 | method constructor {args}
33 | method reconfig {}
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/gdbtk/plugins/intel-pentium/tclIndex:
--------------------------------------------------------------------------------
1 | # Tcl autoload index file, version 2.0
2 | # This file is generated by the "auto_mkindex" command
3 | # and sourced to set up indexing information for one or
4 | # more commands. Typically each line is a command that
5 | # sets an element in the auto_index array, where the
6 | # element name is the name of a command and the value is
7 | # a script that loads the command.
8 |
9 | set auto_index(MsrSelDlg) [list source [file join $dir msrselection.ith]]
10 | set auto_index(::MsrSelDlg::constructor) [list source [file join $dir msrselection.itb]]
11 | set auto_index(::MsrSelDlg::build_win) [list source [file join $dir msrselection.itb]]
12 | set auto_index(::MsrSelDlg::doit) [list source [file join $dir msrselection.itb]]
13 | set auto_index(::MsrSelDlg::cancel) [list source [file join $dir msrselection.itb]]
14 | set auto_index(::MsrSelDlg::list_msrs) [list source [file join $dir msrselection.itb]]
15 | set auto_index(::MsrSelDlg::select_msr) [list source [file join $dir msrselection.itb]]
16 | set auto_index(::MsrSelDlg::clear_msr_selection) [list source [file join $dir msrselection.itb]]
17 | set auto_index(display_cpu_info) [list source [file join $dir cpuinfo.tcl]]
18 |
--------------------------------------------------------------------------------
/gdbtk/library/process.ith:
--------------------------------------------------------------------------------
1 | # Process window class definition for Insight.
2 | # Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
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 | itcl::class ProcessWin {
16 | inherit EmbeddedWin GDBWin
17 |
18 | private {
19 | variable id
20 | variable Running 0
21 | variable protect_me 0
22 |
23 |
24 | method build_win {}
25 | method change_context {}
26 | method cursor {glyph}
27 | }
28 |
29 | public {
30 | method reconfig {}
31 | method constructor {args}
32 | method destructor {}
33 |
34 | #
35 | # GDB Events
36 | #
37 | method busy {event}
38 | method idle {event}
39 | method update {event}
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/libgui/library/center.tcl:
--------------------------------------------------------------------------------
1 | # center.tcl - Center a window on the screen or over another window
2 | # Copyright (C) 1997, 1998, 2001 Red Hat, Inc.
3 | # Written by Tom Tromey .
4 |
5 | # Call this after the TOPLEVEL has been filled in, but before it has
6 | # been mapped. This proc will center the toplevel on the screen or
7 | # over another window.
8 | proc center_window {top args} {
9 | parse_args {{over ""}}
10 |
11 | update idletasks
12 | if {$over != ""} {
13 | set cx [expr {int ([winfo rootx $over] + [winfo width $over] / 2)}]
14 | set cy [expr {int ([winfo rooty $over] + [winfo height $over] / 2)}]
15 | set x [expr {$cx - int ([winfo reqwidth $top] / 2)}]
16 | set y [expr {$cy - int ([winfo reqheight $top] / 2)}]
17 | } else {
18 | set x [expr {int (([winfo screenwidth $top] - [winfo reqwidth $top]) / 2)}]
19 | set y [expr {int (([winfo screenheight $top] - [winfo reqheight $top]) / 2)}]
20 | }
21 | wm geometry $top +${x}+${y}
22 | wm positionfrom $top user
23 |
24 | # We run this update here because Tk updates toplevel geometry
25 | # (position) info in an idle handler on Windows, but doesn't force
26 | # the handler to run before mapping the window.
27 | update idletasks
28 | }
29 |
--------------------------------------------------------------------------------
/gdbtk/generic/gdbtk-main.c:
--------------------------------------------------------------------------------
1 | /* Main function for gdb with insight.
2 |
3 | Copyright (C) 2002, 2014 Free Software Foundation, Inc.
4 |
5 | This file is part of GDB.
6 |
7 | This program is free software; you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation; either version 2 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program; if not, write to the Free Software
19 | Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 | Boston, MA 02110-1301, USA. */
21 |
22 |
23 | #include "defs.h"
24 | #include "main.h"
25 | #include
26 |
27 | int
28 | main (int argc, char **argv)
29 | {
30 | struct captured_main_args args;
31 | memset (&args, 0, sizeof args);
32 | args.argc = argc;
33 | args.argv = argv;
34 | args.interpreter_p = "insight";
35 | return gdb_main (&args);
36 | }
37 |
--------------------------------------------------------------------------------
/gdbtk/plugins/intel-pentium/msrselection.ith:
--------------------------------------------------------------------------------
1 | # Implements MSR selection dialog class for Insight.
2 | # Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
3 | #
4 | # Written by Fernando Nasser
5 | #
6 | # This program is free software; you can redistribute it and/or modify it
7 | # under the terms of the GNU General Public License (GPL) as published by
8 | # the Free Software Foundation; either version 2 of the License, or (at
9 | # your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 |
16 | class MsrSelDlg {
17 | inherit ModalDialog PluginWindow
18 |
19 | public {
20 | method constructor {args}
21 | proc last_button {} {return $last_button}
22 | proc msr {} {return $last_msr}
23 | }
24 |
25 | protected {
26 | method build_win {args}
27 | method cancel {}
28 | method doit {}
29 | method list_msrs {{expr {}}}
30 | method select_msr {}
31 | method clear_msr_selection {}
32 |
33 | variable msr_list
34 |
35 | common last_button 0
36 | common last_msr {}
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/gdbtk/library/srcpref.ith:
--------------------------------------------------------------------------------
1 | # Source preferences dialog class definition for GDBtk.
2 | # Copyright (C) 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 | itcl::class SrcPref {
16 | inherit ManagedWin ModalDialog
17 |
18 | private {
19 | variable _saved ;# These are the saved values...
20 | variable _new ;# These are the changed values
21 | variable _saved_disassembly_flavor
22 | variable _new_disassembly_flavor ""
23 |
24 | method _apply {}
25 | method _build_win {}
26 | method _cancel {}
27 | method _init_var {}
28 | method _pick {color win tag}
29 | method _save {}
30 | method _set_flavor {w new_mode}
31 | method cancel {}
32 | }
33 |
34 | public {
35 | method constructor {args}
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/gdbtk/plugins/intel-pentium/cpuinfo.tcl:
--------------------------------------------------------------------------------
1 | # Display CPU information.
2 | # Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
3 | #
4 | # Written by Fernando Nasser
5 | #
6 | # This program is free software; you can redistribute it and/or modify it
7 | # under the terms of the GNU General Public License (GPL) as published by
8 | # the Free Software Foundation; either version 2 of the License, or (at
9 | # your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 |
16 | # ------------------------------------------------------------------
17 | # NAME: proc display_cpu_info
18 | # DESCRIPTION: display what we know about the target CPU
19 | # if the information is available.
20 | #
21 | # ARGUMENTS: None
22 | # RETURNS: Nothing
23 | #
24 | # NOTES:
25 | # ------------------------------------------------------------------
26 | proc display_cpu_info {} {
27 | global gdb_cpuid_info
28 | if {[catch {gdb_cmd "info cpu"} result]} {
29 | tk_messageBox -message "CPU information not available"
30 | } else {
31 | tk_messageBox -message "$result"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/libgui/library/menu.tcl:
--------------------------------------------------------------------------------
1 | # menu.tcl - Useful proc for dealing with menus.
2 | # Copyright (C) 1997 Cygnus Solutions.
3 | # Written by Tom Tromey .
4 |
5 | # This proc computes the "desired width" of a menu. It can be used to
6 | # determine the minimum width for a toplevel whose -menu option is
7 | # set.
8 | proc compute_menu_width {menu} {
9 | set width 0
10 | set last [$menu index end]
11 | if {$last != "end"} then {
12 | # Start at borderwidth, but also preserve borderwidth on the
13 | # right.
14 | incr width [expr {2 * [$menu cget -borderwidth]}]
15 |
16 | set deffont [$menu cget -font]
17 | set abw [expr {2 * [$menu cget -activeborderwidth]}]
18 | for {set i 0} {$i <= $last} {incr i} {
19 | if {[catch {$menu entrycget $i -font} font]} then {
20 | continue
21 | }
22 | if {$font == ""} then {
23 | set font $deffont
24 | }
25 | incr width [font measure $font [$menu entrycget $i -label]]
26 | incr width $abw
27 | # "10" was chosen by reading tkUnixMenu.c.
28 | incr width 10
29 | # This is arbitrary. Apparently I can't read tkUnixMenu.c well
30 | # enough to understand why the naive calculation above doesn't
31 | # work.
32 | incr width 2
33 | }
34 | # Another hack.
35 | incr width 2
36 | }
37 |
38 | return $width
39 | }
40 |
--------------------------------------------------------------------------------
/gdbtk/library/help/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Insight Index
5 |
6 |
7 |
8 |
9 |
10 |
24 |
25 | For Developers Only
26 |
29 |
30 |
31 | Insight Home Page
32 |
33 | GNU General Public License
34 |
35 |
36 |
--------------------------------------------------------------------------------
/gdbtk/library/ehandler.itb:
--------------------------------------------------------------------------------
1 | # GDBEventHandler class implementation for Insight.
2 | # Copyright (C) 2001 Red Hat, Inc.
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 | # PUBLIC PROC: dispatch - Dispatch the given event to all
16 | # event handlers. The name of the handler
17 | # method to call is stored in the event's
18 | # "handler" method.
19 | # ------------------------------------------------------------
20 | itcl::body GDBEventHandler::dispatch {event} {
21 |
22 | set handler [$event handler]
23 |
24 | # invoke event handlers
25 | foreach w [itcl::find objects -isa GDBEventHandler] {
26 | dbug I "posting event \"$handler\" to \"$w\""
27 | if {[catch {$w $handler $event}]} {
28 | dbug E "On $handler event, $w errored:\n$::errorInfo"
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/gdbtk/library/stackwin.ith:
--------------------------------------------------------------------------------
1 | # Stack window class definition for GDBtk.
2 | # Copyright (C) 1997-2012 Red Hat, Inc.
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 stack window for gdb
17 | # ----------------------------------------------------------------------
18 |
19 | itcl::class StackWin {
20 | inherit EmbeddedWin GDBWin
21 |
22 | private {
23 | variable Running 0
24 | variable protect_me 0
25 | method build_win {}
26 | method cursor {glyph}
27 | method change_frame {}
28 | method no_inferior {}
29 | }
30 |
31 | public {
32 | method reconfig {}
33 | method constructor {args}
34 | method destructor {}
35 |
36 | #
37 | # GDB Events
38 | #
39 | method busy {event}
40 | method idle {event}
41 | method update {event}
42 | }
43 |
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/browser.exp:
--------------------------------------------------------------------------------
1 | # Copyright 1998, 1999, 2001, 2004 Red Hat, Inc.
2 | #
3 | # This program is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU General Public License (GPL) as published by
5 | # the Free Software Foundation; either version 2 of the License, or (at
6 | # your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | load_lib ../gdb.gdbtk/insight-support.exp
14 |
15 | if {[gdbtk_initialize_display]} {
16 | if {$tracelevel} {
17 | strace $tracelevel
18 | }
19 |
20 | #
21 | # test browser window
22 | #
23 |
24 | set testfile "stack"
25 | set binfile ${objdir}/${subdir}/${testfile}
26 | set r [gdb_compile "${srcdir}/${subdir}/stack1.c ${srcdir}/${subdir}/stack2.c" "${binfile}" executable {debug}]
27 | if { $r != "" } {
28 | gdb_suppress_entire_file \
29 | "Testcase compile failed, so some tests in this file will automatically fail."
30 | }
31 |
32 | # Start with a fresh gdbtk
33 | gdb_exit
34 | set results [gdbtk_start [file join $srcdir $subdir browser.test]]
35 | set results [split $results \n]
36 |
37 | # Analyze results
38 | gdbtk_done $results
39 | }
40 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/windows.exp:
--------------------------------------------------------------------------------
1 | # Copyright 2001, 2004 Red Hat, Inc.
2 | #
3 | # This program is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU General Public License (GPL) as published by
5 | # the Free Software Foundation; either version 2 of the License, or (at
6 | # your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | load_lib ../gdb.gdbtk/insight-support.exp
14 |
15 | if {[gdbtk_initialize_display]} {
16 | if {$tracelevel} {
17 | strace $tracelevel
18 | }
19 |
20 | #
21 | # Basic window tests (basic as in, "do they open")
22 | #
23 |
24 | set srcfile [file join $srcdir $subdir c_variable.c]
25 | set binfile [file join $objdir $subdir c_variable]
26 | set r [gdb_compile $srcfile $binfile executable {debug}]
27 | if { $r != "" } {
28 | gdb_suppress_entire_file \
29 | "Testcase compile failed, so some tests in this file will automatically fail."
30 | }
31 |
32 | # Start with a fresh gdbtk
33 | gdb_exit
34 | set results [gdbtk_start [file join $srcdir $subdir windows.test]]
35 | set results [split $results \n]
36 |
37 | # Analyze results
38 | gdbtk_done $results
39 | }
40 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/console.exp:
--------------------------------------------------------------------------------
1 | # Copyright 1998, 1999, 2001, 2004 Red Hat, Inc.
2 | #
3 | # This program is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU General Public License (GPL) as published by
5 | # the Free Software Foundation; either version 2 of the License, or (at
6 | # your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | load_lib ../gdb.gdbtk/insight-support.exp
14 |
15 | if {[gdbtk_initialize_display]} {
16 | if {$tracelevel} {
17 | strace $tracelevel
18 | }
19 |
20 | #
21 | # test console window
22 | #
23 |
24 | set testfile "simple"
25 | set srcfile ${testfile}.c
26 | set binfile ${objdir}/${subdir}/${testfile}
27 | set r [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
28 | if { $r != "" } {
29 | gdb_suppress_entire_file \
30 | "Testcase compile failed, so some tests in this file will automatically fail."
31 | }
32 |
33 | # Start with a fresh gdbtk
34 | gdb_exit
35 | set results [gdbtk_start [file join $srcdir $subdir console.test]]
36 | set results [split $results \n]
37 |
38 | # Analyze results
39 | gdbtk_done $results
40 | }
41 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/c_variable.exp:
--------------------------------------------------------------------------------
1 | # Copyright 1999, 2001, 2004 Red Hat, Inc.
2 | #
3 | # This program is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU General Public License (GPL) as published by
5 | # the Free Software Foundation; either version 2 of the License, or (at
6 | # your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | load_lib ../gdb.gdbtk/insight-support.exp
14 |
15 | if {[gdbtk_initialize_display]} {
16 | if {$tracelevel} {
17 | strace $tracelevel
18 | }
19 |
20 | #
21 | # test variable API
22 | #
23 |
24 | set testfile "c_variable"
25 | set srcfile ${testfile}.c
26 | set binfile ${objdir}/${subdir}/${testfile}
27 | set r [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
28 | if { $r != "" } {
29 | gdb_suppress_entire_file \
30 | "Testcase compile failed, so some tests in this file will automatically fail."
31 | }
32 |
33 | # Start with a fresh gdbtk
34 | gdb_exit
35 | set results [gdbtk_start [file join $srcdir $subdir ${testfile}.test]]
36 | set results [split $results \n]
37 |
38 | # Analyze results
39 | gdbtk_done $results
40 | }
41 |
--------------------------------------------------------------------------------
/gdbtk/library/download.ith:
--------------------------------------------------------------------------------
1 | # Download class definition for Insight
2 | # Copyright (C) 1999, 2001 Red Hat, Inc.
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 | itcl::class Download {
16 | inherit ManagedWin
17 |
18 | protected {
19 | common total_bytes
20 | common section
21 | common bytes
22 | common num_sections
23 | common num_steps 100
24 |
25 | # completed steps in feedback meter (iwidget::feedback is lame)
26 | common completed_steps
27 |
28 | method _ignore_on_save {} { return 1 }
29 | proc dont_remember_size {} { return 1}
30 | }
31 | public {
32 | variable filename
33 |
34 | method constructor {args}
35 | method destructor {}
36 | method update_download { sec num tot }
37 | method done { {msg ""} }
38 | method cancel {}
39 |
40 | proc download_it { }
41 | proc do_download_hooks {}
42 | proc download_hash { section num }
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/gdbtk/library/ehandler.ith:
--------------------------------------------------------------------------------
1 | # GDBEventHandler class definition for Insight.
2 | # Copyright (C) 2001-2015 Red Hat, Inc.
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 | itcl::class GDBEventHandler {
15 |
16 | constructor {args} {}
17 | destructor {}
18 |
19 | # Dispatching proc. ALL events should be funneled through this
20 | # procedure.
21 | public proc dispatch {event}
22 |
23 | #
24 | # Events
25 | #
26 |
27 | # See gdbevent.ith for descriptions of event
28 | public {
29 | # Breakpoint/tracepoint events
30 | method breakpoint {event} {}
31 | method tracepoint {event} {}
32 |
33 | # Set variable
34 | method set_variable {event} {}
35 |
36 | # Busy event
37 | method busy {event} {}
38 |
39 | # Idle event
40 | method idle {event} {}
41 |
42 | # Update event
43 | method update {event} {}
44 |
45 | # Architecture changed event
46 | method arch_changed {event} {}
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/libgui/library/postghost.tcl:
--------------------------------------------------------------------------------
1 | # postghost.tcl - Ghost a menu item at post time.
2 | # Copyright (C) 1997 Cygnus Solutions.
3 | # Written by Tom Tromey .
4 |
5 |
6 | # Helper proc.
7 | proc GHOST_helper {menu index predicate} {
8 | if {[eval $predicate]} then {
9 | set state normal
10 | } else {
11 | set state disabled
12 | }
13 | $menu entryconfigure $index -state $state
14 | }
15 |
16 | # Add a -postcommand to a menu. This is careful not to stomp other
17 | # postcommands.
18 | proc add_post_command {menu callback} {
19 | set old [$menu cget -postcommand]
20 | # We use a "\n" and not a ";" to separate so that people can put
21 | # comments into their -postcommands without fear.
22 | $menu configure -postcommand "$old\n$callback"
23 | }
24 |
25 | # Run this to make a menu item which ghosts or unghosts depending on a
26 | # predicate that is run at menu-post time. The NO_CACHE option
27 | # prevents the index from being looked up statically; this is useful
28 | # if you want to use an entry name as the index and you have a very
29 | # dynamic menu (ie one where the numeric index of a named item is not
30 | # constant over time). If PREDICATE returns 0 at post time, then the
31 | # item will be ghosted.
32 | proc ghosting_menu_item {menu index predicate {no_cache 0}} {
33 | if {! $no_cache} then {
34 | set index [$menu index $index]
35 | }
36 |
37 | add_post_command $menu [list GHOST_helper $menu $index $predicate]
38 | }
39 |
--------------------------------------------------------------------------------
/gdbtk/plugins/intel-pentium/ChangeLog:
--------------------------------------------------------------------------------
1 | 2005-12-23 Eli Zaretskii
2 |
3 | * msrselection.ith:
4 | * msrselection.itb:
5 | * cpuinfo.tcl: Put (C) after Copyright.
6 |
7 | 2002-08-14 Keith Seitz
8 |
9 | Merged from Red Hat internal branch:
10 |
11 | 2001-11-30 Keith Seitz
12 | * Makefile.in: New file.
13 | * intel-pentium.tcl: Renamed to intel-pentium.tcl.in.
14 | * plugins.tcl: This plugin is only available on non-native targets.
15 | Append to ../plugins.tcl and remove.
16 |
17 | 2001-11-28 Ian Roxborough
18 | * cpuinfo.tcl (display_cpu_info): exec the gdb command
19 | "info cpu" to get the extra cpuinformation (CPU ID).
20 | * library/plugins/intel-pentium/msrselection.itb
21 | (MsrSelDlg::build_win): Switch the OK and Cancel buttons
22 | around to improve ease of use.
23 | * plugins.tcl: Use "$::GDBStartup" rather than "$GDBStartup".
24 | Create a sub menu in the plugins menu called "Intel Pentium"
25 | and place the menu items in it.
26 |
27 | 2001-11-21 Ian Roxborough
28 | * msrselection.itb (MsrSelDlg::list_msrs): Use
29 | "set msr-pointer" instead of "set msr".
30 | (MsrSelDlg::doit): Set the msr-pointer before calling
31 | unpost. Display an error message is we can't set the
32 | msr-pointer.
33 |
34 | 2001-11-16 Ian Roxborough
35 | * cpuinfo.tcl: New file.
36 | * intel-pentium.tcl: Ditto.
37 | * cpuinfo.tcl: Ditto.
38 | * msrselection.itb: Ditto.
39 | * msrselection.ith: Ditto.
40 | * pkgIndex.tcl: Ditto.
41 | * plugins.tcl: Ditto.
42 | * tclIndex: Ditto.
43 |
44 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/cpp_variable.exp:
--------------------------------------------------------------------------------
1 | # Copyright 1999, 2001, 2004 Red Hat, Inc.
2 | #
3 | # This program is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU General Public License (GPL) as published by
5 | # the Free Software Foundation; either version 2 of the License, or (at
6 | # your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | load_lib ../gdb.gdbtk/insight-support.exp
14 |
15 | if {[gdbtk_initialize_display]} {
16 | if {$tracelevel} {
17 | strace $tracelevel
18 | }
19 |
20 | set results {}
21 | if {[skip_cplus_tests]} {
22 | # Target doesn't have c++ support
23 | verbose "No C++ support -- skipping test"
24 | } else {
25 | #
26 | # test variable API
27 | #
28 |
29 | set testfile "cpp_variable"
30 | set srcfile ${testfile}.cc
31 | set binfile ${objdir}/${subdir}/${testfile}
32 | set r [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}]
33 | if { $r != "" } {
34 | gdb_suppress_entire_file \
35 | "Testcase compile failed, so some tests in this file will automatically fail."
36 | }
37 |
38 | # Start with a fresh gdbtk
39 | gdb_exit
40 | set results [gdbtk_start [file join $srcdir $subdir ${testfile}.test]]
41 | set results [split $results \n]
42 | }
43 |
44 | # Analyze results
45 | gdbtk_done $results
46 | }
47 |
--------------------------------------------------------------------------------
/gdbtk/library/tty.tcl:
--------------------------------------------------------------------------------
1 | # tty.tcl - xterm as tty for the inferior
2 | # Copyright (C) 1996, 2000 Red Hat, Inc
3 | # Written by Tom Tromey
4 | #
5 | # Interface to the inferior's terminal. This is very rough, and is
6 | # guaranteed to only work on Unix machines (if even there).
7 | #
8 |
9 | namespace eval tty {
10 | namespace export create
11 |
12 | variable _xterm_fd {}
13 |
14 | proc create {} {
15 | variable _xterm_fd
16 |
17 | destroy
18 |
19 | # Tricky: we exec /bin/cat so that the xterm will exit whenever we
20 | # close the write end of the pipe. Note that the stdin
21 | # redirection must come after tty is run; tty looks at its stdin.
22 | set shcmd {/bin/sh -c 'exec 1>&7; tty; exec /bin/cat 0<&6'}
23 |
24 | set fg [option get . foreground Foreground]
25 | if {$fg == ""} then {
26 | set fg black
27 | }
28 |
29 | set bg [. cget -background]
30 | if {$bg == ""} then {
31 | set bg [lindex [. configure -background] 3]
32 | }
33 |
34 | set xterm [list /bin/sh -c "exec xterm -T 'Gdb Child' -n Gdb -bg '$bg' -fg '$fg' -e $shcmd 6<&0 7>&1"]
35 |
36 | # Need both read and write access to xterm process.
37 | set _xterm_fd [open "| $xterm" w+]
38 | set tty [gets $_xterm_fd]
39 |
40 | # On failure we don't try the tty command.
41 | if {$tty != ""} {
42 | gdb_cmd "tty $tty"
43 | }
44 | }
45 |
46 | proc destroy {} {
47 | variable _xterm_fd
48 |
49 | if {$_xterm_fd != ""} then {
50 | # We don't care if this fails.
51 | catch {close $_xterm_fd}
52 | }
53 | set _xterm_fd {}
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/gdbtk/library/about.tcl:
--------------------------------------------------------------------------------
1 | # About window for GDBtk.
2 | # Copyright (C) 1997-2015 Red Hat, Inc.
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 About window
17 | # ----------------------------------------------------------------------
18 |
19 | itcl::class About {
20 | inherit ManagedWin ModalDialog
21 | constructor {args} {
22 | global gdb_ImageDir
23 | set f [frame $itk_interior.f]
24 | label $f.image1 -bg #000000 -image \
25 | [image create photo -file [file join $gdb_ImageDir insight.gif]]
26 | message $f.m -bg #000000 -fg white -text [gdb_cmd {show version}] \
27 | -aspect 500 -relief flat
28 | pack $f.image1 $f.m $itk_interior.f -fill both -expand yes
29 | pack $itk_interior
30 | bind $f.image1 <1> [code $this unpost]
31 | bind $f.m <1> [code $this unpost]
32 | window_name "About Insight"
33 | }
34 |
35 | # Don't quit if this is the last window. The only way that this can
36 | # happen is if we are the splash screen.
37 |
38 | method quit_if_last {} {
39 | return 0
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/gdbtk/library/globalpref.ith:
--------------------------------------------------------------------------------
1 | # Global preference class definition for GDBtk.
2 | # Copyright (C) 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 | itcl::class GlobalPref {
16 | inherit ManagedWin ModalDialog
17 |
18 | private {
19 | variable _new
20 | variable _saved
21 | variable _icondirlist ""
22 | variable _original ;# Original font settings
23 | variable _size ;# Array tracking spinint values
24 | variable _fonts ;# List of all available fonts for editing
25 | common tracing_labels
26 | common inited 0
27 |
28 | method _init {}
29 | method _init_var {}
30 | method _build_win {}
31 | method _make_font_item {f name label font_list}
32 | method _resize_font_item_height {}
33 | method _change_icons {w args}
34 | method _change_font {font stupid implementation}
35 | method _change_size {direction font}
36 | method _ok {}
37 | method _apply {{deleteMe 0}}
38 | method _cancel {}
39 | method cancel {}
40 | method _toggle_tracing {win}
41 | }
42 |
43 | public {
44 | method constructor {args}
45 | method destructor {}
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/gdbtk/library/editor.tcl:
--------------------------------------------------------------------------------
1 | # Editor
2 | # Copyright (C) 2001 Red Hat, Inc.
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 | # Implements a set of editor commands
16 | # ----------------------------------------------------------------------
17 |
18 | namespace eval Editor {
19 | namespace export edit
20 |
21 | proc edit {loc_info} {
22 | global external_editor_command
23 |
24 | if {[info exists external_editor_command]} {
25 | if {[catch {uplevel \#0 "$external_editor_command edit $loc_info"} \
26 | err]} {
27 | tk_dialog .warn-sn "Edit" $err error 0 Ok
28 | }
29 | return
30 | }
31 |
32 | lassign $loc_info baseName fnName fileName lineNum addr pc
33 |
34 | set newCmd [pref get gdb/editor]
35 | if {! [string compare $newCmd ""]} {
36 | tk_dialog .warn "Edit" "No editor command specified" error 0 Ok
37 | }
38 |
39 | # Replace %s with file name and %d with line number.
40 | regsub -all -- %s $newCmd $fileName newCmd
41 | regsub -all -- %d $newCmd $lineNum newCmd
42 |
43 | if {[catch "exec $newCmd &" err]} {
44 | tk_dialog .warn "Edit" $err error 0 Ok
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/libgui/library/parse_args.tcl:
--------------------------------------------------------------------------------
1 | # parse_args.tcl -- procedure for pulling in arguments
2 |
3 | # parse_args takes in a set of arguments with defaults and examines
4 | # the 'args' in the calling procedure to see what the arguments should
5 | # be set to. Sets variables in the calling frame to the right values.
6 |
7 | proc parse_args { argset } {
8 | upvar args args
9 |
10 | foreach argument $argset {
11 | if {[llength $argument] == 1} {
12 | # No default specified, so we assume that we should set
13 | # the value to 1 if the arg is present and 0 if it's not.
14 | # It is assumed that no value is given with the argument.
15 | set result [lsearch -exact $args "-$argument"]
16 | if {$result != -1} then {
17 | uplevel 1 [list set $argument 1]
18 | set args [lreplace $args $result $result]
19 | } else {
20 | uplevel 1 [list set $argument 0]
21 | }
22 | } elseif {[llength $argument] == 2} {
23 | # There are two items in the argument. The second is a
24 | # default value to use if the item is not present.
25 | # Otherwise, the variable is set to whatever is provided
26 | # after the item in the args.
27 | set arg [lindex $argument 0]
28 | set result [lsearch -exact $args "-[lindex $arg 0]"]
29 | if {$result != -1} then {
30 | uplevel 1 [list set $arg [lindex $args [expr $result+1]]]
31 | set args [lreplace $args $result [expr $result+1]]
32 | } else {
33 | uplevel 1 [list set $arg [lindex $argument 1]]
34 | }
35 | } else {
36 | error "Badly formatted argument \"$argument\" in argument set"
37 | }
38 | }
39 |
40 | # The remaining args should be checked to see that they match the
41 | # number of items expected to be passed into the procedure...
42 | }
43 |
--------------------------------------------------------------------------------
/libgui/library/wingrab.tcl:
--------------------------------------------------------------------------------
1 | # wingrab.tcl -- grab support for Windows.
2 | # Copyright (C) 1997 Cygnus Solutions.
3 | # Written by Ian Lance Taylor .
4 |
5 | # Disable a list of windows.
6 |
7 | proc WINGRAB_disable { args } {
8 | foreach w $args {
9 | ide_grab_support_disable [wm frame $w]
10 | }
11 | }
12 |
13 | # Disable all top level windows, other than the argument, which are
14 | # children of `.'. Note that if you do this, and then destroy the
15 | # frame of the only enabled window, your application will lose the
16 | # input focus to some other application. Make sure that you reenable
17 | # the windows before calling wm transient or wm withdraw or destroy on
18 | # the only enabled window.
19 |
20 | proc WINGRAB_disable_except { window } {
21 | foreach w [winfo children .] {
22 | if {$w != $window} then {
23 | ide_grab_support_disable [wm frame [winfo toplevel $w]]
24 | }
25 | }
26 | }
27 |
28 | # Enable a list of windows.
29 |
30 | proc WINGRAB_enable { args } {
31 | foreach w $args {
32 | ide_grab_support_enable [wm frame $w]
33 | }
34 | }
35 |
36 | # Enable all top level windows which are children of `.'.
37 |
38 | proc WINGRAB_enable_all {} {
39 | foreach w [winfo children .] {
40 | ide_grab_support_enable [wm frame [winfo toplevel $w]]
41 | }
42 | }
43 |
44 | # The basic routine. All commands are subcommands of this.
45 |
46 | proc ide_grab_support {dispatch args} {
47 | global tcl_platform
48 |
49 | if {[info commands WINGRAB_$dispatch] == ""} then {
50 | error "unrecognized key \"$dispatch\""
51 | }
52 |
53 | # We only need to do stuff on Windows.
54 | if {$tcl_platform(platform) != "windows"} then {
55 | return
56 | }
57 |
58 | eval WINGRAB_$dispatch $args
59 | }
60 |
--------------------------------------------------------------------------------
/gdbtk/library/blockframe.ith:
--------------------------------------------------------------------------------
1 | # Class definitions for blocks and frames for GDBtk.
2 | # Copyright (C) 1997, 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 | itcl::class Block {
15 |
16 | public {
17 | method constructor {start end args}
18 | method destructor {}
19 | method variables {}
20 | method update {}
21 | method info {}
22 | }
23 |
24 | private {
25 | # Start and end address for this block
26 | variable _start
27 | variable _end
28 |
29 | # List of variables (new) variables defined in this block
30 | variable _variables
31 |
32 | method _findVariables {}
33 | }
34 | }
35 |
36 | itcl::class Frame {
37 |
38 | public {
39 | method constructor {addr}
40 | method destructor {}
41 | method variables {}
42 | method update {}
43 | method new {}
44 | method old {}
45 | method deleteOld {}
46 | method address {} { return $_addr }
47 | }
48 |
49 | private {
50 | method _createBlocks {blocks}
51 | method _addBlock {block}
52 | method _findBlock {block}
53 | method _findBlockIndex {block}
54 | method _removeBlock {blockObj}
55 | method _oldBlocks {}
56 |
57 | # Our address
58 | variable _addr
59 |
60 | # A list of all blocks
61 | variable _blocks
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/gdbtk/plugins/rhabout/rhabout.c:
--------------------------------------------------------------------------------
1 | /* Sample command procedure library for a plug-in. */
2 |
3 | /* You have to include the Tcl headers, of course. */
4 | #include
5 |
6 | /* Define the functions that implement your commands as required by Tcl */
7 | #if defined(__WIN32__) || defined(_WIN64)
8 | # define EXPORT __declspec(dllexport)
9 | #else
10 | # define EXPORT /* nothing */
11 | #endif
12 |
13 | int extra_text (ClientData clientData,
14 | Tcl_Interp *interp,
15 | int objc, Tcl_Obj *CONST objv[]);
16 |
17 | /* Here you actually do whatever you want, like calling your target
18 | libraries etc. Here we just return a string. */
19 |
20 | int
21 | extra_text (ClientData clientData,
22 | Tcl_Interp *interp,
23 | int objc, Tcl_Obj *CONST objv[])
24 | {
25 | Tcl_SetObjResult (interp,
26 | Tcl_NewStringObj ("\nThis is a sample plug-in\n", -1));
27 | return TCL_OK;
28 | }
29 |
30 | /* Initialization function required in Tcl libraries. */
31 |
32 | int EXPORT
33 | Rhabout_Init (Tcl_Interp *interp)
34 | {
35 | /* Register your command as a Tcl command with this interpreter. */
36 | Tcl_CreateObjCommand (interp, "rhabout_extra_text", extra_text,
37 | (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
38 |
39 | /* Register this package */
40 | Tcl_PkgProvide (interp, "RHABOUT", "1.0");
41 | return TCL_OK;
42 | }
43 |
44 | /* This is REQUIRED for native windows implementations. */
45 | #ifdef TCL_PLATFORM_WIN
46 | #include
47 | #include
48 |
49 | struct _reent *_impure_ptr;
50 | extern struct _reent *_imp__reent_data;
51 |
52 | BOOL APIENTRY
53 | DllMain (HINSTANCE hInstance, DWORD reason, LPVOID reserved)
54 | {
55 | _impure_ptr = _imp__reent_data;
56 | return TRUE;
57 | }
58 | #endif
59 |
--------------------------------------------------------------------------------
/gdbtk/library/kod.ith:
--------------------------------------------------------------------------------
1 | # Kernel Object Display Window definition for Insight.
2 | # Copyright (C) 1999, 2001 Red Hat, Inc.
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 | itcl::class KodWin {
15 | inherit EmbeddedWin GDBWin
16 |
17 | private {
18 | variable bf
19 | variable lf
20 | variable titl
21 | variable BTop
22 | variable BUp
23 | variable BClear
24 | variable BDisplay
25 | variable lb
26 | variable t1
27 | variable t2
28 | variable pl1
29 | variable pl2
30 | variable pane1command ""
31 | variable pane2command ""
32 | variable BPane1
33 | variable BPane2
34 | variable level 0
35 | common LevelCmd
36 | variable BState
37 | variable Running 0
38 | method build_win {}
39 | method display {}
40 | method display_list {}
41 | method display_object {{cmd ""} {obj ""}}
42 | method clear {}
43 | method top {}
44 | method up {}
45 | method cursor {glyph}
46 | method _disable_buttons {}
47 | method _restore_buttons {}
48 | }
49 |
50 | public {
51 | method constructor {args}
52 | method destructor {}
53 | method reconfig {}
54 |
55 | #
56 | # Gdb Events
57 | #
58 | method set_variable {event}
59 | method busy {event}
60 | method idle {event}
61 | method update {event}
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/libgui/library/list.tcl:
--------------------------------------------------------------------------------
1 | # list.tcl - Some handy list procs.
2 | # Copyright (C) 1997 Cygnus Solutions.
3 | # Written by Tom Tromey .
4 | # FIXME: some are from TclX; we should probably just use the C
5 | # implementation that is in S-N.
6 |
7 | proc lvarpush {listVar element {index 0}} {
8 | upvar $listVar var
9 | if {![info exists var]} then {
10 | lappend var $element
11 | } else {
12 | set var [linsert $var $index $element]
13 | }
14 | }
15 |
16 | proc lvarpop {listVar {index 0}} {
17 | upvar $listVar var
18 | set result [lindex $var $index]
19 | # NOTE lreplace can fail if list is empty.
20 | if {! [catch {lreplace $var $index $index} new]} then {
21 | set var $new
22 | }
23 | return $result
24 | }
25 |
26 | # Remove duplicates and sort list. ARGS are arguments to lsort, eg
27 | # --increasing.
28 | proc lrmdups {list args} {
29 | set slist [eval lsort $args [list $list]]
30 | set last [lvarpop slist]
31 | set result [list $last]
32 | foreach item $slist {
33 | if {$item != $last} then {
34 | set last $item
35 | lappend result $item
36 | }
37 | }
38 | return $result
39 | }
40 |
41 | proc lremove {list element} {
42 | set index [lsearch -exact $list $element]
43 | if {$index == -1} then {
44 | return $list
45 | }
46 | return [lreplace $list $index $index]
47 | }
48 |
49 | # replace element with new element
50 | proc lrep {list element new} {
51 | set index [lsearch -exact $list $element]
52 | if {$index == -1} {
53 | return $list
54 | }
55 | return [lreplace $list $index $index $new]
56 | }
57 |
58 | # FIXME: this isn't precisely like the C lvarcat. It is slower.
59 | proc lvarcat {listVar args} {
60 | upvar $listVar var
61 | if {[join $args] != ""} then {
62 | # Yuck!
63 | eval eval lappend var $args
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/libgui/src/tclshellexe.c:
--------------------------------------------------------------------------------
1 | /* tclshellexe.c - Interface to Windows ShellExecute function.
2 | Copyright (C) 1997 Cygnus Solutions.
3 | Written by Tom Tromey ;
4 | Code mostly taken from S-N. */
5 |
6 | #ifdef _WIN32
7 |
8 | #include
9 |
10 | #include
11 |
12 | #include
13 | #include
14 |
15 | #include "guitcl.h"
16 |
17 | static int
18 | shell_execute_command (ClientData clientData, Tcl_Interp *interp,
19 | int argc, CONST84 char *argv[])
20 | {
21 | CONST84 char *operation;
22 | CONST84 char *file;
23 | CONST84 char *param;
24 | CONST84 char *dir;
25 | int ret;
26 |
27 | if (argc < 3 || argc > 5)
28 | {
29 | Tcl_AppendResult(interp, "wrong # args: should be \"",
30 | argv[0], " operation file ?parameters? ?directory?\"", NULL);
31 |
32 | return TCL_ERROR;
33 | }
34 | operation = argv[1]; /* Mandatory */
35 | if (!*operation)
36 | operation = NULL;
37 |
38 | file = argv[2]; /* Mandatory */
39 |
40 | if (argc > 3)
41 | {
42 | param = argv[3];
43 | if (!*param)
44 | param = NULL;
45 | }
46 | else
47 | param = NULL;
48 |
49 | if (argc > 4)
50 | {
51 | dir = argv[4];
52 | if (!*dir)
53 | dir = NULL;
54 | }
55 | else
56 | dir = NULL;
57 |
58 | ret = (int)(ssize_t)ShellExecuteA(NULL, operation, file, param, dir, SW_SHOWNORMAL);
59 | if (ret <= 32)
60 | {
61 | Tcl_AppendResult(interp, strerror(ret), NULL);
62 | return TCL_ERROR;
63 | }
64 | return TCL_OK;
65 | }
66 |
67 | int
68 | ide_create_shell_execute_command (Tcl_Interp *interp)
69 | {
70 | if (Tcl_CreateCommand (interp, "ide_shell_execute", shell_execute_command,
71 | NULL, NULL) == NULL)
72 | return TCL_ERROR;
73 | return TCL_OK;
74 | }
75 |
76 | #endif /* _WIN32 */
77 |
--------------------------------------------------------------------------------
/gdbtk/library/bpwin.ith:
--------------------------------------------------------------------------------
1 | # Breakpoint window class definition for Insight
2 | # Copyright (C) 1997, 1998, 1999, 2001 Red Hat, Inc.
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 | itcl::class BpWin {
16 | inherit EmbeddedWin GDBWin
17 |
18 | public {
19 | variable tracepoints 0
20 |
21 | method constructor {args}
22 | method destructor {}
23 | method bp_select {r}
24 | method bp_able { i }
25 | method bp_remove { i }
26 | method bp_restore {}
27 | method bp_store {}
28 | method bp_type { i }
29 | method bp_all { command }
30 | method get_actions {bpnum}
31 | method toggle_threads {}
32 | method reconfig {}
33 | method goto_bp {r}
34 |
35 | # GDB Events
36 | method breakpoint {event}
37 | method tracepoint {event}
38 | }
39 |
40 | private {
41 | variable twin
42 | variable next_row 0
43 | variable index_to_bpnum
44 | variable Index_to_bptype
45 | variable temp
46 | variable mbar 1
47 | variable selected 0
48 | variable bg1
49 | variable Menu
50 | variable show_threads ;#cached copy of [pref get gdb/bp/show_threads]
51 |
52 | method build_win {}
53 | method bp_add {bp_event {tracepoint 0}}
54 | method bp_modify {bp_event {tracepoint 0}}
55 | method bp_delete {bp_event}
56 | method _select_and_popup {bp X Y}
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/gdbtk/library/help/thread.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Thread Window Help
4 |
5 |
6 |
7 |
8 | The Thread Window
9 |
10 |
11 |
12 |
The Thread Window displays a list of threads and/or processes. The exact
13 | contents are OS-specific.
14 |
15 |
20 |
21 |
22 | The Thread Display consists of a listbox which displays information on
23 | threads and/or processes that are part of the executable being debugged.
24 | The first column is the GDB thread number, which is used internally by GDB
25 | to track the thread. The rest of the columns are OS-dependent. The output is identical
26 | to the output of the console command "info threads".
27 |
28 |
29 |
30 | The source window can only display the current location and source for one thread
31 | at a time. That thread is called the "current thread".
32 | To change the current thread, simply click the left mouse button on the desired
33 | line and the
34 | debugger will switch contexts, updating all windows. The current thread will
35 | be highlighted.
36 |
37 |
38 |
39 | Normally if you set a breakpoint on a line or function, every thread that hits
40 | that location will stop execution and return to the debugger. To set a breakpoint
41 | or a specific thread or threads, you need to use the source window. See
42 | Set Breakpoint on Threads
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/libgui/src/tkTableCmd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * tkTableCmd.h --
3 | *
4 | * This is the header file for the module that implements
5 | * command structure lookups.
6 | *
7 | * Copyright (c) 1997-2016 Jeffrey Hobbs
8 | *
9 | * See the file "license.terms" for information on usage and redistribution
10 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11 | *
12 | */
13 |
14 | #ifndef _CMD_H_
15 | #define _CMD_H_
16 |
17 | #include
18 | #include
19 | #include
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | /* structure for use in parsing table commands/values */
26 | typedef struct {
27 | char *name; /* name of the command/value */
28 | int value; /* >0 because 0 represents an error */
29 | } Cmd_Struct;
30 |
31 | extern char * Cmd_GetName _ANSI_ARGS_((const Cmd_Struct *cmds, int val));
32 | extern int Cmd_GetValue _ANSI_ARGS_((const Cmd_Struct *cmds,
33 | const char *arg));
34 | extern void Cmd_GetError _ANSI_ARGS_((Tcl_Interp *interp,
35 | const Cmd_Struct *cmds,
36 | const char *arg));
37 | extern int Cmd_Parse _ANSI_ARGS_((Tcl_Interp *interp, Cmd_Struct *cmds,
38 | const char *arg));
39 | extern int Cmd_OptionSet _ANSI_ARGS_((ClientData clientData,
40 | Tcl_Interp *interp,
41 | Tk_Window unused, char *value,
42 | char *widgRec, int offset));
43 | extern char * Cmd_OptionGet _ANSI_ARGS_((ClientData clientData,
44 | Tk_Window unused, char *widgRec,
45 | int offset,
46 | Tcl_FreeProc **freeProcPtr));
47 | extern int Cmd_BitSet _ANSI_ARGS_((ClientData clientData,
48 | Tcl_Interp *interp,
49 | Tk_Window unused, char *value,
50 | char *widgRec, int offset));
51 | extern char * Cmd_BitGet _ANSI_ARGS_((ClientData clientData,
52 | Tk_Window unused, char *widgRec,
53 | int offset,
54 | Tcl_FreeProc **freeProcPtr));
55 |
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 |
60 | #endif /* _CMD_H_ */
61 |
--------------------------------------------------------------------------------
/libgui/library/internet.tcl:
--------------------------------------------------------------------------------
1 | #
2 | # internet.tcl - tcl interface to various internet functions
3 | #
4 | # Copyright (C) 1998 Cygnus Solutions
5 | #
6 |
7 | # ------------------------------------------------------------------
8 | # send_mail - send email
9 | # ------------------------------------------------------------------
10 |
11 | proc send_mail {to subject body} {
12 | global tcl_platform
13 |
14 | switch -- $tcl_platform(platform) {
15 | windows {
16 | ide_mapi simple-send $to $subject $body
17 | }
18 | unix {
19 | exec echo $body | mail -s $subject $to &
20 | }
21 | default {
22 | error "platform \"$tcl_platform(platform)\" not supported"
23 | }
24 | }
25 | }
26 |
27 | # ------------------------------------------------------------------
28 | # open_url - open a URL in a browser
29 | # Netscape must be available for Unix.
30 | # ------------------------------------------------------------------
31 |
32 | proc open_url {url} {
33 | global tcl_platform
34 | switch -- $tcl_platform(platform) {
35 | windows {
36 | ide_shell_execute open $url
37 | # FIXME. can we detect errors?
38 | }
39 | unix {
40 | if {[catch "exec netscape -remote [list openURL($url,new-window)]" result]} {
41 | if {[string match {*not running on display*} $result]} {
42 | # Netscape is not running. Try to start it.
43 | if {[catch "exec netscape [list $url] &" result]} {
44 | tk_dialog .warn "Netscape Error" "$result" error 0 Ok
45 | return 0
46 | }
47 | } elseif {[string match {couldn't execute *} $result]} {
48 | tk_dialog .warn "Netscape Error" "Cannot locate \"netscape\" on your system.\nIt must be installed and in your path." error 0 Ok
49 | return 0
50 | } else {
51 | tk_dialog .warn "Netscape Error" "$result" error 0 Ok
52 | return 0
53 | }
54 | }
55 | }
56 | default {
57 | error "platform \"$tcl_platform(platform)\" not supported"
58 | return 0
59 | }
60 | }
61 | return 1
62 | }
63 |
64 |
65 |
--------------------------------------------------------------------------------
/gdbtk/library/toplevelwin.ith:
--------------------------------------------------------------------------------
1 | # TopLevelWin class definition for GDBtk.
2 | # Copyright (C) 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 | itcl::class TopLevelWin {
16 | inherit ManagedWin
17 |
18 | private variable frame ""
19 |
20 | constructor {args} {
21 | debug $itk_interior
22 |
23 | # create a container frame
24 | conFrame $itk_interior.container
25 | pack $itk_interior.container -fill both -expand 1
26 |
27 | # set up bindings for group iconification/deiconification
28 | # NOT IMPLEMENTED YET
29 | #set top [winfo toplevel [namespace tail $this]]
30 | #bind_for_toplevel_only $top {
31 | # manage_iconify iconify
32 | #}
33 | #bind_for_toplevel_only $top
19 |
20 |
21 | The Console Display is simply a scrolled window in which the debugger prompt
22 | appears. By default, the prompt is set to "(gdb) ", but it may be changed via a
23 | command line option.
24 |
25 | To execute commands in the console window, simply enter
26 | the command in the display. If the debugger is busy, the message "Error: The
27 | debugger is busy." appears informing the user that the command was not accepted.
28 |
29 | Whenever a command is executed, the debugger's windows will update to display
30 | any new state information. Any output from the command is also echoed to the Console
31 | Window for ease of use. If an error occurs, an error message is printed to the Console
32 | Window. All error messages appear in the Console Window using a red colored typeface.
33 |
34 |
35 | The Console Window responds to special character commands just as a shell window
36 | does: it has a history mechanism which allows the user to scan previously used commands
37 | by pressing the up and down arrow keys on the keyboard, jumping to the beginning or
38 | end of a line by entering Ctrl-A or Ctrl-E, erasing a line by pressing Ctrl-K, and
39 | more. Users familiar with GNU Emacs will recognize these keys as commonly used
40 | keystrokes from that editor.
41 |
42 |
43 | The Console Window has its own online help system. To access the help system, enter
44 | "help" at the prompt and follow the on-screen instructions. For more help, please
45 | consult the GDB User's Guide.
46 |
47 |
48 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/srcwin.exp:
--------------------------------------------------------------------------------
1 | # Copyright 1999, 2001 Red Hat, Inc.
2 | #
3 | # This program is free software; you can redistribute it and/or modify it
4 | # under the terms of the GNU General Public License (GPL) as published by
5 | # the Free Software Foundation; either version 2 of the License, or (at
6 | # your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 |
13 | load_lib ../gdb.gdbtk/insight-support.exp
14 |
15 | if {[gdbtk_initialize_display]} {
16 | if {$tracelevel} {
17 | strace $tracelevel
18 | }
19 |
20 | #
21 | # test source window
22 | #
23 |
24 | set testfile "list"
25 | set s1 "$srcdir/$subdir/list0.c"
26 | set sources "$s1 $srcdir/$subdir/list1.c"
27 | set binfile $objdir/$subdir/$testfile
28 | if {[file exists $s1.save]} {
29 | catch {file delete $s1}
30 | file rename $s1.save $s1
31 | }
32 | set r [gdb_compile $sources "$binfile" executable debug]
33 | if { $r != "" } {
34 | gdb_suppress_entire_file \
35 | "Testcase compile failed, so some tests in this file will automatically fail."
36 | }
37 |
38 | # Start with a fresh gdbtk
39 | gdb_exit
40 | set results [gdbtk_start [file join $srcdir $subdir srcwin.test]]
41 | set results [split $results \n]
42 | set all_results $results
43 |
44 | # move file with "main" out of the way
45 | file rename $s1 $s1.save
46 |
47 | # run slightly different set of tests
48 | gdb_exit
49 | set results [gdbtk_start [file join $srcdir $subdir srcwin2.test]]
50 | set results [split $results \n]
51 | set all_results [concat $all_results $results]
52 |
53 | # restore file
54 | file rename $s1.save $s1
55 |
56 | set r [gdb_compile $sources "$binfile" executable ""]
57 | if { $r != "" } {
58 | gdb_suppress_entire_file \
59 | "Testcase compile failed, so some tests in this file will automatically fail."
60 | }
61 | # run slightly different set of tests
62 | gdb_exit
63 | set results [gdbtk_start [file join $srcdir $subdir srcwin3.test]]
64 | set results [split $results \n]
65 | set all_results [concat $all_results $results]
66 |
67 | # Analyze results
68 | gdbtk_done $all_results
69 | }
70 |
--------------------------------------------------------------------------------
/gdbtk/library/help/locals.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Local Variables Help
4 |
5 |
6 | The Local Variables Window
7 | Overview
8 | The Local Variables Window displays all local variables in scope. It may be used to
9 | visualize and edit local variables. To open the Local Variables window, click on
10 | small house icon on the toolbar, or select "Local Variables" under the View
11 | pulldown menu.
12 |
13 | Locals Display
14 |
15 | Pointers, structures, and classes appear in the display with small expansion
16 | box before their names. To dereference pointers or
17 | view the members of classes or structures, click
18 | the closed expansion box (which appears as a small plus sign, "+") to "expand"
19 | the listing. The expansion box changes to a minus sign, "-", indicating that the
20 | display is now open. Pointers, structures and classes may be expanded recursively
21 | to allow multiple pointer dereferences and embedded structure viewing.
22 |
23 | The Locals Display updates after every execution of the program and highlights
24 | in green those variables whose values have changed.
25 |
26 | The Locals Window will, by default, display all pointers in hexadecimal and all
27 | other variables in decimal. To change the display format for a variable, select
28 | the Format option from the popup-menu.
29 |
30 | Editing a Variable
31 | To edit a variable, either double-click the left mouse button on the value of the variable in
32 | the display or select the Edit option from the pop-up menu. To abort editing a variable's value,
33 | simply press the escape key on the keyboard. The variable's original value is restored.
34 |
35 | Local Variable Pop-up Menu
36 | The pop-up menu provides quick access to the functions of the Local Variables Window.
37 | To use the pop-up menu, click the right mouse button while over a variable.
38 |
39 | - Format
- Change the display format of the variable.
40 | - Edit
- Edit the variable's value.
41 | - Delete
- Remove the variable from the display.
42 | - Dump Memory
- Open a Memory Window with the variable's value as an aaddress.
43 | - Help
- Open this help page.
44 | - Close
- Close the Local Variables Window.
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/gdbtk/library/help/register.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Register Window Help
4 |
5 |
6 | The Register Window
7 | The Register Window lists registers and their contents for
8 | the selected stack frame. It permits viewing the contents of registers
9 | in different formats, editing register values, and some display
10 | customizations.
11 |
12 |
13 |
14 | In the image above, you can see all the registers on the left and their values on the right.
15 | At the top is an option menu to allow you to choose what group of registers to display.
16 | The groups names are preset according to the architecture being debugged. The default is "all".
17 | Registers highlighted in green have recently changed.
18 |
19 | The Register Window will update the register contents in the display
20 | to match the stack frame currently being viewed in the
21 | Source Window and Stack Window.
22 | Each time the program stops, the register window will automatically update.
23 | Registers that have changed since the last stop will be displayed in green.
24 |
25 |
26 |
27 | The Register Pop-up Menu
28 |
29 |
30 | To activate the pop-up menu, click the right mouse button over a register.
31 | This will allow you change the way the register is displayed, or to remove
32 | it from the display. Or you can add the register to the watch window.
33 | For integer registers, you can also open a memory window at the
34 | location pointed to by the register.
35 |
36 | Editing a Register
37 |
38 | To edit a register, simply click on it with the left mouse button. Type
39 | in the new value and hit enter. You can enter a decimal, hex, or float number and
40 | the type will be converted if possible. You may also enter an expression to be evaluated.
41 | For example, to set $r3 to the same as $r4, edit $r3 and enter "$r4" as the value. In the same
42 | way, you can set $pc to "main".
43 | The value of the register is set to the current value of the expression; it will not be reevaluated
44 | if the expression's value later changes.
45 |
46 | Press the escape key on the keyboard to cancel your edit.
47 |
48 |
49 |
--------------------------------------------------------------------------------
/gdbtk/library/help/stack.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Stack Window Help
4 |
5 |
6 |
7 |
8 | The Stack Window
9 |
10 |
11 |
12 |
The Stack Window allows users to view the call stack and jump between
13 | levels of the stack.
14 |
15 |
20 |
21 |
22 | The Stack Display consists of a listbox which displays levels of the call stack
23 | on per line. Each line contains the level number (useful when using the
24 | Console Window) and a description of the function executing
25 | in that level. Typically, the function name and either the address of the function
26 | or the file and line number where the function is defined are displayed. The
27 | Stack Window may also be used to jump between levels of the stack.
28 |
29 |
30 |
31 | Navigation of the Stack Window is accomplished by clicking on the desired level
32 | with the left mouse button. The Source Window
33 | Display updates to show the selected frame. All other secondary windows,
34 | Registers, Watch, and
35 | Locals update their displays for the selected frame.
36 |
37 |
38 |
39 | To switch frames, simply click the left mouse button on the desired frame and the
40 | debugger will switch contexts, updating all windows. The selected frame is highlighted
41 | (in gold, by default).
42 |
43 | As an alternative, changing stack levels may be accomplished via the
44 | Frame Control Buttons on the Source Window's
45 | Toolbar. These buttons may be used to change frames one level at a time (either
46 | immediately up or immediately down) or to jump to the bottom-most stack frame.
47 | See Source Frame Control Buttons for more
48 | information.
49 |
50 |
51 |
--------------------------------------------------------------------------------
/libgui/library/looknfeel.tcl:
--------------------------------------------------------------------------------
1 | # looknfeel.tcl - Standard look and feel decisions.
2 | # Copyright (C) 1997-2012 Red Hat, Inc.
3 | # Written by Tom Tromey .
4 |
5 | # Run this once just after Tk is initialized. It will do whatever
6 | # setup is required to make the application conform to our look and
7 | # feel.
8 | proc standard_look_and_feel {} {
9 | global tcl_platform
10 |
11 | # FIXME: this is really gross: we know how tk_dialog chooses its
12 | # -wraplength, and we make it bigger. Instead we should make our
13 | # own dialog function.
14 | option add *Dialog.msg.wrapLength 0 startupFile
15 |
16 | # We don't ever want tearoffs.
17 | option add *Menu.tearOff 0 startupFile
18 |
19 | # The default font should be used by default.
20 | # The bold font is like the default font, but is bold; use it for
21 | # emphasis.
22 | # The fixed font is guaranteed not to be proportional.
23 | # The status font should be used in status bars and tooltips.
24 | if {$tcl_platform(platform) == "windows"} then {
25 | define_font global/default -family "Tahoma" -size 10
26 | # FIXME: this isn't actually a bold font...
27 | define_font global/bold -family windows-caption
28 | define_font global/fixed -family "Lucida Console" -size 9
29 | define_font global/status -family "Tahoma" -size 10
30 | # FIXME: we'd like this font to update automatically as well. But
31 | # for now we can't.
32 | array set actual [font actual windows-message]
33 | set actual(-slant) italic
34 | eval define_font global/italic [array get actual]
35 |
36 | # The menu font used to be set via the "windows-menu"
37 | # font family, however this seems to have been deprecated
38 | # for Tcl/Tk version 8.3, so we hard code it instead.
39 | define_font global/menu -family {MS Sans Serif} -size 8
40 | } else {
41 | set size 12
42 | define_font global/default -family courier -size $size
43 | define_font global/bold -family courier -size $size -weight bold
44 | define_font global/fixed -family courier -size $size
45 | define_font global/status -family helvetica -size [expr $size - 1]
46 | define_font global/italic -family courier -size $size -slant italic
47 | define_font global/menu -family helvetica -size $size
48 | }
49 |
50 | # Make sure this font is actually used by default.
51 | option add *Font global/default
52 | option add *Menu.Font global/menu
53 | }
54 |
--------------------------------------------------------------------------------
/gdbtk/library/browserwin.ith:
--------------------------------------------------------------------------------
1 | # Browser window class definition for Insight.
2 | # Copyright (C) 1998, 1999, 2003 Red Hat, Inc.
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 | itcl::class BrowserWin {
15 | inherit EmbeddedWin
16 |
17 | public {
18 | method constructor {args}
19 | method destructor {}
20 | method mode {w {mode ""} {go 1}}
21 | method search {}
22 | method test_get {var}
23 | method do_all_bp {onp}
24 |
25 | }
26 |
27 | private {
28 | method _build_win {}
29 | method _file_hide_h {}
30 | method _fill_file_box {}
31 | method _fill_funcs_combo {name}
32 | method _fill_source {f {funcp 1} {filename ""}}
33 | method _filter_trace_proc {v1 v2 mode}
34 | method _filter_trace_after {}
35 | method _goto_func {w {val ""}}
36 | method _process_file_selection {y}
37 | method _process_func_selection {y}
38 | method _search_src {direction}
39 | method _select {highlight}
40 | method _set_filter_mode {w mode}
41 | method _toggle_bp {y}
42 | method _build_filter_frame {parent}
43 | method _build_file_frame {parent}
44 | method _build_function_frame {parent}
45 | method _build_view_frame {parent}
46 | method _switch_layout
47 |
48 | variable cur_filter_mode
49 | variable Current;
50 | variable labelUpdateCode ""
51 | variable index_to_file
52 | variable _mangled_func
53 | variable filter_trace_after ""
54 | variable _layout
55 |
56 | common componentToRow
57 | array set componentToRow {
58 | filter 0
59 | browser 1
60 | view 2
61 | view_hidden 3
62 | }
63 |
64 | common filter_modes [list "starts with" \
65 | "contains" \
66 | "ends with" \
67 | "matches regexp"]
68 | common filter_regexp
69 | array set filter_regexp {
70 | "starts with" ^%s
71 | "contains" %s
72 | "ends with" %s$
73 | "matches regexp" %s
74 | }
75 | }
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/gdbtk/library/memwin.ith:
--------------------------------------------------------------------------------
1 | # Memory display window class definition for Insight.
2 | # Copyright (C) 1998, 1999, 2001, 2002 Red Hat, Inc.
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 | itcl::class MemWin {
16 | inherit EmbeddedWin GDBWin
17 |
18 | private {
19 | variable saved_addr ""
20 | variable bad_expr 0
21 | variable current_addr ""
22 | variable dont_size 0
23 | variable mbar 1
24 | variable bg
25 | variable top
26 | variable nb 128
27 | variable prefs_win ""
28 | variable Running 0
29 | variable Numrows 0
30 | variable Numcols 0
31 | variable saved_value
32 | variable maxlen
33 | variable maxalen
34 | variable rheight ""
35 | variable new_entry 0
36 |
37 | method build_win {}
38 | method init_addr_exp {}
39 | method cursor {glyph}
40 | method _update_address {make_busy}
41 | }
42 |
43 | public {
44 | variable addr_exp ""
45 | variable size 4
46 | variable format x
47 | variable bytes_per_row 16
48 | variable numbytes 0
49 | variable ascii 1
50 | variable ascii_char "."
51 | variable color green
52 | }
53 |
54 | protected common type
55 |
56 | public {
57 | method constructor {args}
58 | method destructor {}
59 | method paste {x y}
60 | method validate {val}
61 | method create_prefs {}
62 | method changed_cell {from to}
63 | method edit {cell}
64 | method toggle_enabled {}
65 | method newsize {height}
66 | method update_address_cb {}
67 | method update_address {addr_exp}
68 | method BadExpr {errTxt}
69 | method incr_addr {num}
70 | method update_addr
71 | method hidemb {}
72 | method reconfig {}
73 | method do_popup {x y}
74 | method goto {addr}
75 | method memMoveCell {w x y}
76 | method error_dialog {msg {modality task} {type ok}}
77 |
78 | #
79 | # GDB Events
80 | #
81 | method busy {event}
82 | method idle {event}
83 | method update {event}
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/gdbtk/generic/gdbtk-cmds.h:
--------------------------------------------------------------------------------
1 | /* Tcl/Tk command interface for Insight
2 | Copyright (C) 2001 Free Software Foundation, Inc.
3 |
4 | This file is part of GDB.
5 |
6 | This program is free software; you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation; either version 2 of the License, or
9 | (at your option) any later version.
10 |
11 | This program is distributed in the hope that it will be useful,
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | GNU General Public License for more details.
15 |
16 | You should have received a copy of the GNU General Public License
17 | along with this program; if not, write to the Free Software
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 | Boston, MA 02110-1301, USA. */
20 |
21 | #if !defined(GDBTK_CMDS_H)
22 | #define GDBTK_CMDS_H 1
23 |
24 | /* This structure filled in gdbtk_call_wrapper and passed to
25 | the wrapped call function.
26 | It stores the command pointer and arguments
27 | run in the wrapper function. */
28 | struct wrapped_call_args
29 | {
30 | Tcl_Interp *interp;
31 | Tcl_ObjCmdProc *func;
32 | int objc;
33 | Tcl_Obj *CONST * objv;
34 | int val;
35 | };
36 |
37 | /* A generic call-wrapper to catch longjmps when calling C commands from
38 | tcl. ALL tcl commands should be wrapped in this call. */
39 | extern int gdbtk_call_wrapper (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
40 |
41 | /* Returns the source (demangled) name for a function at PC. Returns empty string
42 | if not found. Memory is owned by gdb. Do not free it. */
43 | extern const char *pc_function_name (CORE_ADDR pc);
44 |
45 | /* Convenience function to sprintf something(s) into a new element in
46 | a Tcl list object. */
47 | extern void sprintf_append_element_to_obj (Tcl_Obj * objp, char *format, ...);
48 |
49 | /* printf-like function to return error messages */
50 | extern void gdbtk_set_result (Tcl_Interp *interp, const char *fmt,...);
51 |
52 | /* Module init routines: Each module of commands should be declared here. */
53 | extern int Gdbtk_Breakpoint_Init (Tcl_Interp *interp);
54 | extern int Gdbtk_Stack_Init (Tcl_Interp *interp);
55 | extern int Gdbtk_Register_Init (Tcl_Interp *interp);
56 |
57 | /* replacement for removed gdb function */
58 | const char *symtab_to_filename (struct symtab *s);
59 |
60 | #endif /* GDBTK_CMDS_H */
61 |
--------------------------------------------------------------------------------
/gdbtk/library/help/trace/stack.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Stack Window Help
4 |
5 |
6 | The Stack Window
7 | Overview
8 | The Stack Window allows users to view the call stack and jump between
9 | levels of the stack. To use the Stack Window in tracepoint mode, the
10 | stack pointer must be collected. See
11 | Adding an Action in the Tracepoint
12 | Dialog for more information on collecting registers.
13 |
14 | Stack Window topics:
15 |
21 |
22 |
23 | The Stack Display consists of a listbox which displays levels of the call stack
24 | one per line. Each line contains the level number (useful when using the Console Window) and a description of the function executing
26 | in that level. Typically, the function name and either the address of the function
27 | or the file and line number where the function is defined are displayed. The
28 | Stack Window may also be used to jump between levels of the stack.
29 |
30 |
31 |
32 | Navigation of the Stack Window is accomplished by clicking on the desired level
33 | with the left mouse button. The Source Window
34 | Display updates to show the selected frame. All other secondary windows,
35 | Registers, Watch, and
36 | Locals update their displays for the selected frame.
37 |
38 |
39 |
40 | To switch frames, simply click the left mouse button on the desired frame and the
41 | debugger will switch contexts, updating all windows. The selected frame is highlighted
42 | (in gold, by default).
43 |
44 | As an alternative, changing stack levels may be accomplished via the
45 | Frame Control Buttons on the Source Window's
46 | Toolbar. These buttons may be used to change frames one level at a time (either
47 | immediately up or immediately down) or to jump to the bottom-most stack frame.
48 | See Source Frame Control Buttons for more
49 | information.
50 |
51 |
52 |
--------------------------------------------------------------------------------
/gdbtk/library/console.ith:
--------------------------------------------------------------------------------
1 | # Console window class definition for GDBtk.
2 | # Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
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 a console display widget using primitive widgets as the building
17 | # blocks.
18 | # ----------------------------------------------------------------------
19 |
20 | itcl::class Console {
21 | inherit EmbeddedWin GDBEventHandler
22 |
23 | public {
24 | #Approximate maximum number of lines allowed in widget
25 | variable throttle 2000
26 |
27 | method constructor {args}
28 | method destructor {}
29 | method insert {line {tag ""}}
30 | method invoke {{controld 0}}
31 | method _insertion {args}
32 | method activate {{prompt {}}}
33 | method test {args}
34 | method gets {}
35 |
36 | #
37 | # GDB Events
38 | #
39 | method busy {event}
40 | method idle {event}
41 | }
42 |
43 | private {
44 | variable _twin
45 | variable _invoking 0
46 | variable _needNL 1
47 | variable _history {}
48 | variable _histElement -1
49 | variable _partialCommand ""
50 | variable _saved_insertion ""
51 | variable _running 0
52 | variable _saw_tab 0
53 | variable _pendingHistElement -1
54 | variable _input_mode 0
55 | variable _input_result ""
56 | variable _input_error 0
57 |
58 | method _build_win {}
59 | method _cancel {}
60 | method _complete {}
61 | method _delete {{left 0}}
62 | method _find_completion {cmd completions}
63 | method _find_lcp {slist}
64 | method _first {}
65 | method _last {}
66 | method _next {}
67 | method _operate_and_get_next {}
68 | method _paste {{check_primary 1}}
69 | method _previous {}
70 | method _reset_tab {}
71 | method _search_history {}
72 | method _rsearch_history {}
73 | method _setprompt {{prompt {}}}
74 | method _set_wrap {wrap}
75 | method _update_option {name value}
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/libgui/acinclude.m4:
--------------------------------------------------------------------------------
1 | sinclude(../config/tcl.m4)
2 |
3 | dnl Find the location of the private Tcl headers
4 | dnl This is TCL_INCLUDE_SPEC/tcl-private/generic or TCL_SRC_DIR/generic.
5 | dnl As a side effect, determine the TCL platform.
6 | dnl
7 | dnl Note: you must use first use SC_LOAD_TCLCONFIG!
8 | AC_DEFUN([CY_AC_TCL_PRIVATE_HEADERS], [
9 | AC_MSG_CHECKING([for Tcl private headers])
10 | private_dir=""
11 | for dir in "${TCL_INCLUDE_SPEC}/tcl-private" "${TCL_SRC_DIR}"; do
12 | dir=`echo "${dir}/generic" | sed -e s/-I//`
13 | if test -f "${dir}/tclInt.h"; then
14 | private_dir="${dir}"
15 | break
16 | fi
17 | done
18 |
19 | if test x"${private_dir}" = x; then
20 | AC_ERROR(could not find private Tcl headers)
21 | else
22 | TCL_PRIVATE_INCLUDE="-I${private_dir}"
23 | AC_MSG_RESULT(${private_dir})
24 | TCL_PLATFORM=unknown
25 | dir="`dirname \"${private_dir}\"`"
26 | for platform in Unix Win MacOSX; do
27 | # FIXME: actually, MacOSX is not detected. How to do it ?
28 | pf="`echo \"${platform}\" | tr 'A-Z' 'a-z'`"
29 | if test -f "${dir}/generic/tcl${platform}Port.h"; then
30 | TCL_PLATFORM="${pf}"
31 | break
32 | elif test -f "${dir}/${pf}/tcl${platform}Port.h"; then
33 | TCL_PLATFORM="${pf}"
34 | TCL_PRIVATE_INCLUDE="${TCL_PRIVATE_INCLUDE} -I${dir}/${pf}"
35 | break
36 | fi
37 | done
38 | fi
39 | ])
40 |
41 | dnl Find the location of the private Tk headers
42 | dnl This is TK_INCLUDE_SPEC/tk-private/generic or TK_SRC_DIR/generic.
43 | dnl
44 | dnl Note: you must first use SC_LOAD_TKCONFIG
45 | AC_DEFUN([CY_AC_TK_PRIVATE_HEADERS], [
46 | AC_MSG_CHECKING([for Tk private headers])
47 | private_dir=""
48 | for dir in "${TK_INCLUDE_SPEC}/tk-private" "${TK_SRC_DIR}"; do
49 | dir=`echo "${dir}/generic" | sed -e s/-I//`
50 | if test -f "${dir}/tkInt.h"; then
51 | private_dir="${dir}"
52 | break
53 | fi
54 | done
55 |
56 | if test x"${private_dir}" = x; then
57 | AC_ERROR(could not find Tk private headers)
58 | else
59 | TK_PRIVATE_INCLUDE="-I${private_dir}"
60 | AC_MSG_RESULT(${private_dir})
61 | TK_PLATFORM=unknown
62 | dir="`dirname \"${private_dir}\"`"
63 | for platform in Unix Win MacOSX; do
64 | pf="`echo \"${platform}\" | tr 'A-Z' 'a-z'`"
65 | if test -f "${dir}/generic/tk${platform}Port.h"; then
66 | TK_PLATFORM="${pf}"
67 | break
68 | elif test -f "${dir}/${pf}/tk${platform}Port.h"; then
69 | TK_PLATFORM="${pf}"
70 | TK_PRIVATE_INCLUDE="${TK_PRIVATE_INCLUDE} -I${dir}/${pf}"
71 | break
72 | fi
73 | done
74 | fi
75 | ])
76 |
--------------------------------------------------------------------------------
/testsuite/gdb.gdbtk/stack2.c:
--------------------------------------------------------------------------------
1 | /* Functions defined in this file */
2 | void extern_func1_1 (int, char *, unsigned long);
3 | void extern_func1_2 (int, char *, unsigned long);
4 | void extern_func1_3 (int, char *, unsigned long);
5 | void extern_func1_4 (int, char *, unsigned long);
6 | void extern_func1_5 (int, char *, unsigned long);
7 | void extern_func1_6 (int, char *, unsigned long);
8 | void extern_func1_7 (int, char *, unsigned long);
9 | void extern_func1_8 (int, char *, unsigned long);
10 | void extern_func1_9 (int, char *, unsigned long);
11 | void extern_func1_10 (int, char *, unsigned long);
12 | void extern_func1_11 (int, char *, unsigned long);
13 | void extern_func1_12 (int, char *, unsigned long);
14 | void extern_func1_13 (int, char *, unsigned long);
15 | void extern_func1_14 (int, char *, unsigned long);
16 | void extern_func1_15 (int, char *, unsigned long);
17 |
18 | void
19 | extern_func1_1 (int a, char *b, unsigned long c)
20 | {
21 | extern_func1_2 (a, b, c);
22 | }
23 |
24 | void
25 | extern_func1_2 (int a, char *b, unsigned long c)
26 | {
27 | extern_func1_3 (a, b, c);
28 | }
29 |
30 | void
31 | extern_func1_3 (int a, char *b, unsigned long c)
32 | {
33 | extern_func1_4 (a, b, c);
34 | }
35 |
36 | void
37 | extern_func1_4 (int a, char *b, unsigned long c)
38 | {
39 | extern_func1_5 (a, b, c);
40 | }
41 |
42 | void
43 | extern_func1_5 (int a, char *b, unsigned long c)
44 | {
45 | extern_func1_6 (a, b, c);
46 | }
47 |
48 | void
49 | extern_func1_6 (int a, char *b, unsigned long c)
50 | {
51 | extern_func1_7 (a, b, c);
52 | }
53 |
54 | void
55 | extern_func1_7 (int a, char *b, unsigned long c)
56 | {
57 | extern_func1_8 (a, b, c);
58 | }
59 |
60 | void
61 | extern_func1_8 (int a, char *b, unsigned long c)
62 | {
63 | extern_func1_9 (a, b, c);
64 | }
65 |
66 | void
67 | extern_func1_9 (int a, char *b, unsigned long c)
68 | {
69 | extern_func1_10 (a, b, c);
70 | }
71 |
72 | void
73 | extern_func1_10 (int a, char *b, unsigned long c)
74 | {
75 | extern_func1_11 (a, b, c);
76 | }
77 |
78 | void
79 | extern_func1_11 (int a, char *b, unsigned long c)
80 | {
81 | extern_func1_12 (a, b, c);
82 | }
83 |
84 | void
85 | extern_func1_12 (int a, char *b, unsigned long c)
86 | {
87 | extern_func1_13 (a, b, c);
88 | }
89 |
90 | void
91 | extern_func1_13 (int a, char *b, unsigned long c)
92 | {
93 | extern_func1_14 (a, b, c);
94 | }
95 |
96 | void
97 | extern_func1_14 (int a, char *b, unsigned long c)
98 | {
99 | extern_func1_15 (a, b, c);
100 | }
101 |
102 | void
103 | extern_func1_15 (int a, char *b, unsigned long c)
104 | {
105 | /* THE END */
106 | return;
107 | }
108 |
--------------------------------------------------------------------------------
/libgui/library/advice.tcl:
--------------------------------------------------------------------------------
1 | # advice.tcl - Generic advice package.
2 | # Copyright (C) 1998 Cygnus Solutions.
3 | # Written by Tom Tromey .
4 |
5 | # Please note that I adapted this from some code I wrote elsewhere,
6 | # for non-Cygnus reasons. Don't complain to me if you see something
7 | # like it somewhere else.
8 |
9 |
10 | # Internal state.
11 | defarray ADVICE_state
12 |
13 | # This is a helper proc that does all the actual work.
14 | proc ADVICE_do {command argList} {
15 | global ADVICE_state
16 |
17 | # Run before advice.
18 | if {[info exists ADVICE_state(before,$command)]} {
19 | foreach item $ADVICE_state(before,$command) {
20 | # We purposely let errors in advice go uncaught.
21 | uplevel $item $argList
22 | }
23 | }
24 |
25 | # Run the command itself.
26 | set code [catch \
27 | [list uplevel \#0 $ADVICE_state(original,$command) $argList] \
28 | result]
29 |
30 | # Run the after advice.
31 | if {[info exists ADVICE_state(after,$command)]} {
32 | foreach item $ADVICE_state(after,$command) {
33 | # We purposely let errors in advice go uncaught.
34 | uplevel $item [list $code $result] $argList
35 | }
36 | }
37 |
38 | # Return just as the original command would.
39 | return -code $code $result
40 | }
41 |
42 | # Put some advice on a proc or command.
43 | # WHEN says when to run the advice - `before' or `after' the
44 | # advisee is run.
45 | # WHAT is the name of the proc or command to advise.
46 | # ADVISOR is the advice. It is passed the arguments to the advisee
47 | # call as its arguments. In addition, `after' advisors are
48 | # passed the return code and return value of the proc as their
49 | # first and second arguments.
50 | proc advise {when what advisor} {
51 | global ADVICE_state
52 |
53 | if {! [info exists ADVICE_state(original,$what)]} {
54 | set newName [gensym]
55 | rename $what $newName
56 | set ADVICE_state(original,$what) $newName
57 |
58 | # Create a new proc which just runs our internal command with the
59 | # correct arguments.
60 | uplevel \#0 [list proc $what args \
61 | [format {ADVICE_do %s $args} $what]]
62 | }
63 |
64 | lappend ADVICE_state($when,$what) $advisor
65 | }
66 |
67 | # Remove some previously-set advice. Note that we could undo the
68 | # `rename' when the last advisor is removed. This adds complexity,
69 | # though, and there isn't much reason to.
70 | proc unadvise {when what advisor} {
71 | global ADVICE_state
72 |
73 | if {[info exists ADVICE_state($when,$what)]} {
74 | set newList {}
75 | foreach item $ADVICE_state($when,$what) {
76 | if {[string compare $advisor $item]} {
77 | lappend newList $item
78 | }
79 | }
80 | set ADVICE_state($when,$what) $newList
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/libgui/src/tclmain.c:
--------------------------------------------------------------------------------
1 | /* tclmain.c - a simple main() for IDE programs that use Tk.
2 | Copyright (C) 1997, 1998 Cygnus Solutions.
3 | Written by Tom Tromey . */
4 |
5 | #include
6 |
7 | #include
8 | #include
9 |
10 | #include
11 |
12 | #ifdef HAVE_STDLIB_H
13 | #include
14 | #endif
15 |
16 | #ifdef _WIN32
17 | #include
18 | #include
19 | #endif
20 |
21 | #include "guitcl.h"
22 |
23 | #ifndef EXIT_SUCCESS
24 | #define EXIT_SUCCESS 0
25 | #endif
26 |
27 | #ifndef EXIT_FAILURE
28 | #define EXIT_FAILURE 1
29 | #endif
30 |
31 | /* This is like Tk_Main, except that the resulting program doesn't try
32 | to act like a script interpreter. It never reads commands from
33 | stdin. */
34 | void
35 | ide_main (int argc, char *argv[], Tcl_AppInitProc *appInitProc)
36 | {
37 | Tcl_Interp *interp;
38 | char *args;
39 | char buf[20];
40 |
41 | Tcl_FindExecutable (argv[0]);
42 | interp = Tcl_CreateInterp ();
43 |
44 | #ifdef TCL_MEM_DEBUG
45 | Tcl_InitMemory (interp);
46 | #endif
47 |
48 | args = Tcl_Merge (argc - 1, argv + 1);
49 | Tcl_SetVar (interp, "argv", args, TCL_GLOBAL_ONLY);
50 | ckfree (args);
51 |
52 | sprintf (buf, "%d", argc-1);
53 | Tcl_SetVar (interp, "argc", buf, TCL_GLOBAL_ONLY);
54 | Tcl_SetVar (interp, "argv0", argv[0], TCL_GLOBAL_ONLY);
55 |
56 | /* We set this to "1" so that the console window will work. */
57 | Tcl_SetVar (interp, "tcl_interactive", "1", TCL_GLOBAL_ONLY);
58 |
59 | #if IDE_ENABLED
60 | Tcl_SetVar (interp, "IDE_ENABLED", "1", TCL_GLOBAL_ONLY);
61 | #else
62 | Tcl_SetVar (interp, "IDE_ENABLED", "0", TCL_GLOBAL_ONLY);
63 | #endif
64 |
65 | if ((*appInitProc) (interp) != TCL_OK)
66 | {
67 | Tcl_Channel err_channel;
68 | char *msg;
69 |
70 | /* Guarantee that errorInfo is set properly. */
71 | Tcl_AddErrorInfo (interp, "");
72 | msg = Tcl_GetVar (interp, "errorInfo", TCL_GLOBAL_ONLY);
73 |
74 | /* On Windows, we are probably running as a windows app, and
75 | stderr is the bit bucket, so we call a win32 function to
76 | display the error. */
77 |
78 | #ifdef _WIN32
79 | MessageBox (NULL, msg, NULL, MB_OK | MB_ICONERROR | MB_TASKMODAL);
80 | #else
81 | err_channel = Tcl_GetStdChannel (TCL_STDERR);
82 | if (err_channel)
83 | {
84 |
85 | Tcl_Write (err_channel, msg, -1);
86 | Tcl_Write (err_channel, "\n", 1);
87 | }
88 | #endif
89 |
90 | Tcl_DeleteInterp (interp);
91 | Tcl_Exit (EXIT_FAILURE);
92 | }
93 |
94 | Tcl_ResetResult (interp);
95 |
96 | /* Now just go until the user decides to shut down. */
97 | Tk_MainLoop ();
98 | Tcl_DeleteInterp (interp);
99 | Tcl_Exit (EXIT_SUCCESS);
100 | }
101 |
--------------------------------------------------------------------------------
/gdbtk/plugins/configure.ac:
--------------------------------------------------------------------------------
1 | AC_INIT(Make-rules)
2 | AC_CONFIG_AUX_DIR(../../..)
3 | AM_INIT_AUTOMAKE(insight, 1.0)
4 | AM_MAINTAINER_MODE
5 | AC_PROG_MAKE_SET
6 | AC_CANONICAL_HOST
7 | AC_PROG_CC
8 | AC_OBJEXT
9 | AC_EXEEXT
10 |
11 | # Find Tcl, Tk, etc
12 | SC_PATH_TCLCONFIG
13 | SC_LOAD_TCLCONFIG
14 | SC_PATH_TKCONFIG
15 | SC_LOAD_TKCONFIG
16 |
17 | # Special in-tree hackery
18 | here=`pwd`
19 | cd ${srcdir}/../../..
20 | topdir=`pwd`
21 | cd ${here}
22 |
23 | if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
24 | TCL_INCLUDES="-I${TCL_SRC_DIR}/generic"
25 | TCL_LIBRARY="${TCL_BUILD_LIB_SPEC}"
26 | else
27 | TCL_INCLUDES="${TCL_INCLUDE_SPEC}"
28 | TCL_LIBRARY="${TCL_LIB_SPEC}"
29 | fi
30 |
31 | AC_SUBST(TCL_DBGX)
32 | AC_SUBST(TCL_SHLIB_CFLAGS)
33 | AC_SUBST(TCL_SHLIB_LD)
34 | AC_SUBST(TCL_SHLIB_SUFFIX)
35 | AC_SUBST(TCL_INCLUDES)
36 | AC_SUBST(TCL_LIBRARY)
37 |
38 | # Make sure TCL_SHLIB_SUFFIX is set
39 | if test x$TCL_SHLIB_SUFFIX = x ; then
40 | case "${host}" in
41 | *cygwin*) TCL_SHLIB_SUFFIX=".dll" ;;
42 | *) TCL_SHILB_SUFFIX=".so" ;;
43 | esac
44 | fi
45 | AC_SUBST(TCL_SHLIB_SUFFIX)
46 |
47 | # Since we're not using autoconf > 2.1x, we cannot use AC_CONFIG_FILES.
48 | make_subdirs=""
49 |
50 | # See if -mwin32 works for cygwin
51 | case "${host}" in
52 | *cygwin*)
53 | ocflags=${CFLAGS}
54 | CFLAGS="${CFLAGS} -mwin32"
55 | AC_TRY_COMPILE(,,,CFLAGS="${ocflags}")
56 | ;;
57 | *) ;;
58 | esac
59 |
60 | # note toplevel plugin build directory
61 | plugin_builddir=`pwd`
62 |
63 | #
64 | # Plugins
65 | #
66 |
67 | # Supported hosts
68 |
69 | # Only supported/tested on linux, solaris, cygwin
70 | supported=yes
71 | case "${host}" in
72 | *cygwin*) ;;
73 | *solaris*) ;;
74 | *linux*) ;;
75 | *) supported=no ;;
76 | esac
77 |
78 | # Host-specific configury
79 | case "${host}" in
80 | *cygwin*)
81 | AC_CHECK_TOOL(NM, nm, nm)
82 | AC_CHECK_TOOL(AS, as, as)
83 | AC_CHECK_TOOL(LD, ld, ld)
84 | AC_MSG_CHECKING("for libcygwin.a")
85 | LIBCYGWIN_A=`$CC -print-file-name=libcygwin.a`
86 | AC_MSG_RESULT($LIBCYGWIN_A)
87 | AC_SUBST(LIBCYGWIN_A)
88 | AC_CHECK_TOOL(DLLTOOL, dlltool)
89 | ;;
90 | esac
91 |
92 | # Plugins supported by this configuration
93 | if test x${supported} = xyes; then
94 | plugins="rhabout"
95 | case "${target}" in
96 | *cygwin*) ;;
97 | *linux*) ;;
98 | *i?86*)
99 | plugins="${plugins} intel-pentium"
100 | ;;
101 | esac
102 |
103 | for i in $plugins ; do
104 | make_subdirs="${make_subdirs} $i"
105 | done
106 | fi
107 |
108 | AC_SUBST(make_subdirs)
109 | AC_SUBST(plugin_builddir)
110 |
111 | AC_OUTPUT(Makefile rhabout/Makefile:rhabout/Makefile.in:Make-rules rhabout/rhabout.tcl intel-pentium/Makefile:intel-pentium/Makefile.in:Make-rules intel-pentium/intel-pentium.tcl)
112 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | IMPORTANT NOTE:
2 |
3 | The insight graphical debugger is now back to its legitimate location at
4 | https://sourceware.org/git/?p=insight.git.
5 | The current github repository will NOT be updated anymore and will be removed
6 | soon.
7 | Please update your git location to git://sourceware.org/git/insight.git.
8 |
9 | YOU HAVE BEEN WARNED !!!
10 |
11 |
12 | insight: the gdb tcl/tk graphic interface
13 | -----------------------------------------
14 |
15 | The GUI part of insight is now maintained outside the gdb tree. Bundles are
16 | therefore needed to get the whole code embedded. They are implemented as:
17 |
18 | - bfd, opcodes, texinfo, readline, libiberty, include, sim, cpu, intl and
19 | libdecnumber are now bundles of binutils-gdb.
20 |
21 | - libgui does not appear in any other repository and thus is now part of
22 | insight.
23 |
24 | - binutils-gdb is included as a git submodule.
25 |
26 | - tcl, tk, itcl, itk and iwidgets must be provided externally.
27 |
28 |
29 | Cloning:
30 | After a simple clone, the submodule has to be initialized and downloaded. This
31 | is done as:
32 | git clone
33 | cd insight.git
34 | git submodule init
35 | git submodule update
36 |
37 | Alternatively, initial cloning can be performed as:
38 | git clone --recursive
39 |
40 | Updating:
41 | For automatic submodule pulls upon main module pull, set
42 |
43 | git config fetch.recurseSubmodules true
44 |
45 | else use
46 |
47 | git submodule foreach --recursive git pull
48 |
49 | when submodule pulls are required.
50 | If upgrade of submodules is needed, finish update by
51 |
52 | git submodule update --remote
53 |
54 |
55 | Building:
56 | - Prepare the configuration scripts with:
57 | autoconf
58 |
59 | - Configure the package with the needed options. In example:
60 | ./configure --prefix=/usr/. \
61 | --libdir=/usr/lib64 \
62 | --disable-binutils \
63 | --disable-elfcpp \
64 | --disable-gas \
65 | --disable-gold \
66 | --disable-gprof \
67 | --disable-ld \
68 | --disable-rpath \
69 | --disable-zlib \
70 | --enable-sim \
71 | --with-gdb-datadir=/usr/share/insight \
72 | --with-jit-reader-dir=/usr/lib64/insight \
73 | --with-separate-debug-dir='/usr/lib/debug' \
74 | --with-expat \
75 | --with-python \
76 | --without-libunwind
77 |
78 | The configure script builds the "bundle" directory where the rest of
79 | the build will be performed.
80 |
81 | - run make: the top Makefile is only a stub recursively making in the
82 | "bundle" directory.
83 |
84 |
85 | To produce a source release tarball:
86 | - Start from a FRESH recursive clone. Work in its top directory.
87 | - autoconf
88 | - configure
89 | - (cd bundle; ./src-release.sh [-b|-g|-x] insight)
90 | -b, -g and -x compress the tarball with bzip2, gzip and xz respectively.
91 | Tarball is left in file bundle/insight-VE.RS.ION.DATE.tar[.suffix]
92 |
--------------------------------------------------------------------------------
/libgui/library/bindings.tcl:
--------------------------------------------------------------------------------
1 | # bindings.tcl - Procs to handle bindings.
2 | # Copyright (C) 1997 Cygnus Solutions.
3 | # Written by Tom Tromey .
4 |
5 | # Reorder the bindtags so that the tag appears before the widget.
6 | # Tries to preserve other relative orderings as much as possible. In
7 | # particular, nothing changes if the widget is already after the tag.
8 | proc bind_widget_after_tag {w tag} {
9 | set seen_tag 0
10 | set seen_widget 0
11 | set new_list {}
12 | foreach tag [bindtags $w] {
13 | if {$tag == $tag} then {
14 | lappend new_list $tag
15 | if {$seen_widget} then {
16 | lappend new_list $w
17 | }
18 | set seen_tag 1
19 | } elseif {$tag == $w} then {
20 | if {$seen_tag} then {
21 | lappend new_list $tag
22 | }
23 | set seen_widget 1
24 | } else {
25 | lappend new_list $tag
26 | }
27 | }
28 |
29 | if {! $seen_widget} then {
30 | lappend new_list $w
31 | }
32 |
33 | bindtags $w $new_list
34 | }
35 |
36 | # Reorder the bindtags so that the class appears before the widget.
37 | # Tries to preserve other relative orderings as much as possible. In
38 | # particular, nothing changes if the widget is already after the
39 | # class.
40 | proc bind_widget_after_class {w} {
41 | bind_widget_after_tag $w [winfo class $w]
42 | }
43 |
44 | # Make the specified binding for KEY and empty bindings for common
45 | # modifiers for KEY. This can be used to ensure that a binding won't
46 | # also be triggered by (eg) Alt-KEY. This proc also makes the binding
47 | # case-insensitive. KEY is either the name of a key, or a key with a
48 | # single modifier.
49 | proc bind_plain_key {w key binding} {
50 | set l [split $key -]
51 | if {[llength $l] == 1} then {
52 | set mod {}
53 | set part $key
54 | } else {
55 | set mod "[lindex $l 0]-"
56 | set part [lindex $l 1]
57 | }
58 |
59 | set modifiers {Meta- Alt- Control-}
60 |
61 | set part_list [list $part]
62 | # If we just have a single letter, then we can't look for
63 | # Shift-PART; we must use the uppercase equivalent.
64 | if {[string length $part] == 1} then {
65 | # This is nasty: if we bind Control-L, we won't see the events we
66 | # want. Instead we have to bind Shift-Control-L. Actually, we
67 | # must also bind Control-L so that we'll see the event if the Caps
68 | # Lock key is down.
69 | if {$mod != ""} then {
70 | lappend part_list "Shift-[string toupper $part]"
71 | }
72 | lappend part_list [string toupper $part]
73 | } else {
74 | lappend modifiers Shift-
75 | }
76 |
77 | foreach part $part_list {
78 | # Bind the key itself (with modifier if required).
79 | bind $w <${mod}${part}> $binding
80 |
81 | # Ignore any modifiers other than the one we like.
82 | foreach onemod $modifiers {
83 | if {$onemod != $mod} then {
84 | bind $w <${onemod}${part}> {;}
85 | }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/gdbtk/library/debugwin.ith:
--------------------------------------------------------------------------------
1 | # Debug window class definition for GDBtk.
2 | # Copyright (C) 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 | # NAME:
17 | # class DebugWin
18 | #
19 | # DESC:
20 | # This class implements a debug output window to display internal
21 | # debugging information. It can handle debugging messages, tracing,
22 | # and eventually profiling.
23 | #
24 | # NOTES:
25 | # This window is for developers.
26 | #
27 | # -----------------------------------------------------------------------------
28 | itcl::class DebugWin {
29 | inherit ManagedWin
30 |
31 | private {
32 | variable _t
33 | variable _colors {
34 | {I green}
35 | {W yellow}
36 | {E orange}
37 | {X red}
38 | }
39 | variable _bigstr " "
40 | method build_win {}
41 | method _source_all {}
42 | method _clear {}
43 | method _mark_old {}
44 | method _save_contents {}
45 | method reconfig {}
46 | }
47 |
48 | protected {
49 | method _ignore_on_save {} { return 1 }
50 | }
51 |
52 | public {
53 | method constructor {args}
54 | method destructor {}
55 | method puts {level cls func msg}
56 | method put_trace {enter level func ar}
57 | method loadlog {}
58 | }
59 | }
60 |
61 | # -----------------------------------------------------------------------------
62 | # NAME:
63 | # class DebugWinDOpts
64 | #
65 | # DESC:
66 | # This class implements a debug options dialog for the DebugWin.
67 | # Currently this consists os a selection dialog to choose which
68 | # messages to print. Eventually it could also include a filter
69 | # for different priorities and color selections.
70 | #
71 | # NOTES:
72 | # This window is for developers.
73 | #
74 | # -----------------------------------------------------------------------------
75 | itcl::class DebugWinDOpts {
76 | inherit ManagedWin
77 |
78 | public {
79 | method constructor {args} {}
80 | method destructor {}
81 | }
82 |
83 | protected {
84 | method _ignore_on_save { return 1 }
85 | }
86 |
87 | private {
88 | variable _classes
89 | method build_win {}
90 | method _all {}
91 | method _apply {done}
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/gdbtk/plugins/rhabout/rhabout.itcl:
--------------------------------------------------------------------------------
1 | class RHAbout {
2 | inherit PluginWindow
3 | constructor {args} {
4 | global gdb_ImageDir
5 |
6 | # What about a menu?
7 | $menubar add menubutton file "File" 0
8 | $menubar add command None "Close" \
9 | [code $this destroy_toplevel] \
10 | -underline 1
11 | $menubar add menubutton help "Help" 0
12 | $menubar add command Other "Help Topics" \
13 | {open_help index.html} \
14 | -underline 0
15 | $menubar add separator
16 | $menubar add command Other "About GDB..." \
17 | {ManagedWin::open About -transient} \
18 | -underline 0
19 |
20 | # The menu only shows up if you do this:
21 | $menubar show
22 |
23 | # Do you want a toolbar?
24 | $toolbar add button con Other {ManagedWin::open Console} \
25 | "Console (Ctrl+N)" -image console_img
26 |
27 | # The toolbar will only show up if you do this:
28 | $toolbar show
29 |
30 | # Now, fill the childsite with some graphics and text
31 |
32 | # Remember to use the childsite, do not pack in the widget hull
33 | set f [childsite]
34 |
35 | # Put in some graphics
36 | label $f.image1 -bg white -image \
37 | [image create photo -file [file join $gdb_ImageDir insight.gif]]
38 |
39 | # Here we call an interface function provided by GDBTCL
40 | set text [gdb_cmd {show version}]
41 |
42 | # Here we call a command procedure that we created, if it exists
43 | catch {append text [rhabout_extra_text]}
44 |
45 | # Now add the text
46 | message $f.m -bg white -fg black -text $text -aspect 500 -relief flat
47 |
48 | # Add a status bar so we can show some dynamic information
49 | set _status [label $f.stat -relief sunken -bd 3 \
50 | -font global/status -height 1]
51 |
52 | # pack everything
53 | pack $f.image1 $f.m -fill both -expand yes
54 | pack $f.stat -expand 1 -fill both
55 | pack $itk_interior
56 |
57 | # Give our sample window a name
58 | window_name "About Red Hat Insight Plug-In"
59 | }
60 |
61 | # You can overload the base class busy method, but make sure
62 | # to call it as well or the menu and button status will not be updated
63 | # (unless this is what you want)
64 | public method busy {event} {
65 | debug
66 | # Call the baseclass version
67 | PluginWindow::busy $event
68 |
69 | # Display something in the status area
70 | $_status configure -text "Running..."
71 | }
72 |
73 | # You can overload the base class idle method, but make sure
74 | # to call it as well or the menu and button status will not be updated
75 | # (unless this is what you want)
76 | private method idle {} {
77 | debug
78 | # First call the baseclass version
79 | PluginWindow::idle
80 |
81 | # Display something in the status area
82 | $_status configure -text "Stopped."
83 | }
84 |
85 | # Path to the status area
86 | private variable _status
87 | }
88 |
--------------------------------------------------------------------------------
/libgui/src/tkTableInitScript.h:
--------------------------------------------------------------------------------
1 | /*
2 | * tkTableInitScript.h --
3 | *
4 | * This file contains common init script for tkTable
5 | *
6 | * Copyright (c) 1998-2016 Jeffrey Hobbs
7 | *
8 | * See the file "license.terms" for information on usage and redistribution
9 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 | */
11 |
12 | #ifdef __cplusplus
13 | extern "C" {
14 | #endif
15 |
16 | /*
17 | * The following string is the startup script executed when the table is
18 | * loaded. It looks on disk in several different directories for a script
19 | * "TBL_RUNTIME" (as defined in Makefile) that is compatible with this
20 | * version of tkTable. The sourced script has all key bindings defined.
21 | */
22 |
23 | static char tkTableInitScript[] = "if {[info proc tkTableInit]==\"\"} {\n\
24 | proc tkTableInit {} {\n\
25 | global tk_library tcl_pkgPath errorInfo env\n\
26 | rename tkTableInit {}\n\
27 | set errors {}\n\
28 | if {![info exists env(TK_TABLE_LIBRARY_FILE)]} {\n\
29 | set env(TK_TABLE_LIBRARY_FILE) " TBL_RUNTIME "\n\
30 | }\n\
31 | if {[info exists env(TK_TABLE_LIBRARY)]} {\n\
32 | lappend dirs $env(TK_TABLE_LIBRARY)\n\
33 | }\n\
34 | lappend dirs " TBL_RUNTIME_DIR "\n\
35 | if {[info exists tcl_pkgPath]} {\n\
36 | foreach i $tcl_pkgPath {\n\
37 | lappend dirs [file join $i Tktable" TBL_VERSION "] \\\n\
38 | [file join $i Tktable] $i\n\
39 | }\n\
40 | }\n\
41 | lappend dirs $tk_library [pwd]\n\
42 | foreach i $dirs {\n\
43 | set try [file join $i $env(TK_TABLE_LIBRARY_FILE)]\n\
44 | if {[file exists $try]} {\n\
45 | if {![catch {uplevel #0 [list source $try]} msg]} {\n\
46 | set env(TK_TABLE_LIBRARY) $i\n\
47 | return\n\
48 | } else {\n\
49 | append errors \"$try: $msg\n$errorInfo\n\"\n\
50 | }\n\
51 | }\n\
52 | }\n"
53 | #ifdef NO_EMBEDDED_RUNTIME
54 | " set msg \"Can't find a $env(TK_TABLE_LIBRARY_FILE) in the following directories: \n\"\n\
55 | append msg \" $dirs\n\n$errors\n\n\"\n\
56 | append msg \"This probably means that TkTable wasn't installed properly.\"\n\
57 | return -code error $msg\n"
58 | #else
59 | " set env(TK_TABLE_LIBRARY) EMBEDDED_RUNTIME\n"
60 | # ifdef MAC_TCL
61 | " source -rsrc tkTable"
62 | # else
63 | " uplevel #0 {"
64 | # include "tkTable.tcl.h"
65 | " }"
66 | # endif
67 | #endif
68 | " }\n\
69 | }\n\
70 | tkTableInit";
71 |
72 | /*
73 | * The init script can't make certain calls in a safe interpreter,
74 | * so we always have to use the embedded runtime for it
75 | */
76 | static char tkTableSafeInitScript[] = "if {[info proc tkTableInit]==\"\"} {\n\
77 | proc tkTableInit {} {\n\
78 | set env(TK_TABLE_LIBRARY) EMBEDDED_RUNTIME\n"
79 | #ifdef NO_EMBEDDED_RUNTIME
80 | " append msg \"tkTable requires embedded runtime to be compiled for\"\n\
81 | append msg \" use in safe interpreters\"\n\
82 | return -code error $msg\n"
83 | #endif
84 | # ifdef MAC_TCL
85 | " source -rsrc tkTable"
86 | # else
87 | " uplevel #0 {"
88 | # include "tkTable.tcl.h"
89 | " }"
90 | # endif
91 | " }\n\
92 | }\n\
93 | tkTableInit";
94 |
95 |
96 | #ifdef __cplusplus
97 | }
98 | #endif
99 |
--------------------------------------------------------------------------------
/libgui/library/wframe.tcl:
--------------------------------------------------------------------------------
1 | # wframe.tcl - Frame with a widget on its border.
2 | # Copyright (C) 1997,2008 Red Hat, Inc.
3 | # Written by Tom Tromey .
4 |
5 | itcl::class Widgetframe {
6 | # Where to put the widget. For now, we don't support many anchors.
7 | # Augment as you like.
8 | public variable anchor nw {
9 | if {$anchor != "nw" && $anchor != "n"} then {
10 | error "anchors nw and n are the only ones supported"
11 | }
12 | _layout
13 | }
14 |
15 | # The name of the widget to put on the frame. This is set by some
16 | # subclass calling the _add method. Private variable.
17 | protected variable _widget {}
18 |
19 | constructor {} {
20 | # The standard widget-making trick.
21 | set class [$this info class]
22 | set hull [namespace tail $this]
23 | set old_name $this
24 | ::rename $this $this-tmp-
25 | ::frame $hull -class $class -relief flat -borderwidth 0
26 | ::rename $hull $old_name-win-
27 | ::rename $this $old_name
28 |
29 | frame [namespace tail $this].iframe -relief groove -borderwidth 2
30 | grid [namespace tail $this].iframe -row 1 -sticky news
31 | grid rowconfigure [namespace tail $this] 1 -weight 1
32 | grid columnconfigure [namespace tail $this] 0 -weight 1
33 |
34 | # Make an internal frame so that user stuff isn't obscured. Note
35 | # that we can't use the placer, because it doesn't set the
36 | # geometry of the parent.
37 | frame [namespace tail $this].iframe.frame -borderwidth 4 -relief flat
38 | grid [namespace tail $this].iframe.frame -row 1 -sticky news
39 | grid rowconfigure [namespace tail $this].iframe 1 -weight 1
40 | grid columnconfigure [namespace tail $this].iframe 0 -weight 1
41 |
42 | bind [namespace tail $this].iframe \
43 | [itcl::code itcl::delete object $this]
44 | }
45 |
46 | destructor {
47 | catch {destroy $this}
48 | }
49 |
50 | # Return name of internal frame.
51 | method get_frame {} {
52 | return [namespace tail $this].iframe.frame
53 | }
54 |
55 | # Name a certain widget to be put on the frame. This should be
56 | # called by some subclass after making the widget. Protected
57 | # method.
58 | method _add {widget} {
59 | set _widget $widget
60 | set height [expr {int ([winfo reqheight $_widget] / 2)}]
61 | grid rowconfigure [namespace tail $this] 0 -minsize $height -weight 0
62 | grid rowconfigure [namespace tail $this].iframe 0 -minsize $height -weight 0
63 | _layout
64 | }
65 |
66 | # Re-layout according to the anchor. Private method.
67 | method _layout {} {
68 | if {$_widget == "" || ! [winfo exists $_widget]} then {
69 | return
70 | }
71 |
72 | switch -- $anchor {
73 | n {
74 | # Put the label over the border, in the center.
75 | place $_widget -in [namespace tail $this].iframe -relx 0.5 -rely 0 -y -2 \
76 | -anchor center
77 | }
78 | nw {
79 | # Put the label over the border, at the top left.
80 | place $_widget -in [namespace tail $this].iframe -relx 0 -x 6 -rely 0 -y -2 \
81 | -anchor w
82 | }
83 | default {
84 | error "unsupported anchor \"$anchor\""
85 | }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/gdbtk/library/regwin.ith:
--------------------------------------------------------------------------------
1 | # Register display window class definition for Insight.
2 | # Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
3 | #
4 | # Written by Keith Seitz (keiths@redhat.com)
5 | # based on work by Martin Hunt (hunt@redhat.com)
6 | #
7 | # This program is free software; you can redistribute it and/or modify it
8 | # under the terms of the GNU General Public License (GPL) as published by
9 | # the Free Software Foundation; either version 2 of the License, or (at
10 | # your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 |
17 |
18 | itcl::class RegWin {
19 | inherit EmbeddedWin GDBWin
20 |
21 | private {
22 | variable _change_list {}
23 | variable _menuitems
24 |
25 | # Display data for the table
26 | variable _data
27 |
28 | # Mapping of table cell index to register number
29 | variable _register
30 |
31 | # the register group that is displayed
32 | variable _group "all"
33 |
34 | # Mapping of register number to table cell index. "hidden" if
35 | # the register was "removed" from the display.
36 | variable _cell
37 |
38 | # Is REGNUM editable?
39 | variable _editable
40 |
41 | # List of possible display types for the registers (indexed by regnum)
42 | variable _types
43 | # The display type to use for each register (indexed by regnum)
44 | variable _type
45 | # The display format to use for each register (indexed by regnum)
46 | variable _format
47 |
48 | # The list of registers we're displaying
49 | variable _reg_display_list {}
50 |
51 | # Size of columns
52 | variable _col_size
53 | variable _max_label_width
54 |
55 | # Dimensions
56 | variable _rows
57 | variable _cols
58 |
59 | # Fencepost
60 | variable _running 0
61 |
62 |
63 | # Table layout/display methods
64 | method _build_win {}
65 | method _layout_table {}
66 | method _load_prefs {}
67 | method _size_cell_column {cell down}
68 | method _size_column {col down}
69 |
70 | # Table event handlers and related methods
71 | method _accept_edit {}
72 | method _add_to_watch {rn}
73 | method _but3 {x y X Y}
74 | method _delete_from_display {rn}
75 | method _display_all {}
76 | method _edit {x y}
77 | method _move {direction}
78 | method _open_memory {rn}
79 | method _select_group {}
80 | method _select_cell {cell}
81 | method _unedit {}
82 |
83 | # Register operations
84 | method _get_value {rn}
85 | method _change_format {rn {t {}}}
86 | method _update_register {rn}
87 | }
88 |
89 | public {
90 | method constructor {args}
91 | method destructor {}
92 |
93 | #
94 | # Gdb Events
95 | #
96 | method busy {event}
97 | method idle {event}
98 | method set_variable {event}
99 | method update {event}
100 | method arch_changed {event}
101 | method reconfig {}
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/gdbtk/library/helpviewer.tcl:
--------------------------------------------------------------------------------
1 | # Open a viewer for HTML help info
2 | # Copyright (C) 2002, 2008, Red Hat, Inc.
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 | # NAME: public proc open_help
16 | # SYNOPSIS: open_help file
17 | # DESC: Opens html help file using an appropriate
18 | # browser.
19 | # ------------------------------------------------------------------------------
20 |
21 | proc open_help {hfile} {
22 | debug $hfile
23 | # create full pathname link
24 | set link file://[file join $::GDBTK_LIBRARY help $hfile]
25 |
26 | # windows is easy
27 | if {$::gdbtk_platform(platform) == "windows"} {
28 | ide_shell_execute open $link
29 | return
30 | }
31 |
32 | #
33 | # for Unix, we never know what is installed
34 | #
35 |
36 | # set list of viewer apps to try
37 | switch [pref get gdb/compat] {
38 | "KDE" {
39 | set apps {htmlview khelpcenter firefox opera mozilla}
40 | }
41 | "GNOME" {
42 | set apps {htmlview firefox opera mozilla gnome-help khelpcenter}
43 | }
44 | default {
45 | set apps {htmlview firefox opera mozilla gnome-help khelpcenter netscape}
46 | }
47 | }
48 |
49 | # If the user has previously entered a browser name, append it
50 | # to the list. Should it go first or last?
51 | set bname [pref get gdb/help/browsername]
52 | if {$bname != ""} {
53 | lappend apps $bname
54 | }
55 |
56 | # now loop through list checking each application
57 | foreach app $apps {
58 | debug "app=$app"
59 | if {[catch "exec $app $link &" result]} {
60 | debug "$app failed: $result"
61 | } else {
62 | return
63 | }
64 | }
65 |
66 | # if we reached here, nothing worked, so prompt for a name
67 | set text "No help browser was found on your system.\n\
68 | Please enter the name of an HTML viewer application."
69 | while {[set app [prompt_helpname $text]] != "0"} {
70 | if {$app != ""} {
71 | if {[catch "exec $app $link &" result]} {
72 | dbug W "$app failed: $result"
73 | set text "Could not run application $app.\n\
74 | Please enter the name of an HTML viewer application."
75 | } else {
76 | pref set gdb/help/browsername $app
77 | return
78 | }
79 | }
80 | }
81 | }
82 |
83 | # displays an entry dialog and asks for the name of an application
84 | # returns 0 on cancel
85 | # name on success
86 | proc prompt_helpname {text} {
87 | iwidgets::promptdialog .pd -title "Browser Query" -modality application \
88 | -labeltext $text
89 | if {[.pd activate]} {
90 | set app [string trim [.pd get]]
91 | destroy .pd
92 | return $app
93 | }
94 | destroy .pd
95 | debug "cancelled"
96 | return 0
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/gdbtk/library/tdump.tcl:
--------------------------------------------------------------------------------
1 | # Trace dump window for Insight
2 | # Copyright (C) 1998, 1999, 2001, 2002, 2004, 2008 Red Hat, Inc.
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 | inherit ManagedWin GDBWin
33 |
34 | # ------------------------------------------------------------------
35 | # CONSTRUCTOR - create new tdump window
36 | # ------------------------------------------------------------------
37 | constructor {args} {
38 | window_name "Trace Dump"
39 | build_win
40 | eval itk_initialize $args
41 | }
42 |
43 |
44 | # ------------------------------------------------------------------
45 | # METHOD: build_win - build the main tdump window
46 | # ------------------------------------------------------------------
47 | method build_win {} {
48 | itk_component add stext {
49 | iwidgets::scrolledtext $itk_interior.stext -hscrollmode dynamic \
50 | -vscrollmode dynamic -textfont global/fixed \
51 | -background $::Colors(bg)
52 | } {}
53 | [$itk_component(stext) component text] configure \
54 | -background $::Colors(bg)
55 | pack $itk_component(stext) -side left -expand yes -fill both
56 | update dummy
57 | }
58 |
59 |
60 | # ------------------------------------------------------------------
61 | # METHOD: update - update widget when PC changes
62 | # ------------------------------------------------------------------
63 | method update {event} {
64 | #debug "tdump: update"
65 | gdbtk_busy
66 | set tframe_num [gdb_get_trace_frame_num]
67 |
68 | if { $tframe_num!=-1 } {
69 | debug "doing tdump"
70 | $itk_component(stext) delete 1.0 end
71 |
72 | if {[catch {gdb_cmd "tdump $tframe_num" 0} tdump_output]} {
73 | tk_messageBox -title "Error" -message $tdump_output -icon error \
74 | -type ok
75 | } else {
76 | #debug "tdum output is $tdump_output"
77 |
78 | $itk_component(stext) insert end $tdump_output
79 | $itk_component(stext) see insert
80 | }
81 | }
82 | gdbtk_idle
83 | }
84 |
85 | # ------------------------------------------------------------------
86 | # METHOD: reconfig - used when preferences change
87 | # ------------------------------------------------------------------
88 | method reconfig {} {
89 | if {[winfo exists $itk_interior.stext]} { destroy $itk_interior.stext }
90 | build_win
91 | }
92 | }
93 |
94 |
--------------------------------------------------------------------------------