|
From: <sv...@va...> - 2014-10-25 20:10:38
|
Author: florian
Date: Sat Oct 25 21:10:30 2014
New Revision: 2978
Log:
Companion patch of valgrind r14664.
Modified:
trunk/switchback/test_bzip2.c
trunk/switchback/test_emfloat.c
trunk/switchback/test_ppc_jm1.c
Modified: trunk/switchback/test_bzip2.c
==============================================================================
--- trunk/switchback/test_bzip2.c (original)
+++ trunk/switchback/test_bzip2.c Sat Oct 25 21:10:30 2014
@@ -1222,18 +1222,16 @@
}
# if 0
case 'y': { /* %y - print symbol */
- Char buf[100];
- Char *cp = buf;
Addr a = va_arg(vargs, Addr);
- if (flags & VG_MSG_PAREN)
- *cp++ = '(';
- if (VG_(get_fnname_w_offset)(a, cp, sizeof(buf)-4)) {
+ HChar *name;
+ if (VG_(get_fnname_w_offset)(a, &name)) {
+ HChar buf[1 + VG_strlen(name) + 1 + 1];
if (flags & VG_MSG_PAREN) {
- cp += VG_(strlen)(cp);
- *cp++ = ')';
- *cp = '\0';
- }
+ VG_(sprintf)(str, "(%s)", name):
+ } else {
+ VG_(sprintf)(str, "%s", name):
+ }
ret += myvprintf_str(send, flags, width, buf, 0);
}
break;
Modified: trunk/switchback/test_emfloat.c
==============================================================================
--- trunk/switchback/test_emfloat.c (original)
+++ trunk/switchback/test_emfloat.c Sat Oct 25 21:10:30 2014
@@ -353,18 +353,16 @@
}
# if 0
case 'y': { /* %y - print symbol */
- Char buf[100];
- Char *cp = buf;
Addr a = va_arg(vargs, Addr);
- if (flags & VG_MSG_PAREN)
- *cp++ = '(';
- if (VG_(get_fnname_w_offset)(a, cp, sizeof(buf)-4)) {
+ HChar *name;
+ if (VG_(get_fnname_w_offset)(a, &name)) {
+ HChar buf[1 + VG_strlen(name) + 1 + 1];
if (flags & VG_MSG_PAREN) {
- cp += VG_(strlen)(cp);
- *cp++ = ')';
- *cp = '\0';
- }
+ VG_(sprintf)(str, "(%s)", name):
+ } else {
+ VG_(sprintf)(str, "%s", name):
+ }
ret += myvprintf_str(send, flags, width, buf, 0);
}
break;
Modified: trunk/switchback/test_ppc_jm1.c
==============================================================================
--- trunk/switchback/test_ppc_jm1.c (original)
+++ trunk/switchback/test_ppc_jm1.c Sat Oct 25 21:10:30 2014
@@ -571,18 +571,16 @@
}
# if 0
case 'y': { /* %y - print symbol */
- Char buf[100];
- Char *cp = buf;
Addr a = va_arg(vargs, Addr);
- if (flags & VG_MSG_PAREN)
- *cp++ = '(';
- if (VG_(get_fnname_w_offset)(a, cp, sizeof(buf)-4)) {
+ HChar *name;
+ if (VG_(get_fnname_w_offset)(a, &name)) {
+ HChar buf[1 + VG_strlen(name) + 1 + 1];
if (flags & VG_MSG_PAREN) {
- cp += VG_(strlen)(cp);
- *cp++ = ')';
- *cp = '\0';
- }
+ VG_(sprintf)(str, "(%s)", name):
+ } else {
+ VG_(sprintf)(str, "%s", name):
+ }
ret += myvprintf_str(send, flags, width, buf, 0);
}
break;
|