public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gccrs: add selftest-rust-gdb and selftest-rust-valgrind "make" targets
@ 2022-12-16 17:01 David Malcolm
  2023-01-02 12:48 ` Arthur Cohen
  0 siblings, 1 reply; 2+ messages in thread
From: David Malcolm @ 2022-12-16 17:01 UTC (permalink / raw)
  To: gcc-patches, Arthur Cohen; +Cc: David Malcolm

Add "make" targets to make it easy to run the rust selftests under gdb
and under valgrind via:
  make selftest-rust-gdb
and
  make selftest-rust-valgrind
respectively, similar to analogous "make" targets in the C and C++
frontends.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.

OK for trunk?

gcc/rust/ChangeLog:
	* Make-lang.in (selftest-rust-gdb): New.
	(selftest-rust-valgrind): New.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
 gcc/rust/Make-lang.in | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 681ac7b3fee..76015b3426b 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -275,6 +275,18 @@ s-selftest-rust: $(RUST_SELFTEST_DEPS)
 	$(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS)
 	$(STAMP) $@
 
+# Convenience methods for running rust selftests under gdb:
+.PHONY: selftest-rust-gdb
+selftest-rust-gdb: $(RUST_SELFTEST_DEPS)
+	$(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) \
+	  -wrapper gdb,--args
+
+# Convenience methods for running rust selftests under valgrind:
+.PHONY: selftest-rust-valgrind
+selftest-rust-valgrind: $(RUST_SELFTEST_DEPS)
+	$(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) \
+	  -wrapper valgrind,--leak-check=full
+
 # Install info documentation for the front end, if it is present in the source directory. This target
 # should have dependencies on info files that should be installed.
 rust.install-info:
-- 
2.26.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gccrs: add selftest-rust-gdb and selftest-rust-valgrind "make" targets
  2022-12-16 17:01 [PATCH] gccrs: add selftest-rust-gdb and selftest-rust-valgrind "make" targets David Malcolm
@ 2023-01-02 12:48 ` Arthur Cohen
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Cohen @ 2023-01-02 12:48 UTC (permalink / raw)
  To: David Malcolm, gcc-patches


[-- Attachment #1.1.1: Type: text/plain, Size: 1950 bytes --]

Hi David,

On 12/16/22 18:01, David Malcolm wrote:
> Add "make" targets to make it easy to run the rust selftests under gdb
> and under valgrind via:
>    make selftest-rust-gdb
> and
>    make selftest-rust-valgrind
> respectively, similar to analogous "make" targets in the C and C++
> frontends.
> 
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> 
> OK for trunk?
> 
> gcc/rust/ChangeLog:
> 	* Make-lang.in (selftest-rust-gdb): New.
> 	(selftest-rust-valgrind): New.
> 
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
> ---
>   gcc/rust/Make-lang.in | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
> index 681ac7b3fee..76015b3426b 100644
> --- a/gcc/rust/Make-lang.in
> +++ b/gcc/rust/Make-lang.in
> @@ -275,6 +275,18 @@ s-selftest-rust: $(RUST_SELFTEST_DEPS)
>   	$(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS)
>   	$(STAMP) $@
>   
> +# Convenience methods for running rust selftests under gdb:
> +.PHONY: selftest-rust-gdb
> +selftest-rust-gdb: $(RUST_SELFTEST_DEPS)
> +	$(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) \
> +	  -wrapper gdb,--args
> +
> +# Convenience methods for running rust selftests under valgrind:
> +.PHONY: selftest-rust-valgrind
> +selftest-rust-valgrind: $(RUST_SELFTEST_DEPS)
> +	$(GCC_FOR_TARGET) $(RUST_SELFTEST_FLAGS) \
> +	  -wrapper valgrind,--leak-check=full
> +
>   # Install info documentation for the front end, if it is present in the source directory. This target
>   # should have dependencies on info files that should be installed.
>   rust.install-info:

OK for trunk :) Thanks again!

-- 
Arthur Cohen <arthur.cohen@embecosm.com>

Toolchain Engineer

Embecosm GmbH

Geschäftsführer: Jeremy Bennett
Niederlassung: Nürnberg
Handelsregister: HR-B 36368
www.embecosm.de

Fürther Str. 27
90429 Nürnberg


Tel.: 091 - 128 707 040
Fax: 091 - 128 707 077

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3195 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-02 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 17:01 [PATCH] gccrs: add selftest-rust-gdb and selftest-rust-valgrind "make" targets David Malcolm
2023-01-02 12:48 ` Arthur Cohen

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