From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>
Subject: [RFA] gdbserver crash if the_target->supports_z_point_type is NULL
Date: Wed, 04 Jun 2014 18:17:00 -0000 [thread overview]
Message-ID: <1401905805-22408-1-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <538F5E3A.8010507@redhat.com>
Hello,
When debugging on LynxOS targets (and probably on SPU targets as well),
inserting a breakpoint and resuming the program's execution causes
GDBserver to crash.
The crash occurs while handling the Z0 packet sent by GDB to insert
our breakpoint, because z_type_supported calls
the_target->supports_z_point_type without checking that it is not NULL
This patch fixes the issue by making z_type_supported return false if
the_target->supports_z_point_type is NULL.
gdb/gdbserver/ChangeLog:
PR server/17023
* mem-break.c (z_type_supported): Return zero if
THE_TARGET->SUPPORTS_Z_POINT_TYPE is NULL.
Tested on ppx-lynx5. I haven't tested on GNU/Linux, but I feel
sufficiently confident since supports_z_point_type is defined there,
and I am eager to take a look at Windows next. But I can do it
if people think it would be best. OK to push?
Thanks,
--
Joel
---
gdb/gdbserver/mem-break.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 71876f7..2ce3ab2 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -897,6 +897,7 @@ static int
z_type_supported (char z_type)
{
return (z_type >= '0' && z_type <= '4'
+ && the_target->supports_z_point_type != NULL
&& the_target->supports_z_point_type (z_type));
}
--
1.7.9.5
next prev parent reply other threads:[~2014-06-04 18:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 17:18 gdb-7.8 branching status (2014-06-04) Joel Brobecker
2014-06-04 17:35 ` Pedro Alves
2014-06-04 17:46 ` Joel Brobecker
2014-06-04 17:54 ` Pedro Alves
2014-06-04 17:58 ` Pedro Alves
2014-06-04 18:17 ` Joel Brobecker [this message]
2014-06-04 20:09 ` [RFA] gdbserver crash if the_target->supports_z_point_type is NULL Pedro Alves
2014-06-04 22:21 ` pushed: " Joel Brobecker
2014-06-04 18:20 ` gdb-7.8 branching status (2014-06-04) Joel Brobecker
2014-06-05 13:58 ` Pedro Alves
2014-06-05 14:15 ` Keith Seitz
2014-06-05 14:39 ` Keith Seitz
2014-06-05 21:49 ` Joel Brobecker
2014-06-04 18:41 ` Keith Seitz
2014-06-04 22:23 ` Joel Brobecker
2014-06-05 17:26 ` Doug Evans
2014-06-04 23:03 ` Joel Brobecker
2014-06-05 21:03 ` Joel Brobecker
2014-06-06 16:30 ` Pedro Alves
2014-06-05 21:47 ` Joel Brobecker
2014-06-05 14:40 ` Yao Qi
2014-06-05 16:07 ` Pedro Alves
2014-06-05 21:50 ` Joel Brobecker
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=1401905805-22408-1-git-send-email-brobecker@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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