From 971951bc9e696fbf895978b864a45b2ddb56ba5b Mon Sep 17 00:00:00 2001 From: Andrzej Janik Date: Tue, 14 Dec 2021 00:02:23 +0100 Subject: Improve reporting of recovered unrecognized statement/directive --- zluda_dump/README.md | 4 +++- zluda_dump/src/trace.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'zluda_dump') diff --git a/zluda_dump/README.md b/zluda_dump/README.md index 52cecc8..1e7c03b 100644 --- a/zluda_dump/README.md +++ b/zluda_dump/README.md @@ -1 +1,3 @@ -sed 's/(.*//g' log.txt | sort | uniq > uniq.txt \ No newline at end of file +grep -E '^cu.*' log.txt | sed 's/(.*//g' | sort | uniq > uniq_host.txt +cat *.log | grep "^Unrecognized s" | grep -Eo '`([^`]*)`' | sed -E 's/^`([^[:space:]]*).*`/\1/' | sort | uniq > uniq_statements.txt +cat *.log | grep "^Unrecognized d" | grep -Eo '`([^`]*)`' | sed -E 's/^`([^`]*)`/\1/' | sort | uniq > uniq_directives.txt \ No newline at end of file diff --git a/zluda_dump/src/trace.rs b/zluda_dump/src/trace.rs index eac6bbd..2afc1c5 100644 --- a/zluda_dump/src/trace.rs +++ b/zluda_dump/src/trace.rs @@ -177,6 +177,7 @@ impl StateTracker { DumpWriter::get_file_name(module_index, version, submodule_index, "log"), )); fn_logger.log_io_error(self.writer.save_module_error_log( + module_text, module_index, version, submodule_index, @@ -230,6 +231,7 @@ impl DumpWriter { fn save_module_error_log<'input>( &self, + module_text: &str, module_index: usize, version: Option, submodule_index: Option, @@ -247,7 +249,7 @@ impl DumpWriter { )); let mut file = File::create(log_file)?; for error in errors { - let pretty_print_error = DisplayParseError("", error); + let pretty_print_error = unsafe { DisplayParseError::new(error, module_text) }; writeln!(file, "{}", pretty_print_error)?; } Ok(()) -- cgit v1.2.3