Age | Commit message (Collapse) | Author | Files | Lines |
|
m32c/cpu.h defines mem as enum value, which causes GCC 14 to emit
sim/m32c/gdb-if.c: In function ‘sim_read’:
sim/m32c/gdb-if.c:162:33: error: declaration of ‘mem’ shadows a previous local [-Werror=shadow=local]
162 | sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
| ~~~~~~~~~^~~
In file included from ../../binutils-gdb/sim/m32c/gdb-if.c:38:
sim/m32c/cpu.h:83:3: note: shadowed declaration is here
83 | mem,
| ^~~
Fix this by renaming mem to addr in all sim_read and sim_write functions.
Most already used addr instead of mem. In one file, sim/rx/gdb-if.c, this
also meant renaming the local addr variable to vma.
|
|
This commit is the result of the following actions:
- Running gdb/copyright.py to update all of the copyright headers to
include 2024,
- Manually updating a few files the copyright.py script told me to
update, these files had copyright headers embedded within the
file,
- Regenerating gdbsupport/Makefile.in to refresh it's copyright
date,
- Using grep to find other files that still mentioned 2023. If
these files were updated last year from 2022 to 2023 then I've
updated them this year to 2024.
I'm sure I've probably missed some dates. Feel free to fix them up as
you spot them.
|
|
|
|
The verbose argument has always been an int treated as a bool, so
convert it to an explicit bool. Further, update the API docs to
match the reality that the verbose value is actually used by some
of the internal modules.
|
|
This commit is the result of running the gdb/copyright.py script,
which automated the update of the copyright year range for all
source files managed by the GDB project to be updated to include
year 2023.
|
|
We've been using SIM_ADDR which has always been 32-bit. This means
the upper 32-bit address range in 64-bit sims is inaccessible. Use
64-bit addresses all the time since we want the APIs to be stable
regardless of the active arch backend (which can be 32 or 64-bit).
The length is also 64-bit because it's completely feasible to have
a program that is larger than 4 GiB in size/image/runtime. Forcing
the caller to manually chunk those accesses up into 4 GiB at a time
doesn't seem useful to anyone.
Bug: https://sourceware.org/PR7504
|
|
When reading/writing arbitrary data to the system's memory, the unsigned
char pointer type doesn't make that much sense. Switch it to void so we
align a bit with standard C library read/write functions, and to avoid
having to sprinkle casts everywhere.
|
|
These functions only read from memory, so mark the pointer as const.
|
|
When reading/writing arbitrary data to the system's memory, the unsigned
char pointer type doesn't make that much sense. Switch it to void so we
align a bit with standard C library read/write functions, and to avoid
having to sprinkle casts everywhere.
|
|
Clang generates a warning if the format string of a printf-like function is
not a literal ("-Wformat-nonliteral"). On the default configuration, it
causes a build failure (unless "--disable-werror" is specified).
To avoid warnings on the printf-like wrapper, it requires proper
__attribute__((format)) and we have ATTRIBUTE_PRINTF macro for this reason.
This commit adds ATTRIBUTE_PRINTF to the printf-like functions.
|
|
In commit:
commit 7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1
Date: Mon Apr 4 22:38:04 2022 +0100
sim: fixes for libopcodes styled disassembler
changes were made to the simulator source to handle the new libopcodes
disassembler styling API.
Unfortunately, these changes broke building GDB with the erc32 (sparc)
simulator, like this:
../src/configure --target=sparc-linux
make all-gdb
....
/usr/bin/ld: ../sim/erc32/libsim.a(interf.o): in function `sim_open':
/tmp/build/sim/../../src/sim/erc32/interf.c:247: undefined reference to `fprintf_styled'
collect2: error: ld returned 1 exit status
The problem is that in commit 7b01c1cc1d11 the fprintf_styled function
was added into sis.c. This file is only used when building the 'run'
binary, that is, the standalone simulator, and is not included in the
libsim.a library.
Now, the obvious fix would be to move fprintf_styled into libsim.a,
however, that turns out to be tricky.
The erc32 simulator currently has two copies of the function run_sim,
one in sis.c, and one in interf.c, both of these copies are global.
Currently, the 'run' binary links fine, though I suspect this might be
pure luck. When I tried moving fprintf_styled into interf.c, I ran
into multiple-definition (of run_sim) errors. I suspect that by
requiring the linker to pull in fprintf_styled from libsim.a I was
changing the order in which symbols were loaded, and the linker was
now seeing both copies of run_sim, while currently we only see one
copy.
The ideal solution of course, would be to merge the two similar, but
slightly different copies of run_sim, and just use the one copy. Then
we could safely move fprintf_styled into interf.c too, and all would
be good.
But I don't have time right now to start debugging the erc32
simulator, so I wanted a solution that fixes the build without
introducing multiple definition errors.
The easiest solution I think is to just have two copies of
fprintf_styled, one in sis.c, and one in interf.c. Unlike run_sim,
these two copies are both static, so we will not run into multiple
definition issues with this function. The functions themselves are
not very big, so it's not a huge amount of duplicate code.
I am very aware that this is not an ideal solution, and I would
welcome anyone who wants to take on fixing the run_sim problem
properly, and then cleanup the fprintf_styled duplication.
|
|
In commit:
commit 60a3da00bd5407f07d64dff82a4dae98230dfaac
Date: Sat Jan 22 11:38:18 2022 +0000
objdump/opcodes: add syntax highlighting to disassembler output
I broke several sim/ targets by forgetting to update their uses of the
libopcodes disassembler to take account of the new styled printing.
These should all be fixed by this commit.
I've not tried to add actual styled output to the simulator traces,
instead, the styled print routines just ignore the style and print the
output unstyled.
|
|
This old port setup its own uintXX types, but since we require C11
now, we can assume the standard uintXX_t types exist and use them.
|
|
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.
|
|
Add conditional logic around fcntl.h F_{G,S}ETFL usage to fix builds
on systems that don't have it (e.g. Windows). The code is only used
to save & restore limited terminal stdin state.
|
|
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.
|
|
The gdb/callback.h & gdb/remote-sim.h headers have nothing to do with
gdb and are really definitions for the libsim API under the sim/ tree.
While gdb uses those headers as a client, it's not specific to it. So
create a new sim/ namespace and move the headers there.
|
|
This changes all the non-generated (hand-written) code in sim to use
"new" (post-K&R) style function definitions.
2021-04-08 Tom Tromey <tom@tromey.com>
* bpf.c (bpf_def_model_init): Use new-style declaration.
sim/common/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* cgen-utils.c (RORQI, ROLQI, RORHI, ROLHI, RORSI, ROLSI): Use
new-style declaration.
sim/erc32/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sis.c (run_sim, main): Use new-style declaration.
* interf.c (run_sim, sim_open, sim_close, sim_load)
(sim_create_inferior, sim_store_register, sim_fetch_register)
(sim_info, sim_stop_reason, flush_windows, sim_do_command): Use
new-style declaration.
* help.c (usage, gen_help): Use new-style declaration.
* func.c (batch, set_regi, set_rega, disp_reg, limcalc)
(reset_stat, show_stat, init_bpt, int_handler, init_signals)
(disp_fpu, disp_regs, disp_ctrl, disp_mem, dis_mem, event)
(init_event, set_int, advance_time, now, wait_for_irq, check_bpt)
(reset_all, sys_reset, sys_halt): Use new-style declaration.
* float.c (get_accex, clear_accex, set_fsr): Use new-style
declaration.
* exec.c (sub_cc, add_cc, log_cc, dispatch_instruction, fpexec)
(chk_asi, execute_trap, check_interrupts, init_regs): Use
new-style declaration.
* erc32.c (init_sim, reset, decode_ersr, mecparerror)
(error_mode, decode_memcfg, decode_wcr, decode_mcr, sim_halt)
(close_port, exit_sim, mec_reset, mec_intack, chk_irq, mec_irq)
(set_sfsr, mec_read, mec_write, init_stdio, restore_stdio)
(port_init, read_uart, write_uart, flush_uart, uarta_tx)
(uartb_tx, uart_rx, uart_intr, uart_irq_start, wdog_intr)
(wdog_start, rtc_intr, rtc_start, rtc_counter_read)
(rtc_scaler_set, rtc_reload_set, gpt_intr, gpt_start)
(gpt_counter_read, gpt_scaler_set, gpt_reload_set, timer_ctrl)
(memory_read, memory_write, get_mem_ptr, sis_memory_write)
(sis_memory_read): Use new-style declaration.
sim/frv/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, frv_sim_close, sim_create_inferior): Use
new-style declaration.
sim/h8300/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* compile.c (cmdline_location): Use new-style declaration.
sim/iq2000/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style
declaration.
* iq2000.c (fetch_str): Use new-style declaration.
sim/lm32/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style
declaration.
sim/m32r/ChangeLog
2021-04-08 Tom Tromey <tom@tromey.com>
* sim-if.c (sim_open, sim_create_inferior): Use new-style
declaration.
|
|
These ports don't use the common sim core, so they weren't providing
a sim_memory_map for gdb, so they failed to link with the new memory
map logic added for the sim. Add stubs to fix.
|
|
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.
|
|
gdb/ChangeLog:
Update copyright year range in all GDB files.
|
|
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.
|
|
gdb/ChangeLog:
Update copyright year range in all GDB files
|
|
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-03 Mike Frysinger <vapier@gentoo.org>
* sim-options.c (sim_parse_args): Mark argv array const.
* sim-options.h (sim_parse_args): Likewise.
|
|
A bunch of places open code the countargv implementation, or outright
duplicate it (as count_argc). Replace all of those w/countargv.
|
|
gdb/ChangeLog:
Update year range in copyright notice of all files.
|
|
|
|
Permission was granted by Jiri Gaisler, who has a copyright assignment
on file for GDB.
sim/erc32/ChangeLog:
* configure.ac: Add copyright header.
* erc32.c: Change copyright holder to FSF. Reformat.
* exec.c, float.c, func.c, interf.c, sis.c, sis.h: Likewise.
* help.c, startsim: Add copyright header.
|
|
Change data ordering in emulated memory from target order (big endian)
to host order. Improves performance and simplifies most memory
operations. Requires some byte twisting during stores on little
endian hosts (intel). Also removed support for little-endian binaries.
|
|
Use separate memory_iread() function for instruction fetching.
Speeds up execution and allows addition of an MMU at a later stage.
|
|
|
|
These funcs are only used with the old run.o, and these sims use nrun.o,
so drop these stub funcs.
|
|
|
|
Binaries produced by most erc32 tool-chains do not include
system initialization. sis will detect this and initialize
necessary registers for memory and timer control.
|
|
It is rare for people to want to modify the cmd arg. In general, they
really shouldn't be, but a few still do. For those who misbehave, dupe
the string locally so they can bang on it.
|
|
There's no need for the prog_name handed down to the core to be mutable,
so add const markings to it and all the related funcs.
|
|
2013-03-15 Steve Ellcey <sellcey@mips.com>
* remote-sim.c (sim_command_completer): Make char arguments const.
include:
2013-03-15 Steve Ellcey <sellcey@mips.com>
* gdb/remote-sim.h (sim_command_completer): Make char arguments const.
sim:
2013-03-15 Steve Ellcey <sellcey@mips.com>
* arm/wrapper.c (sim_complete_command): Make char arguments const.
* avr/interp.c (sim_complete_command): Ditto.
* common/sim-options.c (sim_complete_command): Ditto.
* cr16/interp.c (sim_complete_command): Ditto.
* erc32/interf.c (sim_complete_command): Ditto.
* m32c/gdb-if.c (sim_complete_command): Ditto.
* microblaze/interp.c (sim_complete_command): Ditto.
* ppc/sim_calls.c (sim_complete_command): Ditto.
* rl78/gdb-if.c (sim_complete_command): Ditto.
* rx/gdb-if.c (sim_complete_command): Ditto.
* sh/interp.c (sim_complete_command): Ditto.
|
|
sim/ChangeLog:
Update old contact info in GPL license notices.
|
|
gdb/sim/ChangeLog:
Update the non-FSF-copyrighted files in sim to GPLv3 or later.
|
|
* erc32.c: Likewise.
* exec.c: Likewise.
* float.c: Likewise.
* func.c: Likewise.
* help.c: Likewise.
* interf.c: Likewise.
|
|
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
gdb/gdbserver/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
include/gdb/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
* gdb/signals.def: Replace TARGET_SIGNAL_ with GDB_SIGNAL_
throughout.
sim/arm/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/avr/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/common/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/cr16/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/d10v/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/erc32/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/m32c/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/ppc/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/rl78/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
sim/rx/
2012-05-24 Pedro Alves <palves@redhat.com>
PR gdb/7205
Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
|
|
|
|
This patch fixes a build failure at link time due to
sim_complete_command being undefined. There was a recent change
that added this function to all the ports that do not use the
common/ subdir. But somehow, the erc32 port got missed.
sim/erc32/ChangeLog:
* interf.c (sim_complete_command): New stub function.
|
|
gdb/ChangeLog
* remote-sim.c (gdbsim_store_register): Update API to
sim_store_register to check more error conditions.
include/gdb/ChangeLog
* remote-sim.h (sim_store_register): Update the API
documentation for this function.
sim/erc32/ChangeLog
sim/h8300/ChangeLog
sim/m32c/ChangeLog
sim/mn10300/ChangeLog
sim/ppc/ChangeLog
sim/rx/ChangeLog
sim/v850/ChangeLog
* ???.c (sim_store_register): Update return value to
match new API.
|
|
* erc32.c (sis_memory_write): Change prototype to const unsigned char *.
* func.c (exec_cmd, event, advance_time, wait_for_irq): Use uint64
for counts.
* interf.c (run_sim): Change icount to uint64_t. Use strtol directly.
(sim_resume): Specify maximum run time as uint64.
* sis.c (run_sim): Change icount to uint64_t.
* sis.h: Define uint64 as uint64_t. Change various fields and
prototypes to uint64 to support longer simulations.
|
|
As pointed out by Sandra Loosemore, a bunch of targets define sim_write
themselves instead of using the common/ code. So constify them too.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
sim_resume. Expect target signal numbers from sim_stop_reason.
* wrapper.c (gdb/signals.h): Include it.
(SIGTRAP): Don't define.
(SIGBUS): Likewise.
(sim_stop_reason): Use TARGET_SIGNAL_* instead of SIG*.
* sim-reason.c (sim_stop_reason): Use
sim_signal_to_target, not sim_signal_to_host.
* sim-signal.c (sim_signal_to_host): Fix typo.
(sim_signal_to_target): New function.
* interp.c (gdb/signals.h): Include it.
(sim_stop_reason): Use TARGET_SIGNAL_*.
* interf.c: (gdb/signals.h): Include it.
(sim_stop_reason): Use TARGET_SIGNAL_*.
* sim_calls.c (gdb/signals.h): Include it.
(sim_stop_reason): Use TARGET_SIGNAL_*.
* psim.c (cntrl_c_simulation): Use TARGET_SIGNAL_*.
|
|
* sim/erc32/float.c (set_fsr): Do not use deprecated multi-line
strings.
(clear_accex): Ditto.
* sim/erc32/interf.c: Remove the redeclaration of fprintf.
* sim/erc32/sis.c: Ditto.
* sim/erc32/exec.c: Add missing semicolon.
* sim/erc32/func.c: Remove definitions of generic_print_address,
generic_symbol_at_address, buffer_read_memory and perror_memory, as
they are already defined in opcodes/dis-buf.c.
|
|
* interf.c: Include "libiberty.h" instead of declaring buildargv
ourselves.
sim/ppc:
* sim_calls.c: Include "libiberty.h".
|