From: Nick Roberts <nick@nick.uklinux.net>
Cc: emacs-devel@gnu.org
Subject: Re: gdba probs
Date: Wed, 11 Dec 2002 22:27:17 +0000 [thread overview]
Message-ID: <15863.48069.658013.465668@nick.uklinux.net> (raw)
In-Reply-To: <200212111411.gBBEBUn03805@rum.cs.yale.edu>
> I feel like it must be possible to have a single filter deal with both cases.
> The worst case would be to have a `gud-gdb-undecided-marker-filer' which
> would call either one of the two filters or could even replace itself with
> the appropriate filter once it has determined which case it's dealing with.
How about :
--- gud.el.~1.169.~ Wed Dec 11 18:41:06 2002
+++ gud.el Wed Dec 11 22:16:45 2002
@@ -85,6 +85,8 @@
(let ((sym (gud-symbol sym t minor-mode)))
(if (boundp sym) (symbol-value sym))))
+(defvar gud-first-time)
+
(defvar gud-running nil
"Non-nil if debuggee is running.
Used to grey out relevant toolbar icons.")
@@ -453,6 +455,7 @@
and source-file directory for your debugger."
(interactive (list (gud-query-cmdline 'gdb)))
+ (setq gud-first-time t)
(gud-common-init command-line nil 'gud-gdb-marker-filter)
(set (make-local-variable 'gud-minor-mode) 'gdb)
@@ -2344,6 +2347,42 @@
(defun gud-filter (proc string)
;; Here's where the actual buffer insertion is done
+ (when (and gud-first-time (string-match
+ "\n\032\032[a-z]" string))
+ (with-current-buffer gud-comint-buffer
+ (setq gud-minor-mode 'gdba)
+ (setq gud-marker-filter 'gdba-marker-filter)
+ (setq comint-input-sender 'gdb-send))
+ (gud-def gud-break (if (not (string-equal mode-name "Assembler"))
+ (gud-call "break %f:%l" arg)
+ (save-excursion
+ (beginning-of-line)
+ (forward-char 2)
+ (gud-call "break *%a" arg)))
+ "\C-b" "Set breakpoint at current line or address.")
+
+ (gud-def gud-remove (if (not (string-equal mode-name "Assembler"))
+ (gud-call "clear %f:%l" arg)
+ (save-excursion
+ (beginning-of-line)
+ (forward-char 2)
+ (gud-call "clear *%a" arg)))
+ "\C-d" "Remove breakpoint at current line or address.")
+
+ ;; (re-)initialise
+ (setq gdb-main-or-pc "main")
+ (setq gdb-current-address nil)
+ (setq gdb-display-in-progress nil)
+ (setq gdb-dive nil)
+
+ (gdb-make-instance)
+ (gdb-clear-inferior-io)
+
+ ;; find source file and compilation directory here
+ (gdb-instance-enqueue-idle-input (list "server list\n" 'ignore))
+ (gdb-instance-enqueue-idle-input (list "server info source\n"
+ 'gdb-source-info))
+ (setq gud-first-time nil))
(let (output process-window)
(if (buffer-name (process-buffer proc))
(if gud-filter-defer-flag
next prev parent reply other threads:[~2002-12-11 22:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-05 20:40 gdba probs Nick Roberts
2002-12-05 21:49 ` Stefan Monnier
2002-12-07 2:38 ` Nick Roberts
2002-12-07 3:10 ` Miles Bader
2002-12-09 15:46 ` Stefan Monnier
2002-12-10 14:19 ` Stefan Monnier
[not found] ` <15862.30022.647969.267154@nick.uklinux.net>
[not found] ` <200212111411.gBBEBUn03805@rum.cs.yale.edu>
2002-12-11 22:27 ` Nick Roberts [this message]
2002-12-11 22:48 ` Stefan Monnier
2002-12-12 0:05 ` Nick Roberts
2002-12-12 13:49 ` Stefan Monnier
2002-12-12 14:13 ` Miles Bader
2002-12-13 22:21 ` Richard Stallman
2002-12-12 1:24 ` Miles Bader
2002-12-12 10:22 ` Kim F. Storm
2002-12-15 0:36 ` Nick Roberts
2002-12-07 21:25 ` Richard Stallman
2002-12-08 1:55 ` Nick Roberts
2002-12-09 20:21 ` Richard Stallman
2002-12-10 21:39 ` Nick Roberts
2002-12-10 23:44 ` Kim F. Storm
2002-12-11 20:40 ` Richard Stallman
2002-12-08 2:27 ` Miles Bader
2002-12-10 14:14 ` Stefan Monnier
2002-12-11 17:45 ` Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2002-12-05 6:19 Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15863.48069.658013.465668@nick.uklinux.net \
--to=nick@nick.uklinux.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).