public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Gaius Mulley <gaiusmod2@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: [PATCH] Additional modula2 tests.
Date: Wed, 16 Mar 2022 12:29:08 +0000	[thread overview]
Message-ID: <875yoe13or.fsf_-_@debian> (raw)
In-Reply-To: <20220217220547.3874030-17-tom@tromey.com> (Tom Tromey's message of "Thu, 17 Feb 2022 15:05:44 -0700")

[-- Attachment #1: Type: text/plain, Size: 3588 bytes --]

Tom Tromey <tom@tromey.com> writes:

> This changes the Modula-2 code to use generic_emit_char and
> generic_printstr.  I have no way to test this.

Hi Tom and gdb developers,

here is a proposed patch for gdb and some new files which enable testing
of binaries generated from Modula-2 source files.  breakpointm2 and
printformatted are included as a start.  These patches and new files
have been tested against the gdb git repro of Tue Mar 15 08:53:27 2022
and no new failures occur after the patches have been applied and new
files added.  It was tested on a Debian Bullseye amd64 machine with
regular packages (gcc-10 and gm2-10 etc).


2022-03-16  Gaius Mulley  <gaiusmod2@gmail.com>

	Adding some modula-2 test cases and the tcl infastructure to
	support modula-2.

	* configure.ac (GM2_FOR_BUILD): Added.  (GM2_FOR_TARGET): Added.
	* gdb/testsuite/lib/gdb.exp (skip_modula2_tests): New function.
	* gdb/testsuite/lib/modula2.exp: New file.
	* gdb/testsuite/gdb.modula2/breakpointm2.mod: New file.
	* gdb/testsuite/gdb.modula2/breakpointm2.exp: New file.
	* gdb/testsuite/gdb.modula2/printformattedm2.exp: New file.
	* gdb/testsuite/gdb.modula2/printformattedm2.mod: New file.


diff --git a/configure.ac b/configure.ac
index da4e41d7247..351d3f9655b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1270,6 +1270,7 @@ if test "${build}" != "${host}" ; then
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
   CXX_FOR_BUILD=${CXX_FOR_BUILD-g++}
   GFORTRAN_FOR_BUILD=${GFORTRAN_FOR_BUILD-gfortran}
+  GM2_FOR_BUILD=${GM2_FOR_BUILD-gccm2}
   GOC_FOR_BUILD=${GOC_FOR_BUILD-gccgo}
   DLLTOOL_FOR_BUILD=${DLLTOOL_FOR_BUILD-dlltool}
   LD_FOR_BUILD=${LD_FOR_BUILD-ld}
@@ -1283,6 +1284,7 @@ else
   CC_FOR_BUILD="\$(CC)"
   CXX_FOR_BUILD="\$(CXX)"
   GFORTRAN_FOR_BUILD="\$(GFORTRAN)"
+  GM2_FOR_BUILD="\$(GM2)"
   GOC_FOR_BUILD="\$(GOC)"
   DLLTOOL_FOR_BUILD="\$(DLLTOOL)"
   LD_FOR_BUILD="\$(LD)"
@@ -3374,6 +3376,7 @@ AC_SUBST(CXXFLAGS_FOR_BUILD)
 AC_SUBST(CXX_FOR_BUILD)
 AC_SUBST(DLLTOOL_FOR_BUILD)
 AC_SUBST(GFORTRAN_FOR_BUILD)
+AC_SUBST(GM2_FOR_BUILD)
 AC_SUBST(GOC_FOR_BUILD)
 AC_SUBST(LDFLAGS_FOR_BUILD)
 AC_SUBST(LD_FOR_BUILD)
@@ -3501,6 +3504,7 @@ NCN_STRICT_CHECK_TARGET_TOOLS(CC_FOR_TARGET, cc gcc)
 NCN_STRICT_CHECK_TARGET_TOOLS(CXX_FOR_TARGET, c++ g++ cxx gxx)
 NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
 NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
+NCN_STRICT_CHECK_TARGET_TOOLS(GM2_FOR_TARGET, gccm2)
 NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
 
 ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
@@ -3533,6 +3537,8 @@ GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
 GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
 GCC_TARGET_TOOL(gfortran, GFORTRAN_FOR_TARGET, GFORTRAN,
 		[gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/], fortran)
+GCC_TARGET_TOOL(gccm2, GM2_FOR_TARGET, GM2,
+		[gcc/gm2 -B$$r/$(HOST_SUBDIR)/gcc/], modula-2)
 GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
 		[gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index a35d08a05de..e368a0dfccb 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2295,6 +2295,12 @@ proc skip_d_tests {} {
     return 0
 }
 
+# Return a 1 if I don't even want to try to test Modula2.
+
+proc skip_modula2_tests {} {
+    return 0
+}
+
 # Return 1 to skip Rust tests, 0 to try them.
 proc skip_rust_tests {} {
     if { ![isnative] } {


new Modula-2 source tests and associated tcl driver scripts:


[-- Attachment #2: breakpointm2 and printformattedm2 --]
[-- Type: application/gzip, Size: 2785 bytes --]

[-- Attachment #3: Type: text/plain, Size: 16 bytes --]


regards,
Gaius

  parent reply	other threads:[~2022-03-16 12:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 22:05 [PATCH v2 00/18] Refactor character printing Tom Tromey
2022-02-17 22:05 ` [PATCH v2 01/18] Fix latent quote char bug in generic_printstr Tom Tromey
2022-02-17 22:05 ` [PATCH v2 02/18] Boolify need_escape in generic_emit_char Tom Tromey
2022-02-17 22:05 ` [PATCH v2 03/18] Remove c_emit_char Tom Tromey
2022-02-17 22:05 ` [PATCH v2 04/18] Remove c_printstr Tom Tromey
2022-02-17 22:05 ` [PATCH v2 05/18] Don't use wchar_printable in print_wchar Tom Tromey
2022-02-22 15:36   ` Andrew Burgess
2022-10-10 16:39     ` Tom Tromey
2022-02-17 22:05 ` [PATCH v2 06/18] Fix a latent bug " Tom Tromey
2022-02-17 22:05 ` [PATCH v2 07/18] Remove language_defn::emitchar Tom Tromey
2022-02-17 22:05 ` [PATCH v2 08/18] Add gdb_iswcntrl Tom Tromey
2022-02-17 22:05 ` [PATCH v2 09/18] Include \0 in printable wide characters Tom Tromey
2022-02-23 13:49   ` Andrew Burgess
2022-02-23 22:28     ` Tom Tromey
2022-02-23 23:59       ` Tom Tromey
2022-02-17 22:05 ` [PATCH v2 10/18] Use a ui_file in print_wchar Tom Tromey
2022-02-17 22:05 ` [PATCH v2 11/18] Add an emitter callback to generic_printstr and generic_emit_char Tom Tromey
2022-02-17 22:05 ` [PATCH v2 12/18] Add a default encoding to generic_emit_char and generic_printstr Tom Tromey
2022-02-17 22:05 ` [PATCH v2 13/18] Change generic_emit_char to print the quotes Tom Tromey
2022-02-17 22:05 ` [PATCH v2 14/18] Use generic_emit_char in Rust Tom Tromey
2022-02-17 22:05 ` [PATCH v2 15/18] Use generic_emit_char in Ada Tom Tromey
2022-02-17 22:05 ` [PATCH v2 16/18] Use generic_emit_char in Modula-2 Tom Tromey
2022-02-23 20:17   ` Gaius Mulley
2022-03-16 12:29   ` Gaius Mulley [this message]
2022-04-07 14:21     ` [PATCH] Additional modula2 tests Tom Tromey
2022-04-09 23:16       ` Gaius Mulley
2022-04-11 19:45   ` [PATCH v1] Array access in Modula-2 Gaius Mulley
2022-02-17 22:05 ` [PATCH v2 17/18] Use generic_emit_char in Pascal Tom Tromey
2022-02-17 22:05 ` [PATCH v2 18/18] Simplify Fortran string printing Tom Tromey
2022-10-10 17:37 ` [PATCH v2 00/18] Refactor character printing Tom Tromey

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=875yoe13or.fsf_-_@debian \
    --to=gaiusmod2@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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).