5

I would like to debug an AWS Lambda function written in C++ locally. Ideally, I want to be able to step through my code (like you do with GDB or any decent IDE). The way to do this with AWS Lambdas would usually include AWS SAM.

Idea 1, debug using SAM:

Unfortunately, SAM does not enable you do debug provided runtimes, since it "only" supports Node.js, Python and Go (compare documentation).

Question 1:

Is there a way to somehow attach GDB to the my compiled lambda function?

Idea 2, run using docker-lambda:

You can also start your function using lambci/docker-lambda. If you would like to get some debugging output, you could do strace docker run --rm -v my/build/dir:/var/task lambci/lambda:provided handler '{"some": "event"}'. This works, but is not really the quality of debugging that I am looking for.

Question 2:

Can I somehow attach a to a lambda function that is running in docker-lambda?

Idea 3: remote:

Be desperate and go for anything you can get (this is NOT what I wanna do).

Question 3:

If there is really no way to do this locally, how should I do it on AWS?

User12547645
  • 6,955
  • 3
  • 38
  • 69

0 Answers0