+start-sanitize-gdbtk
+Thu May 2 19:17:49 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdbtk.tcl (debug_interface): New global, use to aid debugging.
+ (insert_breakpoint_tag, delete_breakpoint_tag): Fix range.
+ (file_popup_menu): Delete, never used.
+ (listing_window_popup): Rename from listing_window_button_1,
+ remove breakpoint toggling code.
+ (toggle_breakpoint): New procedure.
+ (create_file_win): Bind popup menu to button 2, toggle breakpoints
+ with button 1 in breakpoint area, add display of tagged areas if
+ debugging on.
+end-sanitize-gdbtk
+
Thu May 2 12:46:14 1996 Jeffrey A Law (law@cygnus.com)
- * From Peter Schauer:
+ From Peter Schauer:
* breakpoint.h (enum bpdisp): Add del_at_next_stop.
* breakpoint.c (insert_breakpoints, watchpoint_check,
bpstat_stop_status): Avoid bad references to memory freed via
Wed May 1 17:29:18 1996 Fred Fish <fnf@cygnus.com>
- * Makefile.in (rs6000-nat.o): Dependant on xcoffsolib.h.
+ * Makefile.in (rs6000-nat.o): Depend on xcoffsolib.h.
* config/rs6000/rs6000.mh (NATDEPFILES): Move xcoffread.o ...
- * config/rs6000/rs6000.mt (TDEPFILES): ... to here
+ * config/rs6000/rs6000.mt (TDEPFILES): ... to here.
* xcoffsolib.c (xcoff_relocate_symtab_hook): Define and initialize.
(solib_info): Call xcoff_relocate_symtab via the hook.
(sharedlibrary_command): Ditto.
Solaris support.
Mon Apr 29 16:17:31 1996 Dawn Perchik <dawn@cygnus.com>
+
* c-valprint.c (c_val_print): Fix printing for arrays defined
with 0 length.
Mon Apr 22 20:17:01 1996 Fred Fish <fnf@cygnus.com>
- * Makefile.in (VERSION): Bump version number to 4.16.1
+ * Makefile.in (VERSION): Bump version number to 4.16.1.
* NEWS: Update for 4.16 release.
Mon Apr 22 16:32:29 1996 Stan Shebs <shebs@andros.cygnus.com>
set disassemble_with_source nosource
set expr_update_list(0) 0
+set debug_interface 0
+
#option add *Foreground Black
#option add *Background White
#option add *Font -*-*-medium-r-normal--18-*-*-*-m-*-*-1
$win configure -state normal
$win delete $line.0
$win insert $line.0 "B"
- $win tag add $line $line.0
- $win tag add delete $line.0 "$line.0 lineend"
- $win tag add margin $line.0 "$line.0 lineend"
+ $win tag add margin $line.0 $line.8
$win configure -state disabled
}
} else {
$win insert $line.0 " "
}
- $win tag delete $line
- $win tag add delete $line.0 "$line.0 lineend"
- $win tag add margin $line.0 "$line.0 lineend"
+ $win tag add margin $line.0 $line.8
$win configure -state disabled
}
#
# Local procedure:
#
-# file_popup_menu (win x y xrel yrel) - Popup the file popup menu.
+# listing_window_popup (win x y xrel yrel) - Handle popups for listing window
#
# Description:
#
-# This procedure is invoked as a result of a command binding in the
-# listing window. It does several things:
-# o - It highlights the line under the cursor.
-# o - It pops up the file popup menu which is intended to do
-# various things to the aforementioned line.
-# o - Grabs the mouse for the file popup menu.
+# This procedure is invoked by holding down button 2 (usually) in the
+# listing window. The action taken depends upon where the button was
+# pressed. If it was in the left margin (the breakpoint column), it
+# sets or clears a breakpoint. In the main text area, it will pop up a
+# menu.
#
-# Button 1 has been pressed in a listing window. Pop up a menu.
-
-proc file_popup_menu {win x y xrel yrel} {
+proc listing_window_popup {win x y xrel yrel} {
global wins
global win_to_file
global file_to_debug_file
global selected_line
global selected_file
global selected_win
+ global pos_to_breakpoint
# Map TK window name back to file name.
set file $win_to_file($win)
- set pos [$win index @$xrel,$yrel]
+ set pos [split [$win index @$xrel,$yrel] .]
# Record selected file and line for menu button actions
set selected_file $file_to_debug_file($file)
- set selected_line [lindex [split $pos .] 0]
+ set selected_line [lindex $pos 0]
+ set selected_col [lindex $pos 1]
set selected_win $win
-# Highlight the selected line
-
- eval $win tag config breaktag $highlight
- $win tag add breaktag "$pos linestart" "$pos linestart + 1l"
-
# Post the menu near the pointer, (and grab it)
.file_popup entryconfigure 0 -label "$selected_file:$selected_line"
- tk_popup .file_popup $x $y
+
+ tk_popup .file_popup $x $y
}
#
# Local procedure:
#
-# listing_window_button_1 (win x y xrel yrel) - Handle button 1 in listing window
+# toggle_breakpoint (win x y xrel yrel) - Handle clicks on breakdots
#
# Description:
#
-# This procedure is invoked as a result of holding down button 1 in the
-# listing window. The action taken depends upon where the button was
-# pressed. If it was in the left margin (the breakpoint column), it
-# sets or clears a breakpoint. In the main text area, it will pop up a
-# menu.
+# This procedure sets or clears breakpoints where the button clicked.
#
-proc listing_window_button_1 {win x y xrel yrel} {
+proc toggle_breakpoint {win x y xrel yrel} {
global wins
global win_to_file
global file_to_debug_file
set pos [split [$win index @$xrel,$yrel] .]
-# Record selected file and line for menu button actions
+# Record selected file and line
set selected_file $file_to_debug_file($file)
set selected_line [lindex $pos 0]
# If we're in the margin, then toggle the breakpoint
- if {$selected_col < 8} {
- set pos_break $selected_file:$selected_line
- set pos $file:$selected_line
- set tmp pos_to_breakpoint($pos)
- if {[info exists $tmp]} {
- set bpnum [set $tmp]
- gdb_cmd "delete $bpnum"
- } else {
- gdb_cmd "break $pos_break"
- }
- return
+ if {$selected_col < 8} { # this is alway true actually
+ set pos_break $selected_file:$selected_line
+ set pos $file:$selected_line
+ set tmp pos_to_breakpoint($pos)
+ if {[info exists $tmp]} {
+ set bpnum [set $tmp]
+ gdb_cmd "delete $bpnum"
+ } else {
+ gdb_cmd "break $pos_break"
+ }
+ return
}
-
-# Post the menu near the pointer, (and grab it)
-
- .file_popup entryconfigure 0 -label "$selected_file:$selected_line"
-
- tk_popup .file_popup $x $y
}
#
global breakpoint_file
global breakpoint_line
global line_numbers
+ global debug_interface
# Replace all the dirty characters in $filename with clean ones, and generate
# a unique name for the text widget.
bind $win u {interactive_cmd up}
bind $win d {interactive_cmd down}
+ if $debug_interface {
+ bind $win <Control-C> {
+ puts stdout burp
+ }
+ }
+
$win delete 0.0 end
$win insert 0.0 [read $fh]
close $fh
$win tag add margin $i.0 $i.8
}
- $win tag bind margin <1> {listing_window_button_1 %W %X %Y %x %y}
+ # A debugging trick to highlight sensitive regions.
+ if $debug_interface {
+ $win tag bind source <Enter> {
+ %W tag configure source -background yellow
+ }
+ $win tag bind source <Leave> {
+ %W tag configure source -background green
+ }
+ $win tag bind margin <Enter> {
+ %W tag configure margin -background red
+ }
+ $win tag bind margin <Leave> {
+ %W tag configure margin -background skyblue
+ }
+ }
+
+ $win tag bind margin <1> {
+ toggle_breakpoint %W %X %Y %x %y
+ }
+
$win tag bind source <1> {
%W mark set anchor "@%x,%y wordstart"
set last [%W index "@%x,%y wordend"]
}
$win tag bind sel <1> break
$win tag bind sel <Double-Button-1> {
- display_expression [selection get]
- break
+ display_expression [selection get]
+ break
}
$win tag bind sel <B1-Motion> break
$win tag lower sel
+ $win tag bind source <2> {
+ listing_window_popup %W %X %Y %x %y
+ }
+
# Make these bindings do nothing on the text window -- they
# are completely handled by the tag bindings above.
bind $win <1> break