Skip to content

[lldb] Convert script native types to StructuredData counterpart #7095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

medismailben
Copy link

This patch adds the ability to pass native types from the script interpreter to methods that use a {SB,}StructuredData argument.

To do so, this patch changes the ScriptedObject struture that holds the pointer to the script object as well as the originating script interpreter language. It also exposes that to the SB API via a new class called SBScriptObject.

This structure allows the debugger to parse the script object and convert it to a StructuredData object. If the type is not compatible with the StructuredData types, we will store its pointer in a StructuredData::Generic object.

This patch also adds some SWIG typemaps that checks the input argument to ensure it's either an SBStructuredData object, in which case it just passes it throught, or a python object that is NOT another SB type, to provide some guardrails for the user.

rdar://111467140

Differential Revision: https://reviews.llvm.org/D155161

@medismailben medismailben force-pushed the swift/release/5.9 branch 3 times, most recently from 109e794 to 3708be4 Compare July 26, 2023 06:01
This patch adds the ability to pass native types from the script
interpreter to methods that use a {SB,}StructuredData argument.

To do so, this patch changes the `ScriptedObject` struture that holds
the pointer to the script object as well as the originating script
interpreter language. It also exposes that to the SB API via a new class
called `SBScriptObject`.

This structure allows the debugger to parse the script object and
convert it to a StructuredData object. If the type is not compatible
with the StructuredData types, we will store its pointer in a
`StructuredData::Generic` object.

This patch also adds some SWIG typemaps that checks the input argument to
ensure it's either an SBStructuredData object, in which case it just
passes it throught, or a python object that is NOT another SB type, to
provide some guardrails for the user.

rdar://111467140

Differential Revision: https://reviews.llvm.org/D155161

Signed-off-by: Med Ismail Bennani <[email protected]>
@medismailben
Copy link
Author

@swift-ci test

@medismailben
Copy link
Author

@swift-ci Test Windows Platform

@JDevlieghere JDevlieghere merged commit f802bcb into swiftlang:swift/release/5.9 Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants