From: David Malcolm <dmalcolm@redhat.com>
To: Petter Tomner <tomner@kth.se>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
"jit@gcc.gnu.org" <jit@gcc.gnu.org>
Subject: Re: [PATCH] jit : Generate debug info for variables
Date: Thu, 02 Sep 2021 11:08:26 -0400 [thread overview]
Message-ID: <175ff404ebdbb82ea24385209be83c3793da44cd.camel@redhat.com> (raw)
In-Reply-To: <005bad3cb21745d591cea63567d08d08@kth.se>
On Tue, 2021-08-31 at 00:13 +0000, Petter Tomner via Gcc-patches wrote:
> Hi,
>
> This is a patch to generate debug info for local variables as well as
> globals.
> With this, "ptype foo", "info variables", "info locals" etc works
> when debugging in GDB.
>
> Finalizing of global variable declares are moved to after locations
> are handled and done
> as Fortran, C, Go etc do it. Also, primitive types have their
> TYPE_NAME set for debug info
> on types to work.
>
> Below are the patch, and I attached a testcase. Since it requires GDB
> to run it might
> not be suitable? Make check-jit runs fine on Debian x64.
Thanks for the patches. Overall, looks good, but I have some review
nits...
Reviewing patch 1 in this email...
> From d77e77104024c7ae9ce31b419dad1f0a5801fda7 Mon Sep 17 00:00:00
> 2001
> From: Petter Tomner <tomner@kth.se>
> Date: Mon, 30 Aug 2021 01:44:07 +0200
> Subject: [PATCH 1/2] libgccjit: Generate debug info for variables
>
> Finalize declares via available helpers after location is set. Set
> TYPE_NAME of primitives and friends to "int" etc. Debug info is now
> set properly for variables.
>
> 2021-08-31 Petter Tomner <tomner@kth.se>
>
> gcc/jit
> jit-playback.c
> jit-playback.h
> gcc/testsuite/jit.dg/
> test-error-array-bounds.c: Array is not unsigned
Can you write non-empty ChangeLog entries please.
[...snip...]
> --- a/gcc/jit/jit-playback.c
> +++ b/gcc/jit/jit-playback.c
[...snip...]
> @@ -2984,15 +2975,22 @@ replay ()
> {
> int i;
> function *func;
> -
> + tree global;
> /* No GC can happen yet; process the cached source locations.
> */
> handle_locations ();
>
> + /* Finalize globals. See how FORTRAN 95 does it in
> gfc_be_parse_file()
> + for a simple reference. */
> + FOR_EACH_VEC_ELT (m_globals, i, global)
> + rest_of_decl_compilation (global, true, true);
> +
> + wrapup_global_declarations (m_globals.address(),
> m_globals.length());
> +
> /* We've now created tree nodes for the stmts in the various
> blocks
> - in each function, but we haven't built each function's
> single stmt
> - list yet. Do so now. */
> + in each function, but we haven't built each function's
> single stmt
> + list yet. Do so now. */
> FOR_EACH_VEC_ELT (m_functions, i, func)
> - func->build_stmt_list ();
> + func->build_stmt_list ();
Looks like some whitespace churn above; did your text editor
accidentally convert tabs to spaces? I prefer to avoid changes that
touch lines without changing things, as it messes up e.g. "git blame".
In case you haven't discovered it yet, "git add -p" is very helpful for
just staging individual hunks within a changed file.
[...snip...]
...plus some comments about the testcase which I'll post in reply to
the other patch.
Dave
prev parent reply other threads:[~2021-09-02 15:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 0:13 Petter Tomner
2021-08-31 0:23 ` Sv: " Petter Tomner
2021-09-02 15:20 ` David Malcolm
2021-09-02 21:54 ` Sv: " Petter Tomner
2021-09-02 15:08 ` David Malcolm [this message]
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=175ff404ebdbb82ea24385209be83c3793da44cd.camel@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jit@gcc.gnu.org \
--cc=tomner@kth.se \
/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).