aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.tcl
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1995-01-24 21:49:11 +0000
committerStu Grossman <grossman@cygnus>1995-01-24 21:49:11 +0000
commitc81a3fa9b60505ead0a2854d0b2ebe865878889e (patch)
tree7e4338a1428b551bf0e1cd8b8c95cf7212187ecc /gdb/gdbtk.tcl
parent2a056eaff2d9280f56abe59343f57f28b0505f5b (diff)
downloadgdb-c81a3fa9b60505ead0a2854d0b2ebe865878889e.zip
gdb-c81a3fa9b60505ead0a2854d0b2ebe865878889e.tar.gz
gdb-c81a3fa9b60505ead0a2854d0b2ebe865878889e.tar.bz2
* gdbtk.c (gdb_disassemble): Fix problem with source+assembly and
g++ caused by out-of-order pc's. * gdbtk.tcl (files_command): Remove duplicate file names. Also, add scrollbar.
Diffstat (limited to 'gdb/gdbtk.tcl')
-rw-r--r--gdb/gdbtk.tcl30
1 files changed, 27 insertions, 3 deletions
diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl
index 2a16424..92f32b9 100644
--- a/gdb/gdbtk.tcl
+++ b/gdb/gdbtk.tcl
@@ -1701,12 +1701,36 @@ proc files_command {} {
wm minsize .files_window 1 1
# wm overrideredirect .files_window true
- listbox .files_window.list -geometry 30x20 -setgrid true
+ listbox .files_window.list -geometry 30x20 -setgrid true \
+ -yscrollcommand {.files_window.scroll set} -relief raised \
+ -borderwidth 2
+ scrollbar .files_window.scroll -orient vertical \
+ -command {.files_window.list yview}
button .files_window.close -text Close -command {destroy .files_window}
tk_listboxSingleSelect .files_window.list
- eval .files_window.list insert 0 [lsort [gdb_listfiles]]
- pack .files_window.list -side top -fill both -expand yes
+
+# Get the file list from GDB, sort it, and format it as one entry per line.
+
+ set filelist [join [lsort [gdb_listfiles]] "\n"]
+
+# Now, remove duplicates (by using uniq)
+
+ set fh [open "| uniq > /tmp/gdbtk.[pid]" w]
+ puts $fh $filelist
+ close $fh
+ set fh [open /tmp/gdbtk.[pid]]
+ set filelist [split [read $fh] "\n"]
+ set filelist [lrange $filelist 0 [expr [llength $filelist] - 2]]
+ close $fh
+ exec rm /tmp/gdbtk.[pid]
+
+# Insert the file list into the widget
+
+ eval .files_window.list insert 0 $filelist
+
pack .files_window.close -side bottom -fill x -expand no -anchor s
+ pack .files_window.scroll -side right -fill both
+ pack .files_window.list -side left -fill both -expand yes
bind .files_window.list <Any-ButtonRelease-1> {
set file [%W get [%W curselection]]
gdb_cmd "list $file:1,0"