use sc_debug_hex for hexdump

use a single code base everywhere.

rebased to current HEAD and fixed sc_debug_hex's definition.