Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
デバッガがブレークポイントで停止しているときに、現在のバッファのメモリ イメージを微調整するなどのハックに頼らずに std::string 変数の値を変更することは可能ですか?
たとえば、「set var mystring="hello world」のようなもの
?
これを試してください(テスト済みで、私にとってはうまくいきます):
call mystring.assign("hello world")
重要なのは、メモリを直接変更するのではなく、オブジェクトの関数を呼び出してその状態を変更することです。ジョブをstd::basic_string実行するメンバー関数が呼び出されることが起こります。assign
std::basic_string
assign