This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Prints the frame id when target stops


 > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]