Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Prints the frame id when target stops
@ 2007-01-15 16:21 Denis PILAT
  2007-01-15 21:37 ` Nick Roberts
  2007-01-16 16:20 ` Vladimir Prus
  0 siblings, 2 replies; 24+ messages in thread
From: Denis PILAT @ 2007-01-15 16:21 UTC (permalink / raw)
  To: gdb-patches

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

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.
If you are ok with this approach then I'll update the testsuite.

-- 
Denis PILAT / STMicroelectronics



[-- Attachment #2: stack.c.patch --]
[-- Type: text/plain, Size: 1210 bytes --]

Index: stack.c
===================================================================
--- stack.c	(revision 549)
+++ stack.c	(working copy)
@@ -516,6 +516,8 @@ print_frame (struct frame_info *frame, i
   enum language funlang = language_unknown;
   struct ui_stream *stb;
   struct cleanup *old_chain, *list_chain;
+  struct frame_id this_frame_id;
+  char *frame_id_str = NULL;
 
   stb = ui_out_stream_new (uiout);
   old_chain = make_cleanup_ui_out_stream_delete (stb);
@@ -674,6 +676,16 @@ print_frame (struct frame_info *frame, i
 	}
     }
 
+  /* Print a string that represents the frame_id. This could be used by the UI
+     for comparison with the previous frame_id.  */
+  this_frame_id= get_frame_id (frame);
+  frame_id_str = xstrprintf ("%s,%s,%s",
+    (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"));
+  ui_out_field_string (uiout, "frame_id", frame_id_str);
+  xfree (frame_id_str);
+
   /* do_cleanups will call ui_out_tuple_end() for us.  */
   do_cleanups (list_chain);
   ui_out_text (uiout, "\n");

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

end of thread, other threads:[~2007-01-20 17:02 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-15 16:21 [RFC] Prints the frame id when target stops Denis PILAT
2007-01-15 21:37 ` Nick Roberts
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox