From: Hui Zhu <teawater@gmail.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: [PATCH] Fix gdb crash with tui
Date: Sat, 09 Mar 2013 14:14:00 -0000 [thread overview]
Message-ID: <CANFwon2Ko8+1eseqi4YS-xvD+b-YFvfAN1USz31eymd9WJT5hw@mail.gmail.com> (raw)
[-- 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");
}
next reply other threads:[~2013-03-09 14:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-09 14:14 Hui Zhu [this message]
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
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=CANFwon2Ko8+1eseqi4YS-xvD+b-YFvfAN1USz31eymd9WJT5hw@mail.gmail.com \
--to=teawater@gmail.com \
--cc=brobecker@adacore.com \
--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