Invoke gdb to automatically pass arguments to the program being debugged

前端 未结 8 1794

I\'d like to write a script that (under certain conditions) will execute gdb and automatically run some program X with some set of arguments Y. Once the program has finishe

8条回答
  •  时光说笑
    2020-12-23 00:30

    gdb target -e "my-automation-commands"
    

    my-automation-commands containing anything you would normally want to run,

    break 0x123
    set args "foo" bar 2
    r
    

    Not strictly a temp file, if you have a few standard init scripts ;)

提交回复
热议问题