Accepting request 757565 from devel:gcc

- Fix build with gcc 10 [bsc#1158539, swo#24653].
  * gdb-0001-remove-alloca-0-calls.patch (forwarded request 756824 from tomdevries)

OBS-URL: https://build.opensuse.org/request/show/757565
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=135
This commit is contained in:
Dominique Leuenberger 2019-12-24 13:29:20 +00:00 committed by Git OBS Bridge
commit 7b76151d8c
3 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,57 @@
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.
---
gdb/ChangeLog | 6 ++++++
gdb/regcache.c | 7 -------
gdb/top.c | 4 ----
3 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 6e3eee96631..323f0f5ab4e 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 b46de90f755..857207c3767 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)
{

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Dec 6 14:20:21 UTC 2019 - Tom de Vries <tdevries@suse.com>
- Fix build with gcc 10 [bsc#1158539, swo#24653].
* gdb-0001-remove-alloca-0-calls.patch
-------------------------------------------------------------------
Mon Nov 11 08:57:18 UTC 2019 - Ludwig Nussel <lnussel@suse.de>

View File

@ -247,6 +247,7 @@ Patch2008: gdb-testsuite-i386-pkru-exp.patch
Patch2009: gdb-s390-handle-arch13.diff
Patch2010: gdb-fix-heap-use-after-free-in-typename-concat.patch
Patch2011: gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch
Patch2012: gdb-0001-remove-alloca-0-calls.patch
# Proposed patch for PR symtab/24971
Patch2500: gdb-symtab-prefer-var-def-over-decl.patch
@ -599,6 +600,7 @@ find -name "*.info*"|xargs rm -f
%patch2009 -p1
%patch2010 -p1
%patch2011 -p1
%patch2012 -p1
%patch2500 -p1
%patch2501 -p1