diff options
author | Keith Seitz <keiths@redhat.com> | 2000-02-24 03:12:58 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2000-02-24 03:12:58 +0000 |
commit | c8c94f487a0f88f5bc5d8133668ed533de94f8e6 (patch) | |
tree | 142770ce6e548d2bcef54b07783db8f4d14cf069 /gdb | |
parent | 70038ea445159b1c76a8b63d6097bfbfb2c40e61 (diff) | |
download | gdb-c8c94f487a0f88f5bc5d8133668ed533de94f8e6.tar.gz |
* srctextwin.ith (_highlightAsmLine): Define new method.
* srctextwin.itb (_highlightAsmLine): New method.
(FillAssembly, FillMixed): Use _highlightAsmLine to highlight
the current assembly line.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbtk/library/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbtk/library/srctextwin.itb | 69 | ||||
-rw-r--r-- | gdb/gdbtk/library/srctextwin.ith | 1 |
3 files changed, 45 insertions, 32 deletions
diff --git a/gdb/gdbtk/library/ChangeLog b/gdb/gdbtk/library/ChangeLog index 8e0ae9e3b8b..b5ec4fe1225 100644 --- a/gdb/gdbtk/library/ChangeLog +++ b/gdb/gdbtk/library/ChangeLog @@ -1,3 +1,10 @@ +2000-02-23 Keith R Seitz <kseitz@nwlink.com> + + * srctextwin.ith (_highlightAsmLine): Define new method. + * srctextwin.itb (_highlightAsmLine): New method. + (FillAssembly, FillMixed): Use _highlightAsmLine to highlight + the current assembly line. + Fri Feb 4 23:19:03 2000 Andrew Cagney <cagney@b1.cygnus.com> * gdb/gdbtcl2: Directory renamed to gdb/gdbtk/library. diff --git a/gdb/gdbtk/library/srctextwin.itb b/gdb/gdbtk/library/srctextwin.itb index 5edb7a34e13..bc3f9b84d38 100644 --- a/gdb/gdbtk/library/srctextwin.itb +++ b/gdb/gdbtk/library/srctextwin.itb @@ -1006,24 +1006,8 @@ body SrcTextWin::FillAssembly {w tagname filename funcname line addr pc_addr lib } # highlight proper line number - if {[info exists _map($Cname,pc=$addr)]} { - # if current file has PC, highlight that too - if {$gdb_running && $tagname != "PC_TAG" && $pc(filename) == $filename - && $pc(func) == $funcname} { - set pc(asm_line) $_map($Cname,pc=$pc_addr) - $win tag add PC_TAG $pc(asm_line).2 $pc(asm_line).end - } - set current(asm_line) $_map($Cname,pc=$addr) - # don't set browse tag if it is at PC - if {$pc_addr != $addr || $tagname == "PC_TAG"} { - # HACK. In STACK mode we usually want the previous instruction - # but not when we are browsing a trace experiment. - if {[string compare $tagname "STACK_TAG"] == 0 && !$Browsing} { - incr current(asm_line) -1 - } - $win tag add $tagname $current(asm_line).2 $current(asm_line).end - } - } + _highlightAsmLine $win $addr $pc_addr $tagname + display_line $win $current(asm_line) } @@ -1079,25 +1063,46 @@ body SrcTextWin::FillMixed {w tagname filename funcname line addr pc_addr lib} { # now set the breakpoints set do_display_breaks 1 } + # highlight proper line number + _highlightAsmLine $win $addr $pc_addr $tagname + display_line $win $current(asm_line) +} + +# ------------------------------------------------------------------ +# METHOD: _highlightAsmLine - highlight the current execution line +# in one of the assembly modes +# ------------------------------------------------------------------ +body SrcTextWin::_highlightAsmLine {win addr pc_addr tagname} { + global gdb_running + + # Some architectures allow multiple instructions in each asm source + # line... if {[info exists _map($Cname,pc=$addr)]} { - # if current file has PC, highlight that too - if {$gdb_running && $tagname != "PC_TAG" && $pc(filename) == $filename - && $pc(func) == $funcname} { - set pc(asm_line) $_map($Cname,pc=$pc_addr) - $win tag add PC_TAG $pc(asm_line).2 $pc(asm_line).end - } set current(asm_line) $_map($Cname,pc=$addr) -# debug "current(asm_line) = $current(asm_line)" - if {$pc_addr != $addr || $tagname == "PC_TAG"} { - # HACK. In STACK mode we usually want the previous instruction - if {$tagname == "STACK_TAG"} { - incr current(asm_line) -1 - } - $win tag add $tagname $current(asm_line).2 $current(asm_line).end + } else { + set x [format "0x%x" [expr $current(addr)-2]] + if {[info exists _map($Cname,pc=$x)]} { + set current(asm_line) $_map($Cname,pc=$x) } } - display_line $win $current(asm_line) + + # if current file has PC, highlight that too + if {$gdb_running && $tagname != "PC_TAG" && $pc(filename) == $filename + && $pc(func) == $funcname} { + set pc(asm_line) $_map($Cname,pc=$pc_addr) + $win tag add PC_TAG $pc(asm_line).2 $pc(asm_line).end + } + + # don't set browse tag if it is at PC + if {$pc_addr != $addr || $tagname == "PC_TAG"} { + # HACK. In STACK mode we usually want the previous instruction + # but not when we are browsing a trace experiment. + if {[string compare $tagname "STACK_TAG"] == 0 && !$Browsing} { + incr current(asm_line) -1 + } + $win tag add $tagname $current(asm_line).2 $current(asm_line).end + } } # ------------------------------------------------------------------ diff --git a/gdb/gdbtk/library/srctextwin.ith b/gdb/gdbtk/library/srctextwin.ith index a9f2bfbb825..3dc7774c2ad 100644 --- a/gdb/gdbtk/library/srctextwin.ith +++ b/gdb/gdbtk/library/srctextwin.ith @@ -127,6 +127,7 @@ class SrcTextWin { method _mtime_changed {filename} method _initialize_srctextwin {} method _clear_cache {} + method _highlightAsmLine {win addr pc_addr tagname} {} proc makeBreakDot {size colorList {image {}}} } |