Re: format_datum debugging function

2024-08-15 Thread Tom Lane
Peter Eisentraut writes: > On 14.08.24 17:46, Paul Jungwirth wrote: >> Are you doing something to get macro expansion? I've never gotten my gdb >> to see #defines, although in theory this configure line should do it, >> right?: > Oh I see, you don't have the F_* constants available then. Maybe

Re: format_datum debugging function

2024-08-15 Thread Peter Eisentraut
On 14.08.24 17:46, Paul Jungwirth wrote: On 8/14/24 02:16, Peter Eisentraut wrote: On 12.08.24 23:15, Paul Jungwirth wrote: On 8/12/24 04:32, Aleksander Alekseev wrote: [...] This function takes a Datum and the appropriate out function, and returns a char *. So you can do this: (gdb) call fo

Re: format_datum debugging function

2024-08-14 Thread Paul Jungwirth
On 8/14/24 02:16, Peter Eisentraut wrote: On 12.08.24 23:15, Paul Jungwirth wrote: On 8/12/24 04:32, Aleksander Alekseev wrote: [...] This function takes a Datum and the appropriate out function, and returns a char *. So you can do this: (gdb) call format_datum(range_out, $1) $2 = 0x59162692d

Re: format_datum debugging function

2024-08-14 Thread Peter Eisentraut
On 12.08.24 23:15, Paul Jungwirth wrote: On 8/12/24 04:32, Aleksander Alekseev wrote: [...] This function takes a Datum and the appropriate out function, and returns a char *. So you can do this: (gdb) call format_datum(range_out, $1) $2 = 0x59162692d938 "[1,4)" I assume a patch like this doe

Re: format_datum debugging function

2024-08-12 Thread Jelte Fennema-Nio
On Mon, 12 Aug 2024 at 23:15, Paul Jungwirth wrote: > On 8/12/24 04:32, Aleksander Alekseev wrote: > >> (gdb) call format_datum(range_out, $1) > >> $2 = 0x59162692d938 "[1,4)" > >> > >> I assume a patch like this doesn't need documentation. Does it need a > >> test? Anything else? > > > > I think

Re: format_datum debugging function

2024-08-12 Thread Paul Jungwirth
h" Date: Fri, 9 Aug 2024 15:46:58 -0700 Subject: [PATCH v1] Add format_datum debugging function This function lets you say `call format_datum(foo_out, foo)` in your debugger to get a Datum as a readable string. It returns a char * instead of printing itself, since that seems more flexibl

Re: format_datum debugging function

2024-08-12 Thread Aleksander Alekseev
Hi Paul, > [...] This function takes a Datum and the appropriate out function, and > returns a char *. So you > can do this: > > (gdb) call format_datum(range_out, $1) > $2 = 0x59162692d938 "[1,4)" > > I assume a patch like this doesn't need documentation. Does it need a test? > Anything else?

format_datum debugging function

2024-08-09 Thread Paul Jungwirth
Hi Hackers, Often in a debugger I've wanted to way to print Datums, in particular non-trivial ones like range types. This came up a lot when I was working on multiranges, and I've wished for it lately while working on UPDATE/DELETE FOR PORTION OF. But all the obvious approaches are inlined func