public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove alloca(0) calls
@ 2019-06-14 13:02 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-06-14 13:02 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=abdb711e0855f0597a96db0486b598144b788212

commit abdb711e0855f0597a96db0486b598144b788212
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Jun 11 06:59:38 2019 -0600

    Remove alloca(0) calls
    
    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.

Diff:
---
 gdb/ChangeLog  | 6 ++++++
 gdb/regcache.c | 7 -------
 gdb/top.c      | 4 ----
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 91f3b75..cc0e9fd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 6e3eee9..323f0f5 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -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
diff --git a/gdb/top.c b/gdb/top.c
index b46de90..857207c 100644
--- 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)
     {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-14 13:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 13:02 [binutils-gdb] Remove alloca(0) calls Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).