Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-07-30 Thread Peter Geoghegan
On Tue, Jul 30, 2013 at 10:33 AM, Greg Stark wrote: > I think there's some magic in gdb for this but I'm not sure how to > make it happen. If you figure it out I would think it would be > generally useful and we should find a way to put it in the source tree > so it works for everyone. You can wr

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-07-30 Thread Andres Freund
Hi, On 2013-06-26 13:27:15 +0900, Amit Langote wrote: > Is it possible to compute VARSIZE_ANY(PTR) during debugging? > > - > #define VARSIZE_ANY(PTR) \ > (VARATT_IS_1B_E(PTR) ? VARSIZE_1B_E(PTR) : \ > (VARATT_IS_1B(PTR) ? VA

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-07-30 Thread Amit Langote
On Wed, Jul 31, 2013 at 2:33 AM, Greg Stark wrote: > I think there's some magic in gdb for this but I'm not sure how to > make it happen. If you figure it out I would think it would be > generally useful and we should find a way to put it in the source tree > so it works for everyone. > > You migh

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-07-30 Thread Greg Stark
I think there's some magic in gdb for this but I'm not sure how to make it happen. If you figure it out I would think it would be generally useful and we should find a way to put it in the source tree so it works for everyone. You might find it useful to put breakpoints in heap_deformtuple() with

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-06-27 Thread Alvaro Herrera
Amit Langote escribió: > Looking at the attlen == -1 value in tupDescriptor of the > ResultTupleSlot, VARSIZE_ANY() is used to calculate the length and > added to offset, but I find no way to calculate that while I am > dubugging. I guess you could just add a few "macro define" lines to your .gdb

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-06-26 Thread Amit Langote
On Thu, Jun 27, 2013 at 12:02 AM, Alvaro Herrera wrote: > Amit Langote escribió: > >> The segfault in question happens at line 1141: >> >> off = att_align_pointer(off, thisatt->attalign, -1, tp + off); >> >> char *tp; /* ptr to tuple data */ >> longoff;

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-06-26 Thread Amit Langote
On Thu, Jun 27, 2013 at 12:02 AM, Alvaro Herrera wrote: > Amit Langote escribió: > >> The segfault in question happens at line 1141: >> >> off = att_align_pointer(off, thisatt->attalign, -1, tp + off); >> >> char *tp; /* ptr to tuple data */ >> longoff;

Re: [HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-06-26 Thread Alvaro Herrera
Amit Langote escribió: > The segfault in question happens at line 1141: > > off = att_align_pointer(off, thisatt->attalign, -1, tp + off); > > char *tp; /* ptr to tuple data */ > longoff;/* offset in tuple data */ > > Disassembling seems

[HACKERS] Computer VARSIZE_ANY(PTR) during debugging

2013-06-25 Thread Amit Langote
Hello, Is it possible to compute VARSIZE_ANY(PTR) during debugging? - #define VARSIZE_ANY(PTR) \ (VARATT_IS_1B_E(PTR) ? VARSIZE_1B_E(PTR) : \ (VARATT_IS_1B(PTR) ? VARSIZE_1B(PTR) : \ VARSIZE_4B(PTR))) #define VARA