Re: ambuild parameters - Mailing list pgsql-general

From Aftab Alam
Subject Re: ambuild parameters
Date
Msg-id 003401c64d62$12eea000$ec1010ac@aftabn463
Whole thread Raw
In response to Re: ambuild parameters  (david.hoksza@seznam.cz)
List pgsql-general
unsubscribe

Regards,





-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of
david.hoksza@seznam.cz
Sent: Wednesday, March 22, 2006 5:49 AM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] ambuild parameters


I got problems when running gdb. In MINGW I run
"postgres -D ... dbname". Then I run gdb, but the problem is:

$ gdb
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
(gdb) attach 4204
Attaching to process 4204
[Switching to thread 4204.0x1750]
(gdb) dll-symbols libatomrtree.dll
(gdb) break atomrtbuild
(gdb) Cannot access memory at address 0x65dc2110

Probably the reason is, that the dll is not loaded yet? But what's the
right way to set breakpoint into dll, which isn't loaded yet?

And about the V1 convention - I got in the .c file:

PG_FUNCTION_INFO_V1(atomrtbuild);

Datum
atomrtbuild(PG_FUNCTION_ARGS)
{
        Relation                        heap_rel = (Relation)
PG_GETARG_POINTER(0);
        Relation                        index_rel = (Relation)
PG_GETARG_POINTER(1);
        IndexInfo                       *indexInfo = (IndexInfo *)
PG_GETARG_POINTER(2);


Thanks,
       David Hoksza
________________________________
20. března 2006, 23:20:12, napsal jste:

TL> david.hoksza@seznam.cz writes:
>> Thanks for answering, it was a good guess, I really didn't mark it,
>> but unfortunately it didn't solve my problem. It still falls down,
>> when I try to access the argument.
>> But it seems strange to me, that converting to Relation is OK:

>> Relation index_rel = (Relation) PG_GETARG_POINTER(1);

>> and also that comparing to NULL is OK:

>> if (index_rel == NULL).

TL> Neither of those prove a thing (except that you don't have a null
TL> pointer).  I'd still guess that you don't have the V1 parameter marking
TL> correct, and so what the function thinks it's picking up is garbage
TL> because the backend is not passing the parameters the way the function
TL> expects.

TL> You might try using gdb to see exactly what parameter values the
TL> function thinks it's getting, or print them out to the log before you
TL> use them.

TL>                         regards, tom lane

TL> ---------------------------(end of
TL> broadcast)---------------------------
TL> TIP 2: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: How I can get the real data type result instead of
Next
From: "surabhi.ahuja"
Date:
Subject: partial resultset in java