# Visualizing Postgres page images within GDB

DevFeed: [Visualizing Postgres page images within GDB](<https://devfeed.tech/articles/visualizing-postgres-page-images-within-gdb-33663.md>)

Original publisher: [Read original article](<https://pgeoghegan.blogspot.com/2019/03/visualizing-postgres-page-images-within.html>)

Author: Peter Geoghegan (noreply@blogger.com)

Published: 2019-03-23T00:07:00Z

Content type: tutorial

Language: en

Sources: [Peter Geoghegan's blog](<https://devfeed.tech/sources/peter-geoghegan-s-blog.md>)

Topics: [gdb](<https://devfeed.tech/topics/gdb.md>), [debug](<https://devfeed.tech/topics/debug.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [command](<https://devfeed.tech/tags/command.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [gdb](<https://devfeed.tech/tags/gdb.md>), [interactive](<https://devfeed.tech/tags/interactive.md>), [internals](<https://devfeed.tech/tags/internals.md>), [pg-hexedit](<https://devfeed.tech/tags/pg-hexedit.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>)

## AI overview

This article explains how to configure GDB to invoke pg_hexedit on PostgreSQL page images without using the filesystem, including images from local temporary buffers. It also describes using a user-defined GDB command during debugging and with core dumps.

## Source excerpt

It's straightforward to set up GDB to quickly invoke pg_hexedit on a page image, without going through the filesystem. The page image can even come from a local temp buffer. A user-defined GDB command can be created that shows an arbitrary page image in pg_hexedit from an interactive GDB session. This is a good way to understand what's really going on when debugging access method code. It also works well with core dumps. I found this valuable during a recent project to improve the Postgres B-Tree code. An example of how to make this work is available from a newly added section of the pg_hexedit README file: https://github.com/petergeoghegan/pg_hexedit/#using-pg_hexedit-while-debugging-postgres-with-gdb