Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: trivial segfault fix in tui
@ 2012-08-12 16:13 Hal Ashburner
  2012-08-14 10:55 ` Abid, Hafiz
  0 siblings, 1 reply; 6+ messages in thread
From: Hal Ashburner @ 2012-08-12 16:13 UTC (permalink / raw)
  To: gdb-patches

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

Hello!

I hope this is the correct etiquette and that it's useful. Copyright
assigned to whoever commits to assign to GNU or do whatever is
appropriate (assuming it is committed).

To the easiest way to replicate the segfault:
gdb some_prog
b main
run
C-x a
C-x 2
C-x 2
C-x 2 -- so you now have registers on the top panel and source in the middle.
resize the terminal.
step,
segfault

Regards,
Hal

[-- Attachment #2: gdbtui_segfault.patch --]
[-- Type: application/octet-stream, Size: 825 bytes --]

diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 9ba9b1d..0c94aed 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -334,11 +334,13 @@ tui_show_symtab_source (struct gdbarch *gdbarch, struct symtab *s,
 int
 tui_source_is_displayed (char *fname)
 {
-  return (TUI_SRC_WIN->generic.content_in_use 
-	  && (filename_cmp (((struct tui_win_element *)
-			     (tui_locator_win_info_ptr ())->
-			     content[0])->which_element.locator.file_name,
-			    fname) == 0));
+  if (tui_locator_win_info_ptr()->content)
+      return (TUI_SRC_WIN->generic.content_in_use 
+          && (filename_cmp (((struct tui_win_element *)
+                     (tui_locator_win_info_ptr ())->
+                     content[0])->which_element.locator.file_name,
+                    fname) == 0));
+  return 0;
 }
 
 

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

end of thread, other threads:[~2012-08-27 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-12 16:13 [PATCH] gdb: trivial segfault fix in tui Hal Ashburner
2012-08-14 10:55 ` Abid, Hafiz
2012-08-14 23:03   ` Hal Ashburner
2012-08-15  0:34     ` Doug Evans
2012-08-16  1:50       ` Hal Ashburner
2012-08-27 17:06         ` Doug Evans

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