public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "filip.bascarevic at siemens dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/99649] New: GDB has issue to show backtrace if the breakpoint is in a function with more then 8 parameters only in target aarch64-elf ILP32
Date: Thu, 18 Mar 2021 15:57:23 +0000	[thread overview]
Message-ID: <bug-99649-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99649

            Bug ID: 99649
           Summary: GDB has issue to show backtrace if the breakpoint is
                    in a function with more then 8 parameters only in
                    target aarch64-elf ILP32
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: filip.bascarevic at siemens dot com
  Target Milestone: ---
              Host: x86_64-w64-mingw32
            Target: aarch64-elf ilp32

Created attachment 50422
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50422&action=edit
This is a small example that demonstrates the bug. Content is just start.c
start.S and start.lk and also scripts which will help you build the example.
This example doesn't contain any include.

Dear GCC team,

the Siemens developers noticed one issue in a GCC 10.2 and we don't know how to
deal with it. It occurs only for an aarch64 ilp32 target. Generally when we put
a breakpoint into function with more the 8 arguments then GDB has a problem
showing backtrace. To be exact, the last function is shown in an endless loop
unless GDB is forced to quit or the backtrace limit is set.  

I’ve created a small example to reproduce this problem with Qemu (4.1) and GCC
10.2 toolchain. Inside the package, there is a ‘readme.txt’ file with
instructions on how to build, start Qemu and GDB (with GDB commands) to
demonstrate the problem. The interesting fact is that if you use LP64 ABI than
this problem does not occur. Because it is working on LP64, I don't think the
issue is in the GDB.

NOTES:
1. This example is compiled on Windows 10 using aarch64_elf compiler for
Windows. It contains only one simple .c and one .S file. To successfully
compile it please change a PATH of the toolchain and QEMU directory at the
beginning of the script build_and_run_qemu.cmd.
2. Also update a path of the GDB at the beginning of the run_gdb.cmd script.
3. As I mentioned above, we compiled that example with aarch64_elf compiler on
Windows 10. Because this ILP32 target is really specific, we built our
toolchain with MinGW using this command: 

$SRCDIR/configure --host=x86_64-w64-mingw32  --build=x86_64-w64-mingw32 
--prefix=$prefix --target=aarch64-elf --disable-nls --enable-multilib
--with-multilib-list=lp64,ilp32 --enable-languages=c,c++
--disable-decimal-float --with-sysroot=$prefix --without-headers
--disable-shared --disable-threads --disable-lto --disable-libmudflap
--disable-libssp --disable-libgomp --disable-libffi --disable-libstdcxx-pch
--disable-win32-registry '--with-host-libstdcxx=-static-libgcc
-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-newlib --with-gcc --with-gnu-as
--with-gnu-ld --with-gmp=$prefixlocal --with-mpfr=$prefixlocal
--with-mpc=$prefixlocal --with-isl=$prefixlocal --with-zstd=$prefixlocal ||
return $ECONFIGURE

Please let me know if I can assist any further. I am so sorry because I didn't
upload the preprocessed file (*.i*) because this is not a common bug and for my
understanding test example is more useful in this case.

With best regards,
MSc. Filip Bascarevic

Siemens, s.r.o.
ADV D EU CZ AE AC 4
Anglicke nabrezi 2434/1
301 00 Plzen, Czech Republic 
filip.bascarevic@siemens.com

             reply	other threads:[~2021-03-18 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 15:57 filip.bascarevic at siemens dot com [this message]
2021-03-18 16:04 ` [Bug c/99649] GDB has issue to show backtrace if the breakpoint is in a function with more then 8 parameters - only for " pinskia at gcc dot gnu.org
2021-03-18 16:23 ` filip.bascarevic at siemens dot com
2021-03-19  7:41 ` [Bug target/99649] " rguenth at gcc dot gnu.org
2021-03-22 13:40 ` filip.bascarevic at siemens dot com
2021-05-07  7:28 ` stanislav.simek at siemens dot com
2021-05-07  7:43 ` stanislav.simek at siemens dot com
2021-05-14  7:46 ` stanislav.simek at siemens dot com

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=bug-99649-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).