Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix gdb crash with tui
@ 2013-03-09 14:14 Hui Zhu
  2013-03-11 19:25 ` Jan Kratochvil
  2013-03-12 18:36 ` Pedro Alves
  0 siblings, 2 replies; 20+ messages in thread
From: Hui Zhu @ 2013-03-09 14:14 UTC (permalink / raw)
  To: gdb-patches ml; +Cc: Joel Brobecker

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

Hi,

I got crash when I use tui.  The steps to reproduce is:
gdb gdb
b gdb_main
r
Ctrl-x A change to TUI mode.
Keep click <UP> some times.
Keep click <Down> some times.
Then you can get "---Type <return> to continue, or q <return> to quit---"
Click <return>.
Then the GDB crash.

I think this issue is this part should not output "---Type <return> to
continue, or q <return> to quit---".
So I make a patch to let tui doesn't output "file" just output "fullname".
Not sure is a good enough but this issue is fixed.

I suggest we fix this issue before next release because it will crash the GDB.

Thanks,
Hui

2013-03-09  Hui Zhu  <hui_zhu@mentor.com>

	* source.c (print_source_lines_base): Doesn't output "file".

[-- Attachment #2: fix-tui-crash.txt --]
[-- Type: text/plain, Size: 817 bytes --]

--- a/source.c
+++ b/source.c
@@ -1344,18 +1344,16 @@ print_source_lines_base (struct symtab *
 	{
 	  ui_out_field_int (uiout, "line", line);
 	  ui_out_text (uiout, "\tin ");
-	  ui_out_field_string (uiout, "file",
-			       symtab_to_filename_for_display (s));
 
 	  /* TUI expects the "fullname" field.  While it is
 	     !ui_out_is_mi_like_p compared to CLI it is !ui_source_list.  */
 	  if (ui_out_is_mi_like_p (uiout)
 	      || !ui_out_test_flags (uiout, ui_source_list))
-	    {
-	      const char *fullname = symtab_to_fullname (s);
+	    ui_out_field_string (uiout, "fullname", symtab_to_fullname (s));
+	  else
+	    ui_out_field_string (uiout, "file",
+				 symtab_to_filename_for_display (s));
 
-	      ui_out_field_string (uiout, "fullname", fullname);
-	    }
 	  ui_out_text (uiout, "\n");
 	}
 

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

end of thread, other threads:[~2013-03-14 14:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-09 14:14 [PATCH] Fix gdb crash with tui Hui Zhu
2013-03-11 19:25 ` Jan Kratochvil
2013-03-12  3:15   ` Hui Zhu
2013-03-12 12:22     ` Hui Zhu
2013-03-12 12:37       ` Jan Kratochvil
2013-03-12 13:21         ` Hui Zhu
2013-03-12 14:21           ` Hui Zhu
2013-03-12 16:04         ` Pedro Alves
2013-03-12 16:35           ` Pedro Alves
2013-03-12 18:36 ` Pedro Alves
2013-03-12 18:42   ` Pedro Alves
2013-03-13 18:55   ` [patch+7.6] [TUI] Fix scrolling missing '>' 7.6 regression [Re: [PATCH] Fix gdb crash with tui] Jan Kratochvil
2013-03-14  1:46     ` Hui Zhu
2013-03-14 12:53     ` Pedro Alves
2013-03-14 14:44       ` [commit+7.6] " Jan Kratochvil
2013-03-13 18:55   ` [patch+7.6] [TUI] Fix scrolling crash " Jan Kratochvil
2013-03-14  1:46     ` Hui Zhu
2013-03-14 12:33     ` Pedro Alves
2013-03-14 14:41       ` [commit+7.6] " Jan Kratochvil
2013-03-14 14:57         ` Pedro Alves

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