cgdb: add head option

Closes #31454.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>