Code Monkey home page Code Monkey logo

gdbpg's Introduction

Postgres and GPDB GDB commands

GDB commands making debugging Postgres and Greenplum internals easier. Currently this provides a single command 'pgprint' that understand the 'Node' structures used internally, can can print them semi-intelligently.

Forked from PostgreSQL debugging tool found here:

https://github.com/tvondra/gdbpg

Usage

Copy the gdbpg.py script somewhere, and load it from gdb:

$ gdb ... 
(gdb) source /...path.../gdbpg.py 

and then just use pgprint command to print variables from gdb console. E.g. if plan is pointing to (PlannedStmt *), you may do this:

(gdb) pgprint plan

and you'll get something like this:

PlannedStmt [commandType=CMD_SELECT planGen=PLANGEN_PLANNER queryId=0 hasReturning=false hasModifyingCTE=false canSetTag=true transientPlan=false oneoffPlan=false
             simplyUpdatable=false dependsOnRole=false parallelModeNeeded=false numSlices=2 slices=0x56059fb60a08 subplan_sliceIds=0x56059fb61458 rewindPlanIDs=0x0
             nParamExec=0 query_mem=0 metricsQueryType=0 '\000']
	[planTree] 
		-> Motion [startup_cost=0 total_cost=2989 plan_rows=96300 plan_width=4 parallel_aware=false plan_node_id=0]
		          [motionType=MOTIONTYPE_GATHER sendSorted=false motionID=1 collations=0x0]
			[targetlist] 
				TargetEntry [resno=1 resname="a" resorigtbl=16392 resorigcol=1]
					Var [varno=OUTER_VAR varattno=1 vartype=23 varnoold=1 varoattno=1]
			[flow] Flow [flotype=FLOW_SINGLETON locustype=CdbLocusType_Entry segindex=-1 numsegments=3]
			[lefttree] 
				-> SeqScan [startup_cost=0 total_cost=1063 plan_rows=96300 plan_width=4 parallel_aware=false plan_node_id=1]
				           [scanrelid=1]
					[targetlist] 
						TargetEntry [resno=1 resname="a" resorigtbl=16392 resorigcol=1]
							Var [varno=1 varattno=1 vartype=23 varnoold=1 varoattno=1]
					[flow] Flow [flotype=FLOW_PARTITIONED locustype=CdbLocusType_Hashed segindex=0 numsegments=3]
	[rtable] 
		RangeTblEntry [rtekind=RTE_RELATION relid=16392 relkind='r' jointype=JOIN_INNER funcordinality=false ctelevelsup=0 self_reference=false forceDistRandom=false
		               lateral=false inFromCl=true requiredPerms=2 selectedCols=0x00000400]
	[relationOids] OidList: [16392]

gdbpg's People

Contributors

tvesely avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.