wheretib / luadkmdebugger Goto Github PK
View Code? Open in Web Editor NEWVisual Studio C++ debugger extensions for Lua
License: MIT License
Visual Studio C++ debugger extensions for Lua
License: MIT License
It shows "The debugger's worker process (msvsmon.exe) unexpectedlly exited. Debuggering will be aborted."
Here's the log file:
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 9789.4140625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 9790.4140625ms
INFO: Check if Lua library is loaded at 9797.40625ms
WARNING: Failed to find Lua library at 9911.3515625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 9911.3515625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 9941.328125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 9942.3203125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 9979.3046875ms
INFO: Found kernel32 library at 9979.3046875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 9991.296875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 9996.2890625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 9997.2890625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10105.2265625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10106.2265625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10132.2109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10132.2109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10147.2109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10148.2109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10171.203125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10171.203125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10214.171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10214.171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10220.1640625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10220.1640625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10226.1640625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10226.1640625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10231.15625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10231.15625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10236.1640625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10237.15625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10242.1484375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10243.1484375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10249.15625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10250.1484375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10255.140625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10256.140625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10263.140625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10263.140625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10269.1328125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10270.1484375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10275.140625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10276.1328125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10285.1328125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10285.1328125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10293.1171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10297.125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10302.1171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10303.1171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10307.125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10308.125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10313.1171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10313.1171875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10318.109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10318.109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10323.109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10323.109375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10330.1015625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10331.1015625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10339.1015625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10340.09375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10347.1015625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10348.09375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10357.0859375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10357.0859375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10370.0859375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10371.0859375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10379.0703125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10380.0859375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10398.0703125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10399.0703125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10457.0390625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10458.0390625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10482.0078125ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10483.0234375ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10497.015625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10497.015625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10517.9921875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10517.9921875ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10548.9765625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad finished at 10549.9765625ms
INFO: IDkmModuleInstanceLoadNotification.OnModuleInstanceLoad begin at 10619.9453125ms
INFO: Check if Lua library is loaded at 10620.9453125ms
INFO: Local symbols connection is not available at 10669.9140625ms
VS version: VS2019 Community Preview 16.8.0 Preview 2.0
System OS: Windows 10
Lua Version: Lua 5,4
Hello, can you provide an example that can be debugged. I tested several projects and it didn’t work. I will provide a case https://github.com/brinkqiang/dmlua
Regarding self-compiled lua, you need to bring your own pdb file. It is recommended that this be explained in the readme. This can save troubleshooting time.
Look at Decoda – it can load scripts directly from the Lua state, thus we don't need to even setup anything. Very needed feature. =)
Official repository:
https://github.com/luabind/luabind
Forks:
https://github.com/rpavlik/luabind
https://github.com/OpenXRay/luabind-deboostified/
Documentation:
https://github.com/luabind/luabind/wiki/Docs#implementation-notes
The classes and objects are implemented as user data in Lua. To make sure that the user data really is the internal structure it is supposed to be, we tag their metatables. A user data who's metatable contains a boolean member named __luabind_classrep is expected to be a class exported by luabind. A user data who's metatable contains a boolean member named __luabind_class is expected to be an instantiation of a luabind class.
This means that if you make your own user data and tags its metatable with the exact same names, you can very easily fool luabind and crash the application.
In the Lua registry, luabind keeps an entry called __luabind_classes. It should not be removed or overwritten.
When there are many scripts it's hard to find a script, when scripts are sorted in 'as they loaded' order :)
Hey there, just wanted to say thanks for sharing this plugin, if I can get it working it will save me a ton of time!
The issue I am experiencing is that I can't get the breakpoints to appropriately fire using VS 2017 and LUA 5.1.5. The sample project works, but when the breakpoints trip in my project it opens up Ido.c... I am using a pre-built LUA dll (built directly from the source, I believe), and I had to copy my lua51.pdb file into the executable folder.
Here is the top of my log:
lua_dkm_debug_log.txt
(Note: I removed a lot of the duplicate messages and redacted some paths)
Some things I noticed comparing it to the working log:
Any ideas?
Edit: in the current version the file status is 'Loaded from file'
Case address: https://github.com/brinkqiang/dmlua
This example is more complicated and should be able to cover many usage conditions. If this example can be debugged, many examples will be debugged.
More special points.
The compiled exe is in the Debug directory, and the script is loaded as the upper-level directory of the exe.
Calling method
The calling method in C++ is as follows.
CRole* poRole = CRoleMgr::Instance()->CreateRole();
poRole->SetName("andy");
poRole->SetHp(9999);
poRole->SetMp(9999);
unsigned int dwTaskID = 100;
LResultINT oResult(-1);
oDMLuaEngine.Call("script.task.task.AcceptTask", poRole, dwTaskID, &oResult);
seeall
The seeall attribute is set in the script. I don't know if it will affect it.
module (..., package.seeall)
Your help is very much needed.
In Visual Studio 2022, hover over complex expressions no longer works. For example, if you hover over prop in tbl.prop, there is no tool tip. However, now when you hover over tbl, you will have a tool tip with a tree view where you can explore inside.
As a work-around, use Watch or Pin the expression from the root expression tool tip.
When the solution for updated behavior of Visual Studio 2022 arrives, a new release will be made.
I was getting no callstacks in the debugger because the version detection logic didn't work for me for a Lua 5.3 dll. I managed to get it working by just checking if a lua_rotate function is declared.
As the title says: I can't activate it anymore after installing.
All options are greyed out.
The version before worked, though it slowed down debugging significantly.
My case is
lua_newstate
function, on if (!lj_prng_seed_secure(&prng)) {
line.Probably, this can be reproduced with just dummy project that calls LuaJIT's implementation of lua_newstate
, but I'm not sure.
This issue doesn't require LuaJIT support like #8 :) Just a possibility to improve the interaction with unknown Lua implementations.
local i = 1
do
local i = 3
print(i) -- debugger show i is 1
end
First this is a fantastic job. Thank you. I was wondering if there is support to browse functions in a lua script or is there another extension that you use with this one for that support? If not I was going to look into adding something based on FunctionBar.
I am using project you provided in issues #7 , and add breakpoints like this:
When I press F5, the debugger just step into ldo.c luaD_hook function, and never stop in lua file. In addition, I didn't add breakpoint at there. Here's the png:
The addin's version is v0.9.6.
Here is log file:
lua_dkm_debug_log.txt
Can you tell me how to solve this problem? Or Do I need provide other imformation?
Here's an example project for Visual Studio 2019 you provided:
lua_dbg_example.zip
The debugger can get bogged down very slowly reading table values in LuaTable.LoadValues when trying to display data tip for large tables with several thousand values.
This was the call stack it was happening in.
LuaDkmDebuggerComponent.LuaTableData.LoadValues Line 1525 C# Symbols loaded.
LuaDkmDebuggerComponent.EvaluationHelpers.EvaluateValueAtLuaValue Line 224 C# Symbols loaded.
LuaDkmDebuggerComponent.EvaluationHelpers.EvaluateDataAtLuaValue Line 348 C# Symbols loaded.
LuaDkmDebuggerComponent.LocalComponent.Microsoft.VisualStudio.Debugger.ComponentInterfaces.IDkmLanguageExpressionEvaluator.GetItems Line 1649 C# Symbols loaded.
Microsoft.VisualStudio.Debugger.EntryPoint.IDkmLanguageExpressionEvaluator_GetItems Unknown No symbols loaded.
It would help to have some cut off when reading the values and all those single memory reads could maybe batch read from a single larger memory read thats cached in a byte buffer to speed things up.
Hello, LuaDkmDebugger is the best lua plugin I have ever used.
Now I am developing in python. Can you port a python version following the same principle? Because I based on my research on python I found that they have some things in common. For example, modularization, require module -> import module
luaopen + _modulename -> init + modulename
thx!
Use "Extensions"--"Manage Extensions", I can install LuaDkmDebugger by Visual Studio 2019. Now I use 2022, Use "Extensions"--"Manage Extensions" can not find LuaDkmDebugger.
How can I use it on Visual Studio 2022?
Could you look into adding support for LuaJIT, or maybe give an advice where should I start to try adding support for it?
evaluate value support modify local var such as i = 100?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.