diff options
author | Fernando Nasser <fnasser@redhat.com> | 2000-08-10 15:55:06 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@redhat.com> | 2000-08-10 15:55:06 +0000 |
commit | f40aad5a342d6931c8bd7e6be5fb85bdeab6e18b (patch) | |
tree | df2226fce06abca53bb4231fdc39d92c71b1cb44 /gdb | |
parent | 0d636f6314da9a98da0f765a2ca56d50755e2b01 (diff) | |
download | gdb-f40aad5a342d6931c8bd7e6be5fb85bdeab6e18b.tar.gz |
2000-08-10 Fernando Nasser <fnasser@cygnus.com>
* srctextwin.itb (jump_to_here): New method. Implements the
"Jump to Here" popup menu option.
(build_popups): Add the "Jump to Here" option to the popup menu.
* srctextwin.ith: Add declaration of jump_to_here().
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbtk/library/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbtk/library/srctextwin.itb | 52 | ||||
-rw-r--r-- | gdb/gdbtk/library/srctextwin.ith | 1 |
3 files changed, 60 insertions, 0 deletions
diff --git a/gdb/gdbtk/library/ChangeLog b/gdb/gdbtk/library/ChangeLog index 65e9e7ce2db..2f12c1d9a30 100644 --- a/gdb/gdbtk/library/ChangeLog +++ b/gdb/gdbtk/library/ChangeLog @@ -1,3 +1,10 @@ +2000-08-10 Fernando Nasser <fnasser@cygnus.com> + + * srctextwin.itb (jump_to_here): New method. Implements the + "Jump to Here" popup menu option. + (build_popups): Add the "Jump to Here" option to the popup menu. + * srctextwin.ith: Add declaration of jump_to_here(). + 2000-08-09 Fernando Nasser <fnasser@cygnus.com> * srctxtwin.itb (FillSource): Add comments. diff --git a/gdb/gdbtk/library/srctextwin.itb b/gdb/gdbtk/library/srctextwin.itb index b6a94244af8..e4471268d28 100644 --- a/gdb/gdbtk/library/srctextwin.itb +++ b/gdb/gdbtk/library/srctextwin.itb @@ -189,6 +189,8 @@ body SrcTextWin::build_popups {} { addPopup break_rgn "Continue to Here" "$this continue_to_here" \ [pref get gdb/src/PC_TAG] 0 0 + addPopup break_rgn "Jump to Here" "$this jump_to_here" \ + [pref get gdb/src/PC_TAG] 0 0 $popups(break_rgn) add separator addPopup break_rgn "Set Breakpoint" "$this set_bp_at_line" $bp_fg @@ -216,6 +218,7 @@ body SrcTextWin::build_popups {} { if {!$Browsing && [pref get gdb/control_target]} { addPopup bp "Continue to Here" "$this continue_to_here" {} 0 0 + addPopup bp "Jump to Here" "$this jump_to_here" {} 0 0 $popups(bp) add separator } @@ -236,6 +239,7 @@ body SrcTextWin::build_popups {} { if {[pref get gdb/control_target]} { addPopup tp "Continue to Here" "$this continue_to_here" green 0 0 + addPopup bp "Jump to Here" "$this jump_to_here" {} 0 0 # $popups(tp) add separator # Currently you cannot set a tracepoint and a breakpoint at the same line... @@ -268,6 +272,8 @@ body SrcTextWin::build_popups {} { if {!$Browsing && [pref get gdb/control_target]} { addPopup bp_and_tp "Continue to Here" "$this continue_to_here" \ green 0 0 + addPopup bp "Jump to Here" "$this jump_to_here" \ + green 0 0 $popups(bp_and_tp) add separator } @@ -1697,6 +1703,52 @@ body SrcTextWin::continue_to_here {{win {}} {y -1} {threads -1}} { } # ------------------------------------------------------------------ +# METHOD: jump_to_here - Advance to the line pointed to by the +# y coordinate in the window win. If win is {} or y is -1, the values +# saved in the popups array are used. +# +# The threads parameter is not currently used. +# ------------------------------------------------------------------ +body SrcTextWin::jump_to_here {{win {}} {y -1} {threads -1}} { + + # Look up the line... This foreach is an lassign... + foreach {name line addr type set_cmd} [lookup_line $win $y] { + break + } + + # Unfortunately we cant set the pc to a linespec and we have to do a + # trick with a temporary breakpoint and the jump command. + # FIXME: Get the address from the linespec. + # FIXME: Even in the case we do have an address, I was not able to just + # change the PC and get things updated wright. While I work on that, + # I will use the temp breakpoint and jump trick for that case as well. + + set dont_change_appearance 1 + + foreach i [gdb_get_breakpoint_list] { + set enabled($i) [lindex [gdb_get_breakpoint_info $i] 5] + } + gdb_cmd "disable" + + if {$type == "asm"} { + gdb_immediate "tbreak *$addr" + gdb_immediate "jump *$addr" + } else { + eval $set_cmd temp $threads + gdb_immediate "jump $name:$line" + } + gdb_cmd "enable" + foreach i [gdb_get_breakpoint_list] { + if {![info exists enabled($i)]} { + gdb_cmd "delete $i" + } elseif {!$enabled($i)} { + gdb_cmd "disable $i" + } + } + set dont_change_appearance 0 +} + +# ------------------------------------------------------------------ # METHOD: set_bp_at_line - called when an empty break tag is clicked on # # When "threads" is set it means to set a bp on each thread in the list. diff --git a/gdb/gdbtk/library/srctextwin.ith b/gdb/gdbtk/library/srctextwin.ith index d9f57dfc8fb..acca6b0d15d 100644 --- a/gdb/gdbtk/library/srctextwin.ith +++ b/gdb/gdbtk/library/srctextwin.ith @@ -58,6 +58,7 @@ class SrcTextWin { method report_source_location {} method lookup_line {win y} method continue_to_here {{win {}} {y -1} {threads -1}} + method jump_to_here {{win {}} {y -1} {threads -1}} method set_bp_at_line {{type N} {win {}} {y -1} {threads "-1"}} method remove_bp_at_line {{win {}} {y -1}} method set_tp_at_line {{win {}} {y -1}} |