public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix max-depth test case for AIX.
@ 2024-04-17 10:43 Ulrich Weigand
  0 siblings, 0 replies; only message in thread
From: Ulrich Weigand @ 2024-04-17 10:43 UTC (permalink / raw)
  To: gdb-cvs

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

commit 4d76c39f751dda04a386ca8ce5203e34bd0341fe
Author: Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>
Date:   Wed Apr 10 00:52:05 2024 -0500

    Fix max-depth test case for AIX.
    
    In AIX, if in the main program the global variables are unused then the linker optimises
    these variables and the dwarf will not have proper address to the same. Hence we cannot access these
    variables.
    
    This patch is a fix to the same so that all the test case of max-depth can passs in AIX as well.

Diff:
---
 gdb/testsuite/gdb.base/max-depth.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/testsuite/gdb.base/max-depth.c b/gdb/testsuite/gdb.base/max-depth.c
index fee5de5af34..7e46b134c10 100644
--- a/gdb/testsuite/gdb.base/max-depth.c
+++ b/gdb/testsuite/gdb.base/max-depth.c
@@ -225,8 +225,17 @@ struct V7 : virtual V4, virtual V5, virtual V6 { int v7 = 1; } v7;
 
 #endif /* __cplusplus */
 
+void Do_nothing (struct s1 sone)
+{
+  /*  This Function does nothing.  */
+}
+
 int
 main ()
 {
+  /*  In targets like AIX, linker optimises out unused global
+      variables.  The do_nothing () function stops the linker
+      from doing so.  */
+  Do_nothing (s1);
   return 0;
 }

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

only message in thread, other threads:[~2024-04-17 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 10:43 [binutils-gdb] Fix max-depth test case for AIX Ulrich Weigand

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).