public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ulrich Weigand <uweigand@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Fix max-depth test case for AIX.
Date: Wed, 17 Apr 2024 10:43:36 +0000 (GMT)	[thread overview]
Message-ID: <20240417104336.325E73858D20@sourceware.org> (raw)

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;
 }

                 reply	other threads:[~2024-04-17 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417104336.325E73858D20@sourceware.org \
    --to=uweigand@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).