aboutsummaryrefslogtreecommitdiff
path: root/sim/common/hw-events.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-06sim: common: migrate to standard uintXX_t typesMike Frysinger1-6/+6
Drop the sim-specific unsignedXX types and move to the standard uintXX_t types that C11 provides.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-12-04sim: include stdarg.h when usedMike Frysinger1-0/+1
Avoid implicit include deps with this to help untangle sim headers so we can get rid of arch-specific sim-main.h.
2021-12-04sim: reorder header includesMike Frysinger1-4/+5
We're including system headers after local headers in a bunch of places, but this leads to conflicts when our local headers happen to define symbols that show up in the system headers. Use the more standard order of: * config.h (via defs.h) * system headers * local library headers (e.g. bfd & libiberty) * sim specific headers
2021-05-16sim: switch config.h usage to defs.hMike Frysinger1-0/+2
The defs.h header will take care of including the various config.h headers. For now, it's just config.h, but we'll add more when we integrate gnulib in. This header should be used instead of config.h, and should be the first include in every .c file. We won't rely on the old behavior where we expected files to include the port's sim-main.h which then includes the common sim-basics.h which then includes config.h. We have a ton of code that includes things before sim-main.h, and it sometimes needs to be that way. Creating a dedicated header avoids the ordering mess and implicit inclusion that shows up otherwise.
2021-05-03sim: add ATTRIBUTE_PRINTF / ATTRIBUTE_NULL_PRINTF where necessarySimon Marchi1-6/+1
I finally got the all-targets sim building with Clang, these are all the instances where an ATTRIBUTE_PRINTF or ATTRIBUTE_NULL_PRINTF attribute needed to be added to avoid errors like: /home/simark/src/binutils-gdb/sim/aarch64/../common/sim-profile.c:464:19: error: format string is not a string literal [-Werror,-Wformat-nonliteral] vfprintf (fp, fmt, ap); ^~~ There are more fixes needed to get everything building, but adding these attributes is trivial enough, so I send them all in a single patch. Adding the format attributes introduces some format string errors when building with GCC (because now format strings are checked), so corresponding changes are needed to avoid breaking the build. Other than simple format string specified changes, there is this one: /home/simark/src/binutils-gdb/sim/aarch64/../common/hw-events.c: In function 'hw_event_queue_schedule': /home/simark/src/binutils-gdb/sim/aarch64/../common/hw-events.c:95:15: error: too many arguments for format [-Werror=format-extra-args] 95 | NULL, dummy); | ^~~~~ We can fix it and avoid using a dummy variable by simply calling hw_event_queue_schedule_tracef instead of hw_event_queue_schedule_vtracef. sim/arm/ChangeLog: * armdefs.h (ARMul_ConsolePrint): Use format attribute. * wrapper.c (op_printf): Likewise. sim/bfin/ChangeLog: * interp.c (sim_open): Adjust format string specifier. sim/common/ChangeLog: * hw-events.h (hw_event_queue_schedule_tracef): Use format attribute. (hw_event_queue_schedule_vtracef): Likewise. * hw-tree.h (hw_tree_vparse): Likewise. * sim-profile.c (profile_vprintf): Likewise. * sim-trace.c (dis_printf): Likewise. * sim-trace.h (trace_printf): Likewise. (trace_vprintf): Likewise. * sim-utils.h (sim_do_commandf): Likewise. * hw-events.c (hw_event_queue_schedule): Use hw_event_queue_schedule_tracef. sim/rx/ChangeLog: * trace.c (op_printf): Likewise. sim/v850/ChangeLog: * interp.c (sim_open): Adjust format string specifier. Change-Id: I1445115ce57db15bb8e35dca93014555e7555794
2021-01-11sim: clean up C11 header includesMike Frysinger1-2/+0
Since we require C11 now, we can assume many headers exist, and clean up all of the conditional includes. It's not like any of this code actually accounted for the headers not existing, just whether we could include them. The strings.h cleanup is a little nuanced: it isn't in C11, but every use of it in the codebase will include strings.h only if string.h doesn't exist. Since we now assume the C11 string.h exists, we'll never include strings.h, so we can delete it.
2021-01-09sim: common: add missing stdlib.h for abort()Mike Frysinger1-0/+1
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-03-28sim/common: Fix warnings: "warning: implicit declaration of function..."Stafford Horne1-0/+3
During building of several cgen simulator's I notices the below warnings. Adding includes fixes these. Including config.h allows stdio.h to properly configure itself to expose asprintf(). The other warnings for abort, free, memset, strlen are trivial. Warnings: ../../../binutils-gdb/sim/or1k/../common/sim-watch.c: In function ‘sim_watchpoint_install’: ../../../binutils-gdb/sim/or1k/../common/sim-watch.c:415:10: warning: implicit declaration of function ‘asprintf’; did you mean ‘vasprintf’? [-Wimplicit-function-declaration] if (asprintf (&name, "watch-%s-%s", ^~~~~~~~ vasprintf ../../../binutils-gdb/sim/lm32/../common/hw-device.c: In function ‘hw_strdup’: ../../../binutils-gdb/sim/lm32/../common/hw-device.c:59:34: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] char *dup = hw_zalloc (me, strlen (str) + 1); ^~~~~~ ../../../binutils-gdb/sim/lm32/../common/hw-events.c: In function ‘hw_event_queue_schedule’: ../../../binutils-gdb/sim/lm32/../common/hw-events.c:92:3: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration] memset (&dummy, 0, sizeof dummy); ^~~~~~ ../../../binutils-gdb/sim/lm32/../common/hw-handles.c: In function ‘hw_handle_remove_ihandle’: ../../../binutils-gdb/sim/lm32/../common/hw-handles.c:211:4: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration] free (delete); ^~~~ ../../../binutils-gdb/sim/lm32/../common/sim-fpu.c: In function ‘pack_fpu’: ../../../binutils-gdb/sim/lm32/../common/sim-fpu.c:292:7: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration] abort (); ^~~~~ sim/common/ChangeLog: * sim-options.c: Include "config.h". Include <stdio.h>. * sim-watch.c: Include "config.h". Include <stdio.h>. * hw-device.c: Include <string.h>. * hw-events.c: Include <string.h>. * hw-handles.c: Include <stdlib.h>. * sim-fpu.c: Include <stdlib.h>.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-01update copyright year range in GDB filesJoel Brobecker1-1/+1
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-2/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-04-02sim: fix up style a bitMike Frysinger1-2/+4
This touches up the code a bit to match GNU style. No functional changes. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+2
2010-01-01Update copyright notices to add year 2010.Joel Brobecker1-1/+1
2009-01-14 Update the copyright notice of some of the files I missedJoel Brobecker1-1/+1
in the previous copyright update.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+1
2007-08-24 Switch the license of all files explicitly copyright the FSFJoel Brobecker1-5/+4
to GPLv3.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-1/+1
2002-06-17* hw-events.c (hw_event_queue_schedule): Initialize `dummy'.Andrew Cagney1-0/+1
2000-11-27Fix delete_hw_event_data() to free the scheduled eventsStephane Carrez1-2/+3
2000-07-272000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>Andrew Cagney1-0/+9
* sim-events.c (sim_events_remain_time): New function returning the time that remains before the event is raised. * hw-events.c (hw_event_remain_time): Likewise. * sim-events.h (sim_events_remain_time): Declare. * hw-events.h (hw_event_remain_time): Declare.
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+263
1999-04-16Initial creation of sourceware repositoryStan Shebs1-140/+0
1998-05-25Split out hw-event code. Clean up interface. Update all users.Andrew Cagney1-0/+140