base: Ensure %p format arguments are printed as pointers.
authorGabe Black <gabeblack@google.com>
Fri, 4 Oct 2019 06:42:35 +0000 (23:42 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 8 Oct 2019 17:45:53 +0000 (17:45 +0000)
commitcb1eb7e29d196cc4febca194b7d295e88c37c093
treec50e9af05db17444417c39f0649b4563b16cd9af
parent8329f4bb658e4681f4d39fbd5d053114504f1403
base: Ensure %p format arguments are printed as pointers.

If the %p format is used, char * arguments should be printed as the
hex value of their pointer, not as strings. Unfortunately blindly
passing them to an ostream using << will not do that. This change adds
some casting in that case to ensure that they're treated as numbers and
not as strings.

Change-Id: If02bae6d5e468b352266702fcba62b6beddffcbd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21459
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/cprintf_formats.hh