xiaoxiang781216 commented on code in PR #2859:
URL: https://github.com/apache/nuttx-apps/pull/2859#discussion_r1851555349
##########
system/gcov/gcov.c:
##########
@@ -69,6 +69,72 @@ static void gcov_dump(FAR const char * path, FAR const char
*strip)
__gcov_dump();
}
+/****************************************************************************
+ * Name: stdout_dump
+ ****************************************************************************/
+
+#ifndef CONFIG_COVERAGE_TOOLCHAIN
+static void stdout_dump(FAR const void *buffer, size_t size,
+ FAR void *arg)
+{
+ FAR const char *name = *((FAR const char **)arg);
+ struct lib_stdoutstream_s stdoutstream;
+ struct lib_hexdumpstream_s hexstream;
+ uint16_t checksum = 0;
+ int i;
+
+ if (size == 0)
+ {
+ return;
+ }
+
+ for (i = 0; i < size; i++)
+ {
+ checksum += ((FAR const uint8_t *)buffer)[i];
+ }
+
+ printf("gcov start filename:%s size: %zuByte\n", name, size);
Review Comment:
do you need put into lib_stdoutstream
##########
system/gcov/gcov.c:
##########
@@ -69,6 +69,72 @@ static void gcov_dump(FAR const char * path, FAR const char
*strip)
__gcov_dump();
}
+/****************************************************************************
+ * Name: stdout_dump
+ ****************************************************************************/
+
+#ifndef CONFIG_COVERAGE_TOOLCHAIN
+static void stdout_dump(FAR const void *buffer, size_t size,
+ FAR void *arg)
+{
+ FAR const char *name = *((FAR const char **)arg);
+ struct lib_stdoutstream_s stdoutstream;
+ struct lib_hexdumpstream_s hexstream;
+ uint16_t checksum = 0;
+ int i;
+
+ if (size == 0)
+ {
+ return;
+ }
+
+ for (i = 0; i < size; i++)
+ {
+ checksum += ((FAR const uint8_t *)buffer)[i];
+ }
+
+ printf("gcov start filename:%s size: %zuByte\n", name, size);
+ lib_stdoutstream(&stdoutstream, stdout);
Review Comment:
why need initialize stream each time? let's move to gcov_stdout_dump
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]