[Tile-serving] [openstreetmap/osm2pgsql] [demo] interactive debugging (Discussion #1796)

mmd notifications at github.com
Sat Oct 22 09:37:39 UTC 2022


Yes, that's also possible, although not all of the features are available. The embedded version can be used to wrap/intercept calls to lua_pcall, and register the embedded debugger as a message handler. Rather than calling `pcall_error_traceback_handler`, we would end up in the debugger.

## require 'debugger' 

```
debugger.lua: Loaded for Lua 5.2
2022-10-22 11:29:24  ERROR: Failed to execute Lua function 'osm2pgsql.process_node': generic.lua:234: assertion failed!
stack traceback:
	[C]: in function 'assert'
	generic.lua:234: in function <generic.lua:227>.
```
## Embedded debugger

```
debugger.lua: Loaded for Lua 5.2
ERROR: "generic.lua:234: assertion failed!"
break via dbg.msgh() => generic.lua:234 in chunk at generic.lua:227
debugger.lua> w
 229            return
 230        end
 231        
 232        if object.id == 500661 then
 233          --dbg()
 234 =>       assert(1 == 0)
 235        end
 236    
 237        tables.points:insert({
 238            tags = object.tags,
 239            geom = object:as_point()
debugger.lua>
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/discussions/1796#discussioncomment-3939241
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/repo-discussions/1796/comments/3939241 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20221022/8ed95bca/attachment-0001.htm>


More information about the Tile-serving mailing list