2018-06-22 16:09:10 +00:00
|
|
|
/*
|
|
|
|
* exit support for qemu
|
|
|
|
*
|
|
|
|
* Copyright (c) 2018 Alex Bennée <alex.bennee@linaro.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
|
|
#include "qemu.h"
|
2019-05-02 09:27:28 +00:00
|
|
|
#ifdef TARGET_GPROF
|
|
|
|
#include <sys/gmon.h>
|
|
|
|
#endif
|
2018-06-22 16:09:10 +00:00
|
|
|
|
2018-06-22 16:23:44 +00:00
|
|
|
#ifdef CONFIG_GCOV
|
|
|
|
extern void __gcov_dump(void);
|
|
|
|
#endif
|
|
|
|
|
2018-06-22 16:09:10 +00:00
|
|
|
void preexit_cleanup(CPUArchState *env, int code)
|
|
|
|
{
|
|
|
|
#ifdef TARGET_GPROF
|
|
|
|
_mcleanup();
|
2018-06-22 16:23:44 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_GCOV
|
|
|
|
__gcov_dump();
|
2018-06-22 16:09:10 +00:00
|
|
|
#endif
|
|
|
|
gdb_exit(env, code);
|
2018-10-21 17:27:28 +00:00
|
|
|
qemu_plugin_atexit_cb();
|
2018-06-22 16:09:10 +00:00
|
|
|
}
|