From 62fe7512a78962a9eda0db7fde0c8a76cf535714 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 13 Jan 2021 01:21:22 -0500 Subject: sim: watch: fix pc watchpoints on little endian host systems My change 1ac72f0659d64d6a14da862242db0d841d2878d0 ("sim: convert to bfd_endian") subtly broke the watchpoint module on little endian host systems. The old code used 0 to mean "whatever the host endian is", and while that was changed to use BFD_ENDIAN_UNKNOWN, this caller was missed. Since its API used an int instead of an enum, the coercion from 0 to the BFD endian enum was silently missed, and 0 happens to be BFD_ENDIAN_BIG. Instead of restoring the old logic by passing in BFD_ENDIAN_UNKNOWN, we know the right host endian at compile time, so use that directly. --- sim/common/sim-events.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sim/common/sim-events.h') diff --git a/sim/common/sim-events.h b/sim/common/sim-events.h index ecd7c59..823fd8c 100644 --- a/sim/common/sim-events.h +++ b/sim/common/sim-events.h @@ -161,7 +161,7 @@ extern sim_event *sim_events_watch_sim (SIM_DESC sd, void *host_addr, int nr_bytes, - int byte_order, + enum bfd_endian byte_order, int is_within, unsigned64 lb, unsigned64 ub, @@ -182,7 +182,7 @@ extern sim_event *sim_events_watch_core address_word core_addr, unsigned map, int nr_bytes, - int byte_order, + enum bfd_endian byte_order, int is_within, unsigned64 lb, unsigned64 ub, -- cgit v1.1