ubsan: alpha-coff: signed integer overflow
[deliverable/binutils-gdb.git] / sim / common / sim-profile.h
index d7c17abcfa74044229b6cf7eb9867c545a4c94c6..1f6b27415b4eba0ebbc0871333dc810197e359d0 100644 (file)
@@ -1,22 +1,21 @@
 /* Profile header for simulators using common framework.
-   Copyright (C) 1996, 1997, 1998, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
 This file is part of GDB, the GNU debugger.
 
 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, or (at your option)
-any later version.
+the Free Software Foundation; either version 3 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, write to the Free Software Foundation, Inc.,
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef SIM_PROFILE_H
 #define SIM_PROFILE_H
@@ -103,12 +102,6 @@ SIM_RC sim_profile_set_option (SIM_DESC sd_, const char *name_, int idx_,
 #define WITH_PROFILE_MEMORY_P 0
 #endif
 
-/* Only build MODEL code when the target simulator has support for it */
-#ifndef SIM_HAVE_MODEL
-#undef WITH_PROFILE_MODEL_P
-#define WITH_PROFILE_MODEL_P 0
-#endif
-
 /* Profiling install handler.  */
 MODULE_INSTALL_FN profile_install;
 
@@ -290,8 +283,24 @@ do { \
 #define PROFILE_COUNT_CORE(cpu, addr, size, map)
 #endif /* ! core */
 
+#if WITH_PROFILE_MODEL_P
+#define PROFILE_BRANCH_TAKEN(cpu) \
+do { \
+  if (PROFILE_MODEL_P (cpu)) \
+    ++ PROFILE_MODEL_TAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \
+} while (0)
+#define PROFILE_BRANCH_UNTAKEN(cpu) \
+do { \
+  if (PROFILE_MODEL_P (cpu)) \
+    ++ PROFILE_MODEL_UNTAKEN_COUNT (CPU_PROFILE_DATA (cpu)); \
+} while (0)
+#else
+#define PROFILE_BRANCH_TAKEN(cpu)
+#define PROFILE_BRANCH_UNTAKEN(cpu)
+#endif /* ! model */
+
 /* Misc. utilities.  */
 
-extern void sim_profile_print_bar (SIM_DESC, unsigned int, unsigned int, unsigned int);
+extern void sim_profile_print_bar (SIM_DESC, sim_cpu *, unsigned int, unsigned int, unsigned int);
 
 #endif /* SIM_PROFILE_H */
This page took 0.025572 seconds and 4 git commands to generate.