public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "nash11228 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51770] New: dump gimple lineno when dumping bb Date: Thu, 05 Jan 2012 20:07:00 -0000 [thread overview] Message-ID: <bug-51770-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51770 Bug #: 51770 Summary: dump gimple lineno when dumping bb Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned@gcc.gnu.org ReportedBy: nash11228@gmail.com Hi all, I know gcc can dump lineno information before each gimple statement. [filename : line:col] gimple statement. But it's not convenient to look, too much lineno's and no alignment again. how about dump lineno at bb level just before gimple statement when lineno changes ? # line 11 gs1 gs2 ... # line 12 ... just like dwarf debugging information format. here is example code --- gimple-pretty-print.c (revision 182877) +++ gimple-pretty-print.c (working copy) @@ -2284,6 +2284,7 @@ gimple_stmt_iterator gsi; gimple stmt; int label_indent = indent - 2; + int lineno = 0; if (label_indent < 0) label_indent = 0; @@ -2299,6 +2300,15 @@ curr_indent = gimple_code (stmt) == GIMPLE_LABEL ? label_indent : indent; + if (gimple_lineno (stmt) != lineno) + { + lineno = gimple_lineno (stmt); + + INDENT (curr_indent); + pp_printf (buffer, "# line %d", lineno); + pp_newline (buffer); + } + INDENT (curr_indent); dump_gimple_stmt (buffer, stmt, curr_indent, flags); pp_newline (buffer);
next reply other threads:[~2012-01-05 20:07 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-01-05 20:07 nash11228 at gmail dot com [this message] 2012-01-09 12:22 ` [Bug middle-end/51770] " rguenth at gcc dot gnu.org 2021-08-30 22:54 ` pinskia at gcc dot gnu.org 2023-07-15 19:02 ` pinskia at gcc dot gnu.org
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-51770-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: linkBe 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).