Skip to main content

Call C++ lambda functions from gdb

Project description

gdb-call-lambda

Call C++ lambda functions from gdb.

Install

  • Install the Python package in somewhere Python can see.
  • In .gdbinit add:
python import gdb_call_lambda

Usage

Call a lambda like printl f(x), where the f is the lambda.

I.e., call as usual, just replace print with printl.

The lambda expression (f in this case) must not have any ( characters.

Alternatively, use the convenience function: print $calll(f, x)

How it works internally/what to do if it doesn't work

See post https://stackoverflow.com/a/70254108/5267751.

There's a known bug where gdb/tools can't demangle a symbol that gcc generates, see B in test.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdb_call_lambda-0.0.2.tar.gz (17.8 kB view hashes)

Uploaded Source

Built Distribution

gdb_call_lambda-0.0.2-py3-none-any.whl (16.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page