gcore: add option to dump core using kernel facility
(cherry picked from commit 73e8f06ac523ee4b530e17d50cc580dc366f7ad8)