LoginSignup
9
9

More than 5 years have passed since last update.

gdbでjsonパースする

Posted at

gdbではpythonが使えるので、単にpython側から対象の文字列をロードしてパースすればよい

(gdb) python import json
(gdb) python print json.loads(gdb.selected_frame().read_var("s").string())

read_var(変数名) で gdb.Value というオブジェクトがとれる。このオブジェクトをpythonのstringに変換してjson.loadsする。

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9