Consider a c++ program that produces some segmentation fault and aborted.
In regular debugging using gdb, I can do the following and see results
(gdb) r
(gdb) p str_var.size()
where str_var is defined as std::string in the file.
However, I encountered some problem when debugging with a core dump. After I load the core dump in gdb by
gdb EXECUTABLE core.pid
and run the following command in gdb terminal
(gdb) p str_var.size()
gdb says "You can't do that without a process to debug."
I am only able to do things like bt (view stack trace) or directly print std::string variable, but just couldn't find an easy way to check some information like printing the size of a std::string. Is it always the case that debugging capabilities are limited when debugging a core dump? Particularly for the problem here, is there a way to know the size of a std::string in core dump debugging?