gdbserver crash if the_target->supports_z_point_type is NULL
authorJoel Brobecker <brobecker@adacore.com>
Wed, 4 Jun 2014 18:03:22 +0000 (14:03 -0400)
committerJoel Brobecker <brobecker@adacore.com>
Wed, 4 Jun 2014 21:57:21 +0000 (17:57 -0400)
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.

gdb/ChangeLog
gdb/gdbserver/mem-break.c

index 1803f81c0be9993855d7854e9fbd4ba43c6245ea..7c436076ad81d4abc2e68b0a269630d0ded2e2ed 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-04  Joel Brobecker  <brobecker@adacorer.com>
+
+       PR server/17023
+       * mem-break.c (z_type_supported): Return zero if
+       THE_TARGET->SUPPORTS_Z_POINT_TYPE is NULL.
+
 2014-06-04  Tom Tromey  <tromey@redhat.com>
 
        * ada-lang.c (ada_template_to_fixed_record_type_1): Use
index 71876f728ea4eab93dcf45f0f149adc7dcba4ae8..2ce3ab2f9b6153b30845640dbf2b0a06e4c8e6c4 100644 (file)
@@ -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));
 }
 
This page took 0.029891 seconds and 4 git commands to generate.