Giter Club home page Giter Club logo

lua-gdb-helper's Introduction

Lua GDB Helpers

This is a collection of several GDB macros that simplify debugging of C modules for Lua. Lua has to be compiled with debugging symbols, or the appropriate "dbg" package (i.e. liblua5.1-0-dbg in Debian/Ubuntu) needs to be installed.

Installation & Running

Copy the luagdb.txt file somewhere - installation complete.

To include the macros into your GDB session, run the following command:

source <path to luagdb.txt>

It is advisable to include the line into your ~/.gdbinit file (see the GDB documentation), so you do not have to type the command everytime you start GDB.

Reference

  • luastack [L] - lists the values on the current Lua C stack. By default, uses the current variable L as the lua_State pointer, however, an alternate lua_State can be provided as the first argument if needed.

  • luaprint < value > [verbose] - Pretty-prints a TValue passed as argument. Expects a pointer to a TValue. When verbose is 1, expands tables, metatables and userdata environments.

  • luaprinttable < table > - Pretty-prints a Lua Table. Expects a pointer to Table.

  • luavalue < index > [L] - Provides a pointer to a TValue from a stack index. By default, uses the current variable L as a lua_State pointer, but can be specified as the second argument. The return value is passed in variable $obj.

However, note that "pretty-printing" is not as pretty as it could be. First, the hash part is displayed, then the array part. Entries in hash part are separated by newlines, the ones in array part are displayed side-by-side.

License

Copyright (c) 2010 Michal Kottman, MIT License

lua-gdb-helper's People

Contributors

mkottman avatar pavouk avatar

Watchers

余香信息科技有限公司 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.