Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Denis PILAT <denis.pilat@st.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC] Prints the frame id when target stops
Date: Mon, 15 Jan 2007 21:37:00 -0000	[thread overview]
Message-ID: <17835.62476.374968.62992@kahikatea.snap.net.nz> (raw)
In-Reply-To: <45AB9A7F.1090502@st.com>

 > We are optimizing the usage of MI commands into our Eclipse based UI.
 > In some cases, it could take a while (and sometime more!) to refresh the 
 > thread list and the stack frame, and Eclipse does it very often.
 > 
 > We'd like to avoid refreshing the thread and the frame view when the 
 > user perform a step (or a next) and when the program stops in the same 
 > thread and in the same frame.
 > In the stop reason we got the current thread id, but we are missing 
 > something to identify the frame.
 > That patch lets gdb emits on the MI output a string that could be used 
 > to easily identify the current frame.



  frame_id_str = xstrprintf ("%s,%s,%s",
                             ^^^^^^^^^^

"%x,%x,%x" ?  (Except this would break when paddr returned 0, so it
needs a bit more detail).

(this_frame_id.stack_addr_p ? paddr (this_frame_id.stack_addr) : "!stack"),
                                                                   ^^^^^^
(this_frame_id.code_addr_p ? paddr (this_frame_id.code_addr) : "!code"),
                                                                 ^^^^^
(this_frame_id.special_addr_p ? paddr (this_frame_id.special_addr) : "!special"
                                                                      ^^^^^^^^
"false" ?

Why not include it in the frame field e.g

*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048520",id="0xbfd4e620,0x08048509,!special",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbf8a5854"}],file="myprog.c",fullname="/home/nickrob/myprog.c",line="79"}

Or even

*stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048520",id={stack="0xbfd4e620,code=0x08048509,special="false"},func="main",args=[{name="argc",value="1"},{name="argv",value="0xbf8a5854"}],file="myprog.c",fullname="/home/nickrob/myprog.c",line="79"}

If this field is included in other output e.g -stack-info-frame, then maybe
a separate function would be a good idea.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


  reply	other threads:[~2007-01-15 21:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 16:21 Denis PILAT
2007-01-15 21:37 ` Nick Roberts [this message]
2007-01-15 23:11   ` Nick Roberts
2007-01-15 23:49     ` Nick Roberts
2007-01-17  8:26       ` Denis PILAT
2007-01-16 16:20 ` Vladimir Prus
2007-01-16 21:12   ` Nick Roberts
2007-01-16 23:38     ` Vladimir Prus
2007-01-17  6:18       ` Daniel Jacobowitz
2007-01-17 21:46         ` Vladimir Prus
2007-01-20 17:02           ` Daniel Jacobowitz
2007-01-17 21:29       ` Mark Kettenis
2007-01-17 21:38         ` Vladimir Prus
2007-01-17 21:59           ` Frédéric Riss
2007-01-17 22:14             ` Vladimir Prus
2007-01-18  8:00               ` Frederic RISS
2007-01-17 22:17             ` Daniel Jacobowitz
2007-01-18  7:58               ` Frederic RISS
2007-01-18 18:34                 ` Jim Blandy
2007-01-19 14:28                   ` Denis PILAT
2007-01-20 17:00                     ` Daniel Jacobowitz
2007-01-18 19:59                 ` Daniel Jacobowitz
2007-01-17  6:19     ` Daniel Jacobowitz
2007-01-18 21:13       ` 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=17835.62476.374968.62992@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=denis.pilat@st.com \
    --cc=gdb-patches@sourceware.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox