aboutsummaryrefslogtreecommitdiff
path: root/gdb/obsd-nat.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-01-27 14:46:50 -0500
committerSimon Marchi <simon.marchi@efficios.com>2023-01-30 10:22:42 -0500
commit5867ab870b8aa36ae490ec6e4e8e4c55be11ccf1 (patch)
treec5049320fa15c17055ef6bf20935118170545080 /gdb/obsd-nat.c
parent8d31d08fe61059fb94c02ae30c2b7cd0ea738df0 (diff)
downloadbinutils-5867ab870b8aa36ae490ec6e4e8e4c55be11ccf1.zip
binutils-5867ab870b8aa36ae490ec6e4e8e4c55be11ccf1.tar.gz
binutils-5867ab870b8aa36ae490ec6e4e8e4c55be11ccf1.tar.bz2
gdb: provide const-correct versions of addrmap::find and addrmap::foreach
Users of addrmap::find and addrmap::foreach that have a const addrmap should ideally receive const pointers to objects, to indicate they should not be modified. However, users that have a non-const addrmap should still receive a non-const pointer. To achieve this, without adding more virtual methods, make the existing find and foreach virtual methods private and prefix them with "do_". Add small non-const and const wrappers for find and foreach. Obviously, the const can be cast away, but if using static_cast instead of C-style casts, then the compiler won't let you cast the const away. I changed all the callers of addrmap::find and addrmap::foreach I could find to make them use static_cast. Change-Id: Ia8e69d022564f80d961413658fe6068edc71a094
Diffstat (limited to 'gdb/obsd-nat.c')
0 files changed, 0 insertions, 0 deletions