all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#10597: [PATCH] GUD-MI's disassembly buffer should follow $PC in the absence of debug information.
@ 2012-01-25  6:53 Kaushik Srenevasan
  2012-03-13  7:10 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Kaushik Srenevasan @ 2012-01-25  6:53 UTC (permalink / raw)
  To: 10597

[-- Attachment #1: Type: text/plain, Size: 788 bytes --]

Package: emacs
Tags: patch
Severity: wishlist

GUD-MI's disassembly buffer only works when the current frame has debug
information. While debugging dynamically generated code it'd be useful
to simply follow the program counter. I understand that newer GDBs
expose an API that lets a JIT compiler register debug information for
dynamically generated code, but JITs typically only do so for real
functions. So, having the disassembly buffer follow $PC would still be
useful while stepping through dynamically generated, shorter sequences
of code (like call stubs, inline caches etc.). 

The latest GDB (7.4.50.20120122-cvs) does this in its TUI mode while my
stable GDB's (7.0.1-debian) behavior is the same as Emacs 23 GUD.

Please review and merge.

         Thanks,
            -Kaushik

[-- Attachment #2: gdb-mi-disassembly-follow-pc.patch --]
[-- Type: text/x-patch, Size: 1663 bytes --]

=== modified file 'lisp/progmodes/gdb-mi.el'
--- lisp/progmodes/gdb-mi.el    2012-01-05 09:46:05 +0000
+++ lisp/progmodes/gdb-mi.el    2012-01-24 05:13:10 +0000
@@ -3259,8 +3259,12 @@
   (let* ((frame (gdb-current-buffer-frame))
          (file (bindat-get-field frame 'fullname))
          (line (bindat-get-field frame 'line)))
-    (when file
-      (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)))
+    (if file
+      (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)
+    ;; If we're unable to get a file name / line for $PC, simply
+    ;; follow $PC, disassembling the next 10 (x ~15 (on IA) ==
+    ;; 150 bytes) instructions.
+    "-data-disassemble -s $pc -e \"$pc + 150\" -- 0"))
   gdb-disassembly-handler
   ;; We update disassembly only after we have actual frame information
   ;; about all threads, so no there's `update' signal in this list
@@ -3319,8 +3323,12 @@
       (gdb-table-add-row table
                          (list
                           (bindat-get-field instr 'address)
-                          (apply #'format "<%s+%s>:"
-                                 (gdb-get-many-fields instr 'func-name 'offset))
+                          (let
+                              ((func-name (bindat-get-field instr 'func-name))
+                               (offset (bindat-get-field instr 'offset)))
+                            (if func-name
+                                (format "<%s+%s>:" func-name offset)
+                              ""))
                           (bindat-get-field instr 'inst)))
       (when (string-equal (bindat-get-field instr 'address)
                           address)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#10597: [PATCH] GUD-MI's disassembly buffer should follow $PC in the absence of debug information.
  2012-01-25  6:53 bug#10597: [PATCH] GUD-MI's disassembly buffer should follow $PC in the absence of debug information Kaushik Srenevasan
@ 2012-03-13  7:10 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2012-03-13  7:10 UTC (permalink / raw)
  To: 10597-done

Version: 24.0.95

Thanks; applied.
It would be great if you could also suggest ChangeLog entries for any
future changes.
Also, we'll need a copyright assignment to accept any further changes of
more than a few lines total from you. It's a straightforward procedure.
Let me know off-list if you want to, and I can send you the form.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-13  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-25  6:53 bug#10597: [PATCH] GUD-MI's disassembly buffer should follow $PC in the absence of debug information Kaushik Srenevasan
2012-03-13  7:10 ` Glenn Morris

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.