Is there a way to run functions (e.g. std :: string.size ()) when examining the main dumps using gdb?

Consider a C ++ program that produces some segmentation error and is interrupted.

With regular debugging using gdb, I can do the following and see the results

(gdb) r
(gdb) p str_var.size()

where str_var is defined as std :: string in the file.

However, I ran into some problem while debugging with a core dump. After I loaded the core dump into gdb on

gdb EXECUTABLE core.pid

and run the following command in gdb terminal

(gdb) p str_var.size()

gdb says: "You cannot do this without a process for debugging."

, bt ( ) std::string, , ​​ std::string. , ? , std::string ?

+4
1

, , , . - (), , , , stl .

, ( ) , .

, n.m, , , - stl (, stlport AFAIK)

+1

Source: https://habr.com/ru/post/1617639/


All Articles