help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: emacs gdb layout


From: Ritchie
Subject: Re: emacs gdb layout
Date: Mon, 19 Jan 2009 18:42:23 -0800 (PST)
User-agent: G2/1.0

> After start gdb inside emacs with option "--annotation=3 --fullname",

Sorry, that was a typo, what I had in my .emacs originally was
(setq gud-gdb-command-name "gdb --annotate=3 --fullname")
which I think is correct.

The version I'm using is Carbon Emacs  (emacs 22)

> I suggest uou read the debuggers section of the Emacs manual.

I read the manual, but it didn't work out very well. The manual says
"If gdb-many-windows is non-nil, then M-x gdb displays the following
frame layout "

but when I have the following lines in my .emacs:

(setq gdb-many-windows t)
(setq gdb-use-separate-io-buffer t)

and run M-x gdb, i still just get the simple layout. I have to bring
out the default
frame layout by giving another two M-x gdb-many-windows. The first one
is to
disable it, the second one is to enable it again, and then the frame
layout will
show up. So I just remove the (setq gdb-many-windows t) from .emacs,
and
run it manually everytime after I start gdb.

my problem is that in those buffers, locals, stack, breakpoints, there
is nothing
displayed as I run the program in gdb. In the manual, it just tells
you how to use
the buffer, e.g. click on a variable in local buffer to change the
value, but in mine,
it doesn't display any local variables, even if there is in the code.
Here is the screenshot:

http://cs655-1.ias.csusb.edu:8080/~zcai/layout.png

I'm not sure if it is normal but it would be nice if I could get it to
work like yours.

http://users.snap.net.nz/~nickrob/multi-threaded.png

Did you give any commands for those buffers to display the contents?

And by the way, here is my configuration for gdb in my .emacs :

;; ===================================================================
;; Add color to the current GUD line (obrigado google)
;; ===================================================================

(defvar gud-overlay
  (let* ((ov (make-overlay (point-min) (point-min))))
    (overlay-put ov 'face 'secondary-selection)
    ov)
  "Overlay variable for GUD highlighting.")

(defadvice gud-display-line (after my-gud-highlight act)
           "Highlight current line."
           (let* ((ov gud-overlay)
                  (bf (gud-find-file true-file)))
             (save-excursion
                 (set-buffer bf)
                   (move-overlay ov (line-beginning-position) (line-
end-position)
                                   (current-buffer)))))

(defun gud-kill-buffer ()
  (if (eq major-mode 'gud-mode)
    (delete-overlay gud-overlay)))

(add-hook 'kill-buffer-hook 'gud-kill-buffer)


;; =================================
;; GDB configuration
;; =================================

(require 'gud)
(require 'gdb-ui)
(setq gud-gdb-command-name "gdb --annotate=3 --fullname")
(setq gdb-many-windows t)
(setq gdb-use-separate-io-buffer t)

;;(add-hook 'gdb-mode-hook '(lambda () (require 'gdb-highlight)))

(add-hook 'gud-mode-hook
          '(lambda ()
            (local-set-key [home]        ; move to beginning of line,
after prompt
             'comint-bol)
            (local-set-key [up]          ; cycle backward through
command history
             '(lambda () (interactive)
               (if (comint-after-pmark-p)
                   (comint-previous-input 1)
                   (previous-line 1))))
            (local-set-key [down]        ; cycle forward through
command history
             '(lambda () (interactive)
               (if (comint-after-pmark-p)
                   (comint-next-input 1)
                   (forward-line 1))))
            ))


Thank you

- R


reply via email to

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