this gist contains several iterations of attempting to attach gdb to a flask/wsgi app running on elastic beanstalk. assumption: ssh access (requires setting a key in the config, and then get the IP address from EB console or EC2 instance list), and sudo.
tl;dr: simple working solution is to
- write out the pid in
/tmp/xpid
- sleep in a while loop and wait until that file disappears to continue