You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/08 10:02:49 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #5692: libc/stdio: Fix bug when CONFIG_LIBC_NUMBERED_ARGS is enabled
xiaoxiang781216 opened a new pull request #5692:
URL: https://github.com/apache/incubator-nuttx/pull/5692
## Summary
- libc/stdio: Add _s suffix for struct arg in lib_libvsprintf.c
- libc/stdio: Skip fetch double argument if !CONFIG_LIBC_FLOATINGPOINT && CONFIG_LIBC_NUMBERED_ARG
- libc/stdio: Don't fetch width/prec modifier in parser phase
- libc/stdio: Make %p[V|S|s] work with CONFIG_LIBC_NUMBERED_ARGS
- boards/sim/nsh: Enable ONFIG_LIBC_NUMBERED_ARGS and ONFIG_SCHED_BACKTRACE
## Impact
printf series function with CONFIG_LIBC_NUMBERED_ARGS == y
## Testing
sim:nsh
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5692: libc/stdio: Fix bug when CONFIG_LIBC_NUMBERED_ARGS is enabled
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5692:
URL: https://github.com/apache/incubator-nuttx/pull/5692#discussion_r821584212
##########
File path: libs/libc/stdio/lib_libvsprintf.c
##########
@@ -1176,6 +1123,60 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
break;
case 'p':
+ c = fmt_char(fmt);
+ switch (c)
+ {
+ case 'V':
+ {
+ FAR struct va_format *vaf = (FAR void *)x;
Review comment:
Why not? x will be unsigned long long in most arch, it's enough to contain all possible pointer value.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5692: libc/stdio: Fix bug when CONFIG_LIBC_NUMBERED_ARGS is enabled
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #5692:
URL: https://github.com/apache/incubator-nuttx/pull/5692#discussion_r821529830
##########
File path: libs/libc/stdio/lib_libvsprintf.c
##########
@@ -1176,6 +1123,60 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
break;
case 'p':
+ c = fmt_char(fmt);
+ switch (c)
+ {
+ case 'V':
+ {
+ FAR struct va_format *vaf = (FAR void *)x;
+#ifdef va_copy
+ va_list copy;
+
+ va_copy(copy, *vaf->va);
+ lib_vsprintf(stream, vaf->fmt, copy);
+ va_end(copy);
+#else
+ lib_vsprintf(stream, vaf->fmt, *vaf->va);
+#endif
+ continue;
+ }
+
+#ifdef CONFIG_ALLSYMS
+ case 'S':
+ case 's':
+ {
+ FAR const struct symtab_s *symbol;
+ FAR void *addr = (FAR void *)x;
+ size_t symbolsize;
+
+ symbol = allsyms_findbyvalue(addr, &symbolsize);
+ if (symbol)
Review comment:
Done.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5692: libc/stdio: Fix bug when CONFIG_LIBC_NUMBERED_ARGS is enabled
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5692:
URL: https://github.com/apache/incubator-nuttx/pull/5692#discussion_r821576382
##########
File path: libs/libc/stdio/lib_libvsprintf.c
##########
@@ -1176,6 +1123,60 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
break;
case 'p':
+ c = fmt_char(fmt);
+ switch (c)
+ {
+ case 'V':
+ {
+ FAR struct va_format *vaf = (FAR void *)x;
Review comment:
I see
```
#ifndef CONFIG_LIBC_LONG_LONG
unsigned long x;
#else
unsigned long long x;
```
So the question is: Is `unsigned long` is capable to carry full pointer value?
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5692: libc/stdio: Fix bug when CONFIG_LIBC_NUMBERED_ARGS is enabled
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5692:
URL: https://github.com/apache/incubator-nuttx/pull/5692#discussion_r821511394
##########
File path: libs/libc/stdio/lib_libvsprintf.c
##########
@@ -1176,6 +1123,60 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
break;
case 'p':
+ c = fmt_char(fmt);
+ switch (c)
+ {
+ case 'V':
+ {
+ FAR struct va_format *vaf = (FAR void *)x;
+#ifdef va_copy
+ va_list copy;
+
+ va_copy(copy, *vaf->va);
+ lib_vsprintf(stream, vaf->fmt, copy);
+ va_end(copy);
+#else
+ lib_vsprintf(stream, vaf->fmt, *vaf->va);
+#endif
+ continue;
+ }
+
+#ifdef CONFIG_ALLSYMS
+ case 'S':
+ case 's':
+ {
+ FAR const struct symtab_s *symbol;
+ FAR void *addr = (FAR void *)x;
+ size_t symbolsize;
+
+ symbol = allsyms_findbyvalue(addr, &symbolsize);
+ if (symbol)
Review comment:
```suggestion
if (symbol != NULL)
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis merged pull request #5692: libc/stdio: Fix bug when CONFIG_LIBC_NUMBERED_ARGS is enabled
Posted by GitBox <gi...@apache.org>.
acassis merged pull request #5692:
URL: https://github.com/apache/incubator-nuttx/pull/5692
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org