emacs-devel
[Top][All Lists]
Advanced

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

Re: Extend gdb to filter registers


From: martin rudalics
Subject: Re: Extend gdb to filter registers
Date: Sun, 19 Jan 2020 19:05:33 +0100

> So you are saying that calling gdb-display-source-buffer instead of
> display-buffer will not by itself help here, because display-buffer is
> called under the hood anyway, and might decide to create a new window
> instead of reusing an existing one?

So far I've been talking only about the display functions in gdb-mi.el
and that in principle all of them can call 'display-buffer'.  But I
don't know what really happens on your system and that of Yuan Fu.  The
interactions betwen gdb-mi.el and gud.el are too complicated for me to
tell from here.

One way to find out is to remember the name of the file (or buffer) gdb
will try to trace, and instrument 'display-buffer' such that when it is
asked to display that file it will print a backtrace like the following:

  display-buffer(#<buffer window.c> (nil (inhibit-same-window . t)))
  gud-display-line("/home/martin/emacs-git/trunk/src/window.c" 5158)
  gud-display-frame()
  gdb-frame-handler()
  gdb-handle-reply(96)
  gdb-done-or-error("96" done 
"frame={level=\"0\",addr=\"0x00000000005b581d\",func=\"F..." t)
  gdb-done("96" "frame={level=\"0\",addr=\"0x00000000005b581d\",func=\"F..." t)
  gdbmi-bnf-incomplete-record-result("96" (gdb-done . progressive))
  #f(compiled-function () #<bytecode 0x1e0c1a7de807>)()
  gdbmi-bnf-result-and-async-record-impl()
  gdbmi-bnf-async-record()
  gdbmi-bnf-out-of-band-record()
  gdbmi-bnf-output()
  
gud-gdbmi-marker-filter("96^done,frame={level=\"0\",addr=\"0x00000000005b581d\"...")
  apply(gud-gdbmi-marker-filter 
"96^done,frame={level=\"0\",addr=\"0x00000000005b581d\"...")
  gud-marker-filter("96^done,frame={level=\"0\",addr=\"0x00000000005b581d\"...")
  gud-filter(#<process gud-emacs> 
"96^done,frame={level=\"0\",addr=\"0x00000000005b581d\"...")

As you can see, 'gdb-frame-handler' calls 'gud-display-frame' which will
eventually display window.c according to the rules for 'display-buffer'.

> If so, what would be the correct solution of this issue?

The 'display-buffer' call indicated above could be modified using the
'debug' approach I sketched in my first posting here.  Whether this
suffices to handle all of Yuan's cases is beyond my knowledge.

martin



reply via email to

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