*/
#include "qemu/osdep.h"
#include "qemu.h"
+#ifdef TARGET_GPROF
+#include <sys/gmon.h>
+#endif
+
+#ifdef CONFIG_GCOV
+extern void __gcov_dump(void);
+#endif
void preexit_cleanup(CPUArchState *env, int code)
{
#ifdef TARGET_GPROF
_mcleanup();
+#endif
+#ifdef CONFIG_GCOV
+ __gcov_dump();
#endif
gdb_exit(env, code);
}