[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, master, updated. 0b59be74188529bcb0aa347
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, master, updated. 0b59be74188529bcb0aa3476fee51a525b365391 |
Date: |
Fri, 01 Mar 2013 09:15:59 +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 0b59be74188529bcb0aa3476fee51a525b365391 (commit)
from 491e95a1d22995973e9d62719d321a623ed22e07 (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=0b59be74188529bcb0aa3476fee51a525b365391
commit 0b59be74188529bcb0aa3476fee51a525b365391
Author: Arnold D. Robbins <address@hidden>
Date: Fri Mar 1 11:15:20 2013 +0200
Add @load to profile/pretty printed output.
diff --git a/ChangeLog b/ChangeLog
index 65b5757..256c52f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-02-28 Arnold D. Robbins <address@hidden>
+
+ Cause profiling / pretty printing to include a list of
+ loaded extensions. Thanks to Hermann Peifer for the bug report.
+
+ * awk.h (srcfiles): Add declaration.
+ * profile.c (print_lib_list): New function.
+ (dump_prog): Call it.
+
2013-02-26 Arnold D. Robbins <address@hidden>
* parse.y (expression_list): In case of error return the list
diff --git a/awk.h b/awk.h
index f26ec20..989f451 100644
--- a/awk.h
+++ b/awk.h
@@ -1065,6 +1065,8 @@ extern bool field0_valid;
extern int do_flags;
+extern SRCFILE *srcfiles; /* source files */
+
enum do_flag_values {
DO_LINT_INVALID = 0x0001, /* only warn about invalid */
DO_LINT_ALL = 0x0002, /* warn about all things */
diff --git a/profile.c b/profile.c
index c3dea0e..4764fe0 100644
--- a/profile.c
+++ b/profile.c
@@ -927,6 +927,27 @@ dump_and_exit(int signum)
final_exit(EXIT_FAILURE);
}
+/* print_lib_list --- print a list of all libraries loaded */
+
+static void
+print_lib_list(FILE *prof_fp)
+{
+ SRCFILE *s;
+ static bool printed_header = false;
+
+
+ for (s = srcfiles->next; s != srcfiles; s = s->next) {
+ if (s->stype == SRC_EXTLIB) {
+ if (! printed_header) {
+ printed_header = true;
+ fprintf(prof_fp, _("\t# Loaded extensions (-l
and/or @load)\n\n"));
+ }
+ fprintf(prof_fp, "address@hidden \"%s\"\n", s->src);
+ }
+ }
+ if (printed_header) /* we found some */
+ printf("\n");
+}
/* dump_prog --- dump the program */
@@ -943,6 +964,7 @@ dump_prog(INSTRUCTION *code)
(void) time(& now);
/* \n on purpose, with \n in ctime() output */
fprintf(prof_fp, _("\t# gawk profile, created %s\n"), ctime(& now));
+ print_lib_list(prof_fp);
pprint(code, NULL, false);
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
awk.h | 2 ++
profile.c | 22 ++++++++++++++++++++++
3 files changed, 33 insertions(+), 0 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, master, updated. 0b59be74188529bcb0aa3476fee51a525b365391,
Arnold Robbins <=