diff options
Diffstat (limited to 'gdb/common/common-utils.h')
-rw-r--r-- | gdb/common/common-utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h index 47def11..a9053ff 100644 --- a/gdb/common/common-utils.h +++ b/gdb/common/common-utils.h @@ -20,6 +20,8 @@ #ifndef COMMON_UTILS_H #define COMMON_UTILS_H +#include <string> + /* If possible, define FUNCTION_NAME, a macro containing the name of the function being defined. Since this macro may not always be defined, all uses must be protected by appropriate macro definition @@ -56,6 +58,10 @@ char *xstrvprintf (const char *format, va_list ap) int xsnprintf (char *str, size_t size, const char *format, ...) ATTRIBUTE_PRINTF (3, 4); +/* Returns a std::string built from a printf-style format string. */ +std::string string_printf (const char* fmt, ...) + ATTRIBUTE_PRINTF (1, 2); + /* Make a copy of the string at PTR with LEN characters (and add a null character at the end in the copy). Uses malloc to get the space. Returns the address of the copy. */ |