Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.
/ jq-gdb Public archive

gdb pretty-printer for jv objects

License

Notifications You must be signed in to change notification settings

dtolnay/jq-gdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jq-gdb

A gdb pretty-printer for jv objects in jq and other programs using libjq.

Build Status

Works with Python 2.6, 2.7, 3.2, 3.3, and 3.4.

Setup

  • Clone this repo somewhere permanent
  • Create ~/.gdbinit if it does not already exist
  • Copy the contents of gdbinit.template to the end of ~/.gdbinit
  • Replace '/path/to/jq-gdb' with the path to the clone

Usage

david@genie:/github/jq$ gdb -q --args ./jq -n '{"k":"v"}'
Reading symbols from ./jq...done.
(gdb) break execute.c:162 if jv_get_kind(val) != JV_KIND_NULL
Breakpoint 1 at 0x491de8: file execute.c, line 162.
(gdb) run
Starting program: /github/jq/jq -n \{\"k\":\"v\"\}
Breakpoint 1, stack_push (jq=0x9b2c80, val=jv: {"k":"v"}) at execute.c:162
162	  jq->stk_top = stack_push_block(&jq->stk, jq->stk_top, sizeof(jv));
(gdb) print val
$1 = jv: {"k":"v"}
(gdb) print/r val
$2 = {kind_flags = 7 '\a', pad_ = 0 '\000', offset = 0, size = 8, u = {ptr = 0x9b4a90, number = 5.0281890807548674e-317}}
(gdb) print jv_array_set(jv_array(), 10, jv_string("hi"))
$3 = jv: [null,null,null,null,null,null,null,null,null,null,"hi"]
(gdb) quit

About

gdb pretty-printer for jv objects

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages