From 0a819f254a1dcd087f8158bcd8a86a9c62c0fc7e Mon Sep 17 00:00:00 2001 From: FlightControl_Master Date: Wed, 8 Nov 2017 09:41:18 +0100 Subject: [PATCH] Progress 2 --- Moose Development/Debugger/debugger.lua | 22 +++++++++++++++++----- Moose Development/Moose/Moose.lua | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Moose Development/Debugger/debugger.lua b/Moose Development/Debugger/debugger.lua index aa1f54f47..1c99354ad 100644 --- a/Moose Development/Debugger/debugger.lua +++ b/Moose Development/Debugger/debugger.lua @@ -724,6 +724,7 @@ end --TODO dynamic code handling -- The DBGp specification is not clear about the line number meaning, this implementation is 1-based and numbers are inclusive function M.source(self, args) + BASE:E( { self = self, args = args } ) local path if args.f then path = platform.get_path(args.f) @@ -732,11 +733,17 @@ function M.source(self, args) assert(path:sub(1,1) == "@") path = path:sub(2) end + BASE:E( { path = path } ) local file, err = io.open(path) - if not file then dbgp.error(100, err, { success = 0 }) end + if not file then + BASE:E( { "Not found" } ) + dbgp.error(100, err, { success = 0 }) + end + BASE:E( { "Found" } ) -- Try to identify compiled files - if file:read(1) == "\033" then dbgp.error(100, args.f.." is bytecode", { success = 0 }) end - file:seek("set", 0) + --if file:read(1) == "\033" then dbgp.error(100, args.f.." is bytecode", { success = 0 }) end + BASE:E( { file = file } ) + --file:seek("set", 0) local srclines = { } @@ -2113,7 +2120,12 @@ end function M.get_uri (source) -- search in cache + if string.sub(1,1) ~= "@" then + source = "@" .. source + end + BASE:E( { source=source, uri_cache = uri_cache } ) local uri = uri_cache[source] + BASE:E( { uri=uri } ) if uri ~= nil then return uri end -- not found, create uri @@ -3152,8 +3164,8 @@ local function line_hook(line) local info = active_session.coro:getinfo(0, "S") local ModifiedSource = info.source - ModifiedSource = ModifiedSource:match( '^Scripts/Moose/(.*)' ) or ModifiedSource - ModifiedSource = "@"..ModifiedSource + --ModifiedSource = ModifiedSource:match( '^Scripts/Moose/(.*)' ) or ModifiedSource + --ModifiedSource = ModifiedSource local uri = platform.get_uri(ModifiedSource) BASE:E( { "Source", info.source, ModifiedSource, uri, debugger_uri } ) diff --git a/Moose Development/Moose/Moose.lua b/Moose Development/Moose/Moose.lua index d9c652de4..cef97254c 100644 --- a/Moose Development/Moose/Moose.lua +++ b/Moose Development/Moose/Moose.lua @@ -14,6 +14,6 @@ _SETTINGS = SETTINGS:Set() package.path = package.path..";.\\LuaSocket\\?.lua;" local initconnection = require("debugger") -initconnection( "127.0.0.1", 10000, "dcsserver", nil, "win", "C:/Users/svenv/AppData/Local/Temp/DCS/Mission/l10n/DEFAULT" ) +initconnection( "127.0.0.1", 10000, "dcsserver", nil, "win", "" ) print("Debugger is configured!")