diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-17 19:00:01 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-17 19:00:01 -0300 |
| commit | d3037d97ec192e7719de485f15dacb473bf96528 (patch) | |
| tree | ea9f837cc64d9df82ae4324f2c7ea447b5c4582f /ldebug.c | |
| parent | c6b442bd369ce05b3d4bfb95ba64451521aa1b31 (diff) | |
| download | lua-d3037d97ec192e7719de485f15dacb473bf96528.tar.gz lua-d3037d97ec192e7719de485f15dacb473bf96528.tar.bz2 lua-d3037d97ec192e7719de485f15dacb473bf96528.zip | |
several small improvements based on 'ci' being fixed now (including
erasing savedpc from lua_State)
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 8 |
1 files changed, 3 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 2.45 2009/03/26 12:56:38 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.46 2009/04/17 14:28:06 roberto Exp roberto $ |
| 3 | ** Debug Interface | 3 | ** Debug Interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -35,9 +35,7 @@ static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); | |||
| 35 | 35 | ||
| 36 | static int currentpc (lua_State *L, CallInfo *ci) { | 36 | static int currentpc (lua_State *L, CallInfo *ci) { |
| 37 | if (!isLua(ci)) return -1; /* function is not a Lua function? */ | 37 | if (!isLua(ci)) return -1; /* function is not a Lua function? */ |
| 38 | if (ci == L->ci) | 38 | return pcRel(ci->u.l.savedpc, ci_func(ci)->l.p); |
| 39 | ci->savedpc = L->savedpc; | ||
| 40 | return pcRel(ci->savedpc, ci_func(ci)->l.p); | ||
| 41 | } | 39 | } |
| 42 | 40 | ||
| 43 | 41 | ||
| @@ -58,7 +56,7 @@ LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { | |||
| 58 | mask = 0; | 56 | mask = 0; |
| 59 | func = NULL; | 57 | func = NULL; |
| 60 | } | 58 | } |
| 61 | L->oldpc = L->savedpc; | 59 | L->oldpc = NULL; |
| 62 | L->hook = func; | 60 | L->hook = func; |
| 63 | L->basehookcount = count; | 61 | L->basehookcount = count; |
| 64 | resethookcount(L); | 62 | resethookcount(L); |
