Improve valgrind integration

This commit is contained in:
Richard Frith-Macdonald 2022-07-12 12:26:12 +01:00
parent 98772c9ed1
commit b3c86c7acf
5 changed files with 34 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2022-07-12 Richard Frith-Macdonald <rfm@gnu.org>
configure.ac:
configure:
config.h.in:
EcProcess.m:
Check for valgrind and, if availeable, log when a 'memory' command
is executed so that valgrind logs can be matched to events between
successive memory check commands.
2022-07-11 Richard Frith-Macdonald <rfm@gnu.org>
* EcConsole.m: Exit immediately after egistration with Control server

View file

@ -45,6 +45,14 @@
#include "config.h"
#if HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
#else
#if HAVE_VALGRIND_H
#include <valgrind.h>
#endif
#endif
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
@ -5035,8 +5043,15 @@ With two parameters ('maximum' and a number),\n\
process restarts unless the limit is zero (meaning no maximum).\n\
Set to 'default' to revert to the default."];
[self cmdPrintf: @"\n"];
return;
}
else if ([msg count] == 2)
#if defined(__VALGRIND_MAJOR__)
VALGRIND_PRINTF("Console 'memory' command %s\n",
[[msg description] UTF8String]);
#endif
if ([msg count] == 2)
{
NSString *word = [[msg objectAtIndex: 1] lowercaseString];
NSString *s;

View file

@ -100,6 +100,12 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <valgrind.h> header file. */
#undef HAVE_VALGRIND_H
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
#undef HAVE_VALGRIND_VALGRIND_H
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

2
configure vendored
View file

@ -3581,7 +3581,7 @@ fi
done
for ac_header in arpa/inet.h arpa/telnet.h netinet/in.h netdb.h pwd.h string.h fcntl.h sys/fcntl.h sys/file.h sys/resource.h sys/time.h sys/types.h sys/socket.h sys/signal.h stdlib.h unistd.h termios.h
for ac_header in arpa/inet.h arpa/telnet.h netinet/in.h netdb.h pwd.h string.h fcntl.h sys/fcntl.h sys/file.h sys/resource.h sys/time.h sys/types.h sys/socket.h sys/signal.h stdlib.h unistd.h termios.h valgrind.h valgrind/valgrind.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

View file

@ -35,7 +35,7 @@ AC_TYPE_SIGNAL
AC_HEADER_STDC
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h netinet/in.h netdb.h pwd.h string.h fcntl.h sys/fcntl.h sys/file.h sys/resource.h sys/time.h sys/types.h sys/socket.h sys/signal.h stdlib.h unistd.h termios.h)
AC_CHECK_HEADERS(arpa/inet.h arpa/telnet.h netinet/in.h netdb.h pwd.h string.h fcntl.h sys/fcntl.h sys/file.h sys/resource.h sys/time.h sys/types.h sys/socket.h sys/signal.h stdlib.h unistd.h termios.h valgrind.h valgrind/valgrind.h)
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL