Menu

#34 wrong line number with LDT

v3.0-beta1
open
nobody
None
5
2014-07-29
2014-07-29
Duzc2
No

I use LuaDevelopmentTools to debug lua code runs on luaj.
I rewrite a simple socket via java.
and a simple lua code :

1
2 -- TRANSPORT = "net.duzc2.test.luaj.socket.LuaSocket";
3 -- _VERSION = "Lua 5.2"
4 -- require("net.duzc2.test.luaj.debugger");
5 --require('net.duzc2.test.luaj.debugger')('127.0.0.1', 12000, 'luaidekey','socket','win','F:\SVN文档\newProject\plasticine\codeFragment\luaj-test\src\main\java')
6 -- require 'net.duzc2.test.luaj.OneArgFunc'
7 -- require 'net.duzc2.test.luaj.test'
8 --luaSocket = require('net.duzc2.test.luaj.socket.LuaSocket');
9 --luaSocket.sleep(60)
10 -- print (libA.sinh(0.3),"a")
11 -- print (libA.t('abc'))
12 -- print (libA.toJson(m),"a")
13 --print(toJSON(a))
14 function main()
15 local m=1;
16 print("Hello Debug! 1");
17 -- require("socket").sleep(10);
18 print("running:",coroutine.running());
19 print("Hello Debug! 2")
20 end
21 print(1);
22 main();
23 am = 4
24 print(am)

and I run the lua code from Eclipse and debug it from LDT.I set a breakpoint at line 19 and line 23.
but in my debug view from the LDT , it always break out of my breakpoint function.

I debug the luaj from Eclipse , it shows that :
CallFrame.f.checkclosure().p.lineinfo = [20, 14, 21, 21, 21, 22, 22, 23, 24, 24, 24, 25, 25, 25]
i found it from DebugLib:687.
and the pc is 6 , so I get the line number is 22.
BUT the line number must be 19 ~~!! because the debug.getinfo function return the currentline is 19 , and my breakpoint is 19..

HELP ME!! please.
25 return nil

Discussion

  • Duzc2

    Duzc2 - 2014-07-29

    Email me if you need more infomation .

     
    • Duzc2

      Duzc2 - 2014-07-29

      duzc2dtw#gmail.com

       
  • Duzc2

    Duzc2 - 2014-07-29

    these means that .. when the program in a break status . every time call debug.getinfo , it returns different currentline .. OMG ...

     
  • Duzc2

    Duzc2 - 2014-07-29

    I'm SOrry .. i must made a misunderstand ...
    the real problem is lost a level of stack ...
    I should open another post ...
    you may close this post.

     
    • Duzc2

      Duzc2 - 2014-07-30

      no...don't close it ..
      I think there is must be some bugs in debuglib ..
      it does not work with LDT's debugger.lua and ZeroBraneStudioEduPack-0.70-win32 's modebug.lua
      and I'm sure I make a very good luaSocket impl via java..
      email me . I'll show more infomation...
      too much files to show you .

       

Log in to post a comment.