aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-watch.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-13 01:21:22 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-13 05:52:51 -0500
commit62fe7512a78962a9eda0db7fde0c8a76cf535714 (patch)
tree4b54cc93bf9f772c360ea2db2c44dfa60e122f64 /sim/common/sim-watch.c
parent4180301e81fbc8eae6e55630f93bc14e045b1c78 (diff)
downloadgdb-62fe7512a78962a9eda0db7fde0c8a76cf535714.zip
gdb-62fe7512a78962a9eda0db7fde0c8a76cf535714.tar.gz
gdb-62fe7512a78962a9eda0db7fde0c8a76cf535714.tar.bz2
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.
Diffstat (limited to 'sim/common/sim-watch.c')
-rw-r--r--sim/common/sim-watch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c
index bbd5be4..d69d42c 100644
--- a/sim/common/sim-watch.c
+++ b/sim/common/sim-watch.c
@@ -173,7 +173,7 @@ schedule_watchpoint (SIM_DESC sd,
point->event = sim_events_watch_sim (sd,
watch->pc,
watch->sizeof_pc,
- 0/* host-endian */,
+ HOST_BYTE_ORDER,
point->is_within,
point->arg0, point->arg1,
/* PC in arg0..arg1 */