]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove alloca(0) calls
authorTom Tromey <tromey@adacore.com>
Tue, 11 Jun 2019 12:59:38 +0000 (06:59 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 14 Jun 2019 13:00:27 +0000 (07:00 -0600)
PR gdb/24653 points out that a gcc snapshot will complain about the
calls to alloca(0) in gdb.

These calls are only needed when using the C alloca.  I'm inclined to
think that no current platform needs this, so this patch removes the
calls.

Let me know what you think.

gdb/ChangeLog
2019-06-14  Tom Tromey  <tromey@adacore.com>

PR gdb/24653:
* regcache.c (registers_changed): Don't call alloca.
* top.c (execute_command): Don't call alloca.

gdb/ChangeLog
gdb/regcache.c
gdb/top.c

index 91f3b7549ab3276b2aa8623c9133952b9d4badc0..cc0e9fd1d07e3c9846171df7732f7ae37cff9ed8 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-14  Tom Tromey  <tromey@adacore.com>
+
+       PR gdb/24653:
+       * regcache.c (registers_changed): Don't call alloca.
+       * top.c (execute_command): Don't call alloca.
+
 2019-06-13  Pedro Alves  <palves@redhat.com>
 
        * cli/cli-setshow.c (cli/cli-setshow.c): New parameter
index 6e3eee96631e0a397eccb1605af1ffda6aa9af97..323f0f5ab4e2342cda2dfc5f618f90e062e77020 100644 (file)
@@ -454,13 +454,6 @@ void
 registers_changed (void)
 {
   registers_changed_ptid (minus_one_ptid);
-
-  /* Force cleanup of any alloca areas if using C alloca instead of
-     a builtin alloca.  This particular call is used to clean up
-     areas allocated by low level target code which may build up
-     during lengthy interactions between gdb and the target before
-     gdb gives control to the user (ie watchpoints).  */
-  alloca (0);
 }
 
 void
index b46de90f755cd9e33347d533c33a8643faa5d28c..857207c376735b8379bf3d705cb5399c2a977098 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -560,10 +560,6 @@ execute_command (const char *p, int from_tty)
   auto cleanup_if_error = make_scope_exit (bpstat_clear_actions);
   scoped_value_mark cleanup = prepare_execute_command ();
 
-  /* Force cleanup of any alloca areas if using C alloca instead of
-     a builtin alloca.  */
-  alloca (0);
-
   /* This can happen when command_line_input hits end of file.  */
   if (p == NULL)
     {