Skip to content
Snippets Groups Projects
Commit 5867ab87 authored by Simon Marchi's avatar Simon Marchi Committed by Simon Marchi
Browse files

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
parent 8d31d08f
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment