mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
sim: m68hc11: warn when emul_write fails
Not sure what we should do here when this fails, so just emit a warning for now to satisfy unused result compiler warnings. We can see if any users actually notice here.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2021-05-06 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
|
* emulos.c: Include errno.h & stdio.h.
|
||||||
|
(emul_write): Print a warning when the write fails.
|
||||||
|
|
||||||
2021-05-04 Mike Frysinger <vapier@gentoo.org>
|
2021-05-04 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* dv-m68hc11.c (struct m68hc11cpu): Change attach_size to unsigned int.
|
* dv-m68hc11.c (struct m68hc11cpu): Change attach_size to unsigned int.
|
||||||
|
@ -23,6 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
@ -103,8 +105,9 @@ emul_write (sim_cpu *cpu)
|
|||||||
while (size)
|
while (size)
|
||||||
{
|
{
|
||||||
uint8 val = memory_read8 (cpu, addr);
|
uint8 val = memory_read8 (cpu, addr);
|
||||||
|
|
||||||
write(0, &val, 1);
|
if (write (0, &val, 1) != 1)
|
||||||
|
printf ("write failed: %s\n", strerror (errno));
|
||||||
addr ++;
|
addr ++;
|
||||||
size--;
|
size--;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user