[Lldb-commits] [PATCH] D93649: [lldb/Lua] add support for Lua function breakpoint
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 25 13:58:23 PST 2021
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lldb/test/Shell/ScriptInterpreter/Lua/breakpoint_function_callback.test:15
+r
+# CHECK: <userdata of type 'lldb::SBStructuredData *' at {{0x[[:xdigit:]]+}}>
+breakpoint command add -s lua -o "abc(frame, bp_loc, ...)"
----------------
tammela wrote:
> JDevlieghere wrote:
> > Can we unpack the SBStructuredData and check for `foo` or `123` in the output?
> While I was doing this change, I noted that the `SBStructuredData` API for `GetStringValue` is quite odd.
> For Lua, the auto-generated SWIG wrapper enforces code like this:
> ```
> local result = "xxxx"
> sd:GetStringValue(result, 3) -- 'sd' should be a value with at most 3 characters
> ```
> This sort of API leaks all sorts of details to the Lua script. I think it could be improved to just return a `std::string` / `llvm::StringRef` object.
>
> The SWIG wrapper also has some bugs for this class. For instance it's using `lua_pushnumber` where it should be `lua_pushinteger` for the `GetIntegerValue` method.
>
> I will report this to the SWIG authors.
I still think this is important. Can you add a FIXME so we remember update this in the future?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93649/new/
https://reviews.llvm.org/D93649
More information about the lldb-commits
mailing list