From: Hal Ashburner <hal@ashburner.info>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb: trivial segfault fix in tui
Date: Sun, 12 Aug 2012 16:13:00 -0000 [thread overview]
Message-ID: <CACCZV9amYBx-z+kizA3zCPsircaEBUckhv2tJQdc_oOsvMT=Mg@mail.gmail.com> (raw)
[-- 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;
}
next reply other threads:[~2012-08-12 16:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-12 16:13 Hal Ashburner [this message]
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
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='CACCZV9amYBx-z+kizA3zCPsircaEBUckhv2tJQdc_oOsvMT=Mg@mail.gmail.com' \
--to=hal@ashburner.info \
--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