[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch to gud.el: feature to relocate next instruction under gdb

From: Benjamin Rutt
Subject: patch to gud.el: feature to relocate next instruction under gdb
Date: Sun, 09 Dec 2001 12:16:02 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (sparc-sun-solaris2.6)

Attached is a patch to gud.el against yesterday's CVS.  It adds a
feature for running gdb under emacs.

The feature is best described by example.  Let's say you have the
following C code:


and let's say your gud arrow (pretend the arrow isn't in the fringe
like it is in emacs 21.1) looks as follows:


Sometimes you wish you could go back in time and run f1() again.  With
the following patch, you can visit the source code buffer, position
point to the f1() line, type C-x C-a C-j, and the arrow will move:


This is just one example of how useful this feature can be.  It is
implemented as a temporary breakpoint followed by a jump.  It is much
easier than typing those two statements in manually with line numbers.

Could someone please consider this patch?  I offered an almost
identical patch via M-x report-emacs-bug this past summer but I didn't
get any response at all, so I am trying this list.  For my post this
past summer, I had written Changelog and info patches.  I can recreate
those and send them here on a followup if I am told that this patch
will be considered.  Or, if this is the wrong place to send this, then
could someone direct me to the right place?  Thank you.

*** gud.el.~1.149.~     Tue Sep 11 14:28:22 2001
--- gud.el      Sun Dec  9 00:40:22 2001
*** 409,414 ****
--- 409,415 ----
    (gud-def gud-up     "up %p"        "<" "Up N stack frames (numeric arg).")
    (gud-def gud-down   "down %p"      ">" "Down N stack frames (numeric arg).")
    (gud-def gud-print  "print %e"     "\C-p" "Evaluate C expression at point.")
+   (gud-def gud-jump   "tbreak %f:%l\njump %f:%l" "\C-j" "Relocate next 
instruction to line at point in source buffer.")
    (local-set-key "\C-i" 'gud-gdb-complete-command)
    (local-set-key [menu-bar debug tbreak] '("Temporary Breakpoint" . 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]