" --show-emwarns=no|yes show warnings about emulation limits? [no]\n"
" --smc-support=none|stack|all support for self-modifying code:\n"
" none, for code found in stacks, or all [stack]\n"
+" --xml-user-comment=STR copy STR verbatim to XML output\n"
"\n"
" user options for Valgrind tools that report errors:\n"
" --log-fd=<number> log messages to file descriptor [2=stderr]\n"
VG_(clo_log_name) = &arg[13];
}
+ else if (VG_CLO_STREQN(19, arg, "--xml-user-comment=")) {
+ VG_(clo_xml_user_comment) = &arg[19];
+ }
+
else if (VG_CLO_STREQN(15, arg, "--suppressions=")) {
if (VG_(clo_n_suppressions) >= VG_CLO_MAX_SFILES) {
VG_(message)(Vg_UserMsg, "Too many suppression files specified.");
VG_(clo_log_file_qualifier),
val ? val : "");
}
+ if (VG_(clo_xml_user_comment)) {
+ /* Note: the user comment itself is XML and is therefore to
+ be passed through verbatim (%s) rather than escaped
+ (%t). */
+ VG_(message)(Vg_UserMsg, "<usercomment>%s</usercomment>",
+ VG_(clo_xml_user_comment));
+ }
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<args>");
VG_(message)(Vg_UserMsg, " <vargv>");
for (i = 0; i < vg_argc; i++) {
HChar* tag = i==0 ? "exe" : "arg";
- VG_(message)(Vg_UserMsg, " <%s>%s</%s>",
+ VG_(message)(Vg_UserMsg, " <%s>%t</%s>",
tag, vg_argv[i], tag);
}
VG_(message)(Vg_UserMsg, " </vargv>");
way. See vg_main.c and mc_main.c. */
extern Bool VG_(clo_xml);
+/* An arbitrary user-supplied string which is copied into the
+ XML output, in between <usercomment> tags. */
+extern HChar* VG_(clo_xml_user_comment);
+
/* Call this if a recognised option was bad for some reason.
Note: don't use it just because an option was unrecognised -- return 'False'
from VG_(tdict).tool_process_cmd_line_option) to indicate that. */