The instructions are clear enough, and almost complete: to attach gdb, at least in Ubuntu 22.04 it needs the "-p" flag. I just tried them out to find this very text I am typing now.
$ pgrep -l firefox
$ sudo gdb -p <PID>
(gdb) gcore firefox.dump
control+D
$ vi firefox.dump
What took longest is opening the 3GB dump file. At least 'vi' was up for the task. Could have been done more effectively by grep'ing the text.