Running RIE with Go-based Lambda + Delve debugger?
skyzyx opened this issue · 1 comments
skyzyx commented
I'm currently using RIE to run my compiled Go binary.
#!/bin/sh
if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
exec /usr/local/bin/aws-lambda-rie /var/runtime/bootstrap
else
exec /var/runtime/bootstrap
fiHowever, I also want to run Delve, the Go debugger, against my binary.
exec dlv exec --headless --listen :4040 /var/runtime/bootstrapI've tried combining the commands in different ways to get both RIE and Delve to work, to no avail.
Example: Delve first
exec dlv exec --headless --listen :4040 /usr/local/bin/aws-lambda-rie /var/runtime/bootstrapIn this case, Delve tries to debug RIE.
Example: RIE first
exec /usr/local/bin/aws-lambda-rie dlv exec --headless --listen :4040 /var/runtime/bootstrapIn this case, RIE only seems to run Delve during the lifetime of a request to my Lambda function.
Example: Running in background and capturing PID
PID="$(exec /usr/local/bin/aws-lambda-rie /var/runtime/bootstrap &)"
dlv attach --headless --listen :4040 $PIDIn this case, RIE doesn't move into the background. It stays in the foreground, and Delve never runs.
Any ideas would be welcome.