[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1679-gb8d9a7
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1679-gb8d9a73 |
Date: |
Wed, 02 Mar 2016 18:38:53 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, master has been updated
via b8d9a73257e1984eae80e61f0b751ddc4e9eab25 (commit)
via 460cfb34fd0e5189dfa83975c5ec5fdde7008cac (commit)
from 0ece3d6ee1fc718fda5b81c882d2c00d1636c62c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b8d9a73257e1984eae80e61f0b751ddc4e9eab25
commit b8d9a73257e1984eae80e61f0b751ddc4e9eab25
Author: Arnold D. Robbins <address@hidden>
Date: Wed Mar 2 20:35:59 2016 +0200
Additional prints in instruction dump.
diff --git a/ChangeLog b/ChangeLog
index 5c73d42..915bb79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-02 Arnold D. Robbins <address@hidden>
+
+ * debug.c (print_instruction): Add additional stuff for
+ Op_K_if and Op_K_else.
+
2016-03-01 Arnold D. Robbins <address@hidden>
* debug.c (print_instruction): For Op_comment, add notation as
diff --git a/profile.c b/profile.c
index 9e4a9b0..55bf42e 100644
--- a/profile.c
+++ b/profile.c
@@ -192,6 +192,22 @@ pp_free(NODE *n)
freenode(n);
}
+/* get_next_real_inst --- skip Op_comment */
+
+static INSTRUCTION *
+get_next_real_inst(INSTRUCTION *pc)
+{
+ if (pc == NULL)
+ return pc;
+
+ for (; pc != NULL && pc->opcode == Op_comment; pc = pc->nexti) {
+fprintf(stderr, "%s: opcode is %s\n", __func__, opcode2str(pc->opcode));
+ continue;
+ }
+
+ return pc;
+}
+
/* pprint --- pretty print a program segment */
static void
@@ -207,6 +223,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
char *tmp;
int rule;
static int rule_count[MAXRULE];
+ INSTRUCTION *next_real;
for (pc = startp; pc != endp; pc = pc->nexti) {
if (pc->source_line > 0)
@@ -742,8 +759,16 @@ cleanup:
t1 = pp_pop();
if (is_binary(t1->type))
pp_parenthesize(t1);
- if (pc->source_line > 0) /* don't print implicit
'return' at end of function */
- fprintf(prof_fp, "%s %s\n", op2str(pc->opcode),
t1->pp_str);
+ if (pc->source_line > 0) { /* don't print implicit
'return' at end of function */
+ if (pc->nexti->opcode != Op_comment ||
pc->nexti->memory->comment_type != EOL_COMMENT)
+ fprintf(prof_fp, "%s %s\n",
op2str(pc->opcode), t1->pp_str);
+ else {
+ fprintf(prof_fp, "%s %s",
op2str(pc->opcode), t1->pp_str);
+ // print the comment
+ print_comment(pc->nexti, 0);
+ pc = pc->nexti; /* skip it */
+ }
+ }
pp_free(t1);
break;
@@ -929,8 +954,9 @@ cleanup:
*/
fprintf(prof_fp, "} %s ", op2str(pc->opcode));
- if (pc->nexti->nexti->opcode == Op_K_if
- && pc->branch_end ==
pc->nexti->nexti->branch_else->lasti) {
+ next_real = get_next_real_inst(pc->nexti);
+ if (next_real->nexti->opcode == Op_K_if
+ && pc->branch_end ==
next_real->nexti->branch_else->nexti) {
pprint(pc->nexti, pc->branch_end, IN_ELSE_IF);
} else {
fprintf(prof_fp, "{\n");
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=460cfb34fd0e5189dfa83975c5ec5fdde7008cac
commit 460cfb34fd0e5189dfa83975c5ec5fdde7008cac
Author: Arnold D. Robbins <address@hidden>
Date: Tue Mar 1 22:16:27 2016 +0200
Improvements in debug output.
diff --git a/ChangeLog b/ChangeLog
index 16de7b9..5c73d42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-01 Arnold D. Robbins <address@hidden>
+
+ * debug.c (print_instruction): For Op_comment, add notation as
+ to whether it's a full comment or an end of line comment.
+
2016-02-29 Arnold D. Robbins <address@hidden>
* profile.c (pp_list): Handle the case of nargs equal to zero.
diff --git a/debug.c b/debug.c
index 01e30ee..574b303 100644
--- a/debug.c
+++ b/debug.c
@@ -3998,7 +3998,14 @@ print_instruction(INSTRUCTION *pc, Func_print
print_func, FILE *fp, int in_dump)
print_func(fp, " [do_reference = %s]\n",
pc->do_reference ? "true" : "false");
break;
-
+
+ case Op_comment:
+ print_memory(pc->memory, func, print_func, fp);
+ fprintf(fp, " {%s}\n",
+ pc->memory->comment_type == EOL_COMMENT ?
+ "eol" : "full");
+ break;
+
case Op_push_i:
case Op_push:
case Op_push_arg:
@@ -4016,7 +4023,6 @@ print_instruction(INSTRUCTION *pc, Func_print print_func,
FILE *fp, int in_dump)
case Op_quotient_i:
case Op_mod_i:
case Op_assign_concat:
- case Op_comment:
print_memory(pc->memory, func, print_func, fp);
/* fall through */
default:
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 10 ++++++++++
debug.c | 10 ++++++++--
profile.c | 34 ++++++++++++++++++++++++++++++----
3 files changed, 48 insertions(+), 6 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-1679-gb8d9a73,
Arnold Robbins <=