Re: Printing bitmap objects in the debugger - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Re: Printing bitmap objects in the debugger
Date
Msg-id CABOikdPyW+0Fi9VHE1Q5ivhrfVpgK4d_abAr=s+bmv-OSk2uCw@mail.gmail.com
Whole thread Raw
In response to Printing bitmap objects in the debugger  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: Printing bitmap objects in the debugger  (Pavan Deolasee <pavan.deolasee@gmail.com>)
List pgsql-hackers


On Wed, Sep 14, 2016 at 3:43 PM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote:
Hi All,
While working on partition-wise join, I had to examine Relids objects
many times. Printing the Bitmapset::words[] in binary format and then
inferring the relids takes time and is error prone. Instead I wrote a
function bms_to_char() which allocates a StringInfo, calls
outBitmapset() to decode Bitmapset as a set of integers and returns
the string. In order to examine a Relids object all one has to do is
execute 'p bms_to_char(bms_object) under gdb.


Can we not do this as gdb macros? My knowledge is rusty in this area and lately I'm using LVM debugger (which probably does not have something equivalent), but I believe gdb allows you to write useful macros. As a bonus, you can then use them even for inspecting core files.

Thanks,
Pavan 

--
 Pavan Deolasee                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: [PATCH] SortSupport for macaddr type
Next
From: valeriof
Date:
Subject: Error running custom plugin: “output plugins have to declare the _PG_output_plugin_init symbol”