|
| ollydbg | I have a problem under windows: gcc 4.7.x gdb-cvs, when try to show a std::string, I enter the command: output s.c_str(), but gdb response: Cannot evaluate function -- may be inlined |
| ollydbg | what cause this kind of problem? thanks |
| ollydbg | For the record, if gcc 4.6.x does not have such issue. |
| jankratochvil | Try to use this function in the program, be sure to use -O0 -g (and not -O2 -g) and try -fkeep-inline-functions. |
| ollydbg | OK, I will try this soon |
| -->| | qeed (~qeed@adsl-98-85-40-120.mco.bellsouth.net) has joined #gdb |
| ollydbg | Hi, jan, thanks, it works. |
| ollydbg | In-fact, I'm forum Code::blocks forum, we use such script to show the std::string value: output s.c_str()[0]@s.size() |
| ollydbg | But, if the user does not expicit call the c_str() and size() in there code, gdb will report failure in running such script. |
| ollydbg | That's strange, does gcc changed something? |
| ollydbg | BTW: If I enable the python pretty printer, then I have no such issue, the str::string's content shown correctly either under gcc 4.7.x or gcc 4.6.x |
| jankratochvil | Newer
gcc has more optimizations, it has the right to do these optimizations.
And sure Pretty Printers do not depend on inferior function calls, so
that Pretty Printers can work also on core files. |
| ollydbg | Ok, thanks, I will forward your explanation to Code::blocks forum, many thanks. asmwarrior/ollydbg |
| ollydbg | So, it looks like gdb pretty-printer is the most suggest way to show std::string like contents, other gdb script are not suggest because they will cause such issue. |