public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: use -gdwarf-4 in simavr board
@ 2021-04-16 15:02 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2021-04-16 15:02 UTC (permalink / raw)
  To: gdb-cvs

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

commit 321d0cd7e78d6133cb0c607526c1f1fb380424ae
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Fri Apr 16 11:01:26 2021 -0400

    gdb/testsuite: use -gdwarf-4 in simavr board
    
    By default, when using the -g switch, avr-gcc generates stabs debug
    information.  I think it would make more sense to test GDB against DWARF
    information, because stabs is obsolete by now, and nobody work on it.
    So change the simavr board to pass -gdwarf-4 as the debug flag.
    
    The downside is that users are probably more likely to use just -g, so
    we don't test GDB the same way as users are likely to use it.  But in
    this case, if somebody comes and asks for help with GDB for AVR, I
    suggest we encourage them to use -gdwarf-4.
    
    I can't give stats about how that changes test results, because the
    testsuite is too broken.  There is an internal error that happens quite
    frequently that needs to be investigated:
    
        /home/simark/src/wt/avr/gdb/trad-frame.h:143: internal-error: LONGEST trad_frame_saved_reg::addr() const: Assertion `m_kind == trad_frame_saved_reg_kind::ADDR' failed.
    
    I sent a question on the gcc mailing list, asking why stabs is the
    default:
    
        https://gcc.gnu.org/pipermail/gcc/2021-April/235309.html
    
    gdb/testsuite/ChangeLog:
    
            * boards/simavr.exp: Set debug_flags.
    
    Change-Id: I70e471fad3a79ab1d79d13dda8436bb9eb666e0a

Diff:
---
 gdb/testsuite/ChangeLog         | 4 ++++
 gdb/testsuite/boards/simavr.exp | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9e490aaf8b3..212f2ae0c5b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2021-04-16  Simon Marchi  <simon.marchi@efficios.com>
+
+	* boards/simavr.exp: Set debug_flags.
+
 2021-04-16  Luis Machado  <luis.machado@linaro.org>
 
 	* gdb.dwarf2/dw2-bfloat16.exp: New file.
diff --git a/gdb/testsuite/boards/simavr.exp b/gdb/testsuite/boards/simavr.exp
index c4f278ccb12..06177330aa0 100644
--- a/gdb/testsuite/boards/simavr.exp
+++ b/gdb/testsuite/boards/simavr.exp
@@ -44,6 +44,10 @@ set_board_info c++compiler avr-g++
 set_board_info cflags "-mmcu=${simavr_mcu}"
 set_board_info ldflags "-mmcu=${simavr_mcu}"
 
+# As of version 10, GCC produces stabs by default for AVR.  Force it to use
+# DWARF.
+set_board_info debug_flags "-gdwarf-4"
+
 set_board_info use_gdb_stub 1
 set_board_info gdb_protocol "remote"
 set_board_info gdb,do_reload_on_run 1


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

only message in thread, other threads:[~2021-04-16 15:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 15:02 [binutils-gdb] gdb/testsuite: use -gdwarf-4 in simavr board Simon Marchi

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