printGnuHashTable contains the code to check the GNU hash table.
This patch splits it to getGnuHashTableChains helper (and reorders slightly to reduce).
I am planning to reuse it from the printGnuHashHistogram() for
the same purpose.
Also there is a one possible crash issue in this code,
that needs adding a bit more code to it to fix (i.e. it is better to
split it out as it is becoming large).
Does the change to return an empty array in D81937 actually belong here? I'm a little confused why we seem to be introducing a function that is known to be broken from the outset, only to fix it immediately, rather than just doing it right straight up.