all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: nickrob@snap.net.nz (Nick Roberts)
To: Michael Welsh Duggan <mwd@cert.org>, 4519@emacsbugs.donarmstrong.com
Cc: emacs-pretest-bug@gnu.org
Subject: bug#4519: 23.1.50; GDB MI problems: mi_cmd_stack_info_frame: No arguments required
Date: Wed, 23 Sep 2009 22:54:27 +1200	[thread overview]
Message-ID: <19129.65123.262702.16487@totara.tehura.co.nz> (raw)
In-Reply-To: <tntpr9jqc2w.fsf@maru.green.cert.org>

Michael Welsh Duggan writes:
 > Please describe exactly what actions triggered the bug
 > and the precise symptoms of the bug:
 > 
 > When running gdb via M-x gdb on some code of mine, I end up in a state
 > where it becomes no longer responsive to 'C-c C-s' or 'C-c C-n'
 > commands.
 > 
 > More specifically, I started running gdb by typing M-x gdb.  Arguments
 > were:
 > gdb -i=mi /home/mwd/bin/rwcut 
 > 
 > >From here I typed "start --python-file /tmp/foo.py --help", and then
 > stepped through my code using 'C-c C-s' and 'C-c C-n'.  At one point,
 > after 'C-c C-n', where a library was being dynamically loaded, I get the
 > following output in my *gdb-rwcut* buffer:
 > 
 > [Thread debugging using libthread_db enabled]
 > [New Thread 0xb7f786c0 (LWP 5633)]
 > (gdb) mi_cmd_stack_info_frame: No arguments required

Does the patch below fix the immediate problem?

You appear to be debugging a multi-threaded program with GDB 6.8.  The thread
buffer won't work in this case as it uses the MI -thread-info command which is
part of GDB 7.0.  This is due to be released in the next week or so.  Emacs
23.1 probably works better with GDB 6.8, at least for multi-threaded
applications.

-- 
Nick                                           http://users.snap.net.nz/~nickrob


*** gdb-mi.el.~1.49~	2009-09-18 15:10:58.000000000 +1200
--- gdb-mi.el	2009-09-23 22:53:36.000000000 +1200
*************** Emacs can't find.")
*** 218,223 ****
--- 218,224 ----
  (defvar gdb-source-window nil)
  (defvar gdb-inferior-status nil)
  (defvar gdb-continuation nil)
+ (defvar gdb-version nil)
  (defvar gdb-filter-output nil
    "Message to be shown in GUD console.
  
*************** If NOALL is t, always add --thread optio
*** 571,579 ****
  When `gdb-non-stop' is nil, return COMMAND unchanged."
    (if gdb-non-stop
        (if (and gdb-gud-control-all-threads
!                (not noall))
            (concat command " --all ")
!         (gdb-current-context-command command t))
      command))
  
  (defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
--- 572,581 ----
  When `gdb-non-stop' is nil, return COMMAND unchanged."
    (if gdb-non-stop
        (if (and gdb-gud-control-all-threads
!                (not noall)
! 	       (string-equal gdb-version "7.0+"))
            (concat command " --all ")
!         (gdb-current-context-command command))
      command))
  
  (defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
*************** detailed description of this mode.
*** 820,826 ****
    (if (re-search-forward "No symbol" nil t)
        (progn
  	(message "This version of GDB doesn't support non-stop mode.  Turning it off.")
! 	(setq gdb-non-stop nil))
      (gdb-input (list "-gdb-set target-async 1" 'ignore))
      (gdb-input (list "-enable-pretty-printing" 'ignore))))
  
--- 822,830 ----
    (if (re-search-forward "No symbol" nil t)
        (progn
  	(message "This version of GDB doesn't support non-stop mode.  Turning it off.")
! 	(setq gdb-non-stop nil)
! 	(setq gdb-version "pre-7.0"))
!     (setq gdb-version "7.0+")
      (gdb-input (list "-gdb-set target-async 1" 'ignore))
      (gdb-input (list "-enable-pretty-printing" 'ignore))))
  
*************** static char *magick[] = {
*** 1629,1644 ****
  		       (concat (car item) "\n")))
  
  ;; NOFRAME is used for gud execution control commands
! (defun gdb-current-context-command (command &optional noframe)
!   "Add --thread and --frame options to gdb COMMAND.
! 
! Option values are taken from `gdb-thread-number' and
! `gdb-frame-number'. If `gdb-thread-number' is nil, COMMAND is
! returned unchanged. If `gdb-frame-number' is nil of NOFRAME is t,
! then no --frame option is added."
!   ;; gdb-frame-number may be nil while gdb-thread-number is non-nil
!   ;; (when current thread is running)
!   (if gdb-thread-number
        (concat command " --thread " gdb-thread-number)
      command))
  
--- 1633,1642 ----
  		       (concat (car item) "\n")))
  
  ;; NOFRAME is used for gud execution control commands
! (defun gdb-current-context-command (command)
!   "Add --thread to gdb COMMAND when needed."
!   (if (and gdb-thread-number
! 	   (string-equal gdb-version "7.0+"))
        (concat command " --thread " gdb-thread-number)
      command))
  
*************** current thread and update GDB buffers."
*** 1920,1926 ****
      ;; thread
      (when (not gdb-register-names)
        (gdb-input
!        (list (concat "-data-list-register-names --thread " thread-id)
               'gdb-register-names-handler)))
  
  ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler
--- 1918,1926 ----
      ;; thread
      (when (not gdb-register-names)
        (gdb-input
!        (list (concat "-data-list-register-names" 
! 		     (if (string-equal gdb-version "7.0+")
! 			 (concat" --thread " thread-id)))
               'gdb-register-names-handler)))
  
  ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler
*************** corresponding to the mode line clicked."
*** 2565,2571 ****
   "Display GDB threads in a new frame.")
  
  (def-gdb-trigger-and-handler
!   gdb-invalidate-threads (gdb-current-context-command "-thread-info" gud-running)
    gdb-thread-list-handler gdb-thread-list-handler-custom
    '(start update update-threads))
  
--- 2565,2571 ----
   "Display GDB threads in a new frame.")
  
  (def-gdb-trigger-and-handler
!   gdb-invalidate-threads (gdb-current-context-command "-thread-info")
    gdb-thread-list-handler gdb-thread-list-handler-custom
    '(start update update-threads))
  





  reply	other threads:[~2009-09-23 10:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 14:38 bug#4519: 23.1.50; GDB MI problems: mi_cmd_stack_info_frame: No arguments required Michael Welsh Duggan
2009-09-23 10:54 ` Nick Roberts [this message]
2009-09-23 16:45   ` Michael Welsh Duggan
2009-09-23 23:25     ` Nick Roberts

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19129.65123.262702.16487@totara.tehura.co.nz \
    --to=nickrob@snap.net.nz \
    --cc=4519@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=mwd@cert.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.