pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Dave Page <dpage@postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Default to hidden visibility for extension libraries where possi
Date: Wed, 20 Jul 2022 11:11:51 -0400
Message-ID: <1723772.1658329911@sss.pgh.pa.us> (raw)
In-Reply-To: <20220720140430.2s6nyy5s6b4rpu23@alvherre.pgsql>
References: <20220720140430.2s6nyy5s6b4rpu23@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Jul-20, Tom Lane wrote:
>> I'll try to do some research later today to identify anything else
>> we need to mark in plpgsql.  I recall doing some work specifically
>> creating functions for pldebugger's use, but I'll need to dig.

> I suppose you're probably thinking of commit 53ef6c40f1e7; that didn't
> expose functions directly, but through plpgsql_plugin_ptr.  Maybe that
> one does need to be made PGDLLEXPORT, since currently it isn't.

After some experimentation, it does not need to be marked: pldebugger
gets at that via find_rendezvous_variable(), so there is no need for
any explicit linkage at all between plpgsql.so and plugin_debugger.so.

Along the way, I made a quick hack to get pldebugger to load into
v15/HEAD.  It lacks #ifdef's which'd be needed so that it'd still
compile against older branches, but perhaps this'll save someone
some time.

			regards, tom lane

Attachments:

pldebugger-shmem.patch (text/x-diff, 1.3K) download diff --git a/plugin_debugger.c b/plugin_debugger.c index 6620021..1bd2057 100644 --- a/plugin_debugger.c +++ b/plugin_debugger.c @@ -114,6 +114,8 @@ static debugger_language_t *debugger_languages[] = { NULL }; +static shmem_request_hook_type prev_shmem_request_hook = NULL; + /********************************************************************** * Function declarations **********************************************************************/ @@ -124,6 +126,7 @@ void _PG_init( void ); /* initialize this module when we are dynamically load * Local (hidden) function prototypes **********************************************************************/ +static void pldebugger_shmem_request( void ); //static char ** fetchArgNames( PLpgSQL_function * func, int * nameCount ); static void * writen( int peer, void * src, size_t len ); static bool connectAsServer( void ); @@ -154,6 +157,15 @@ void _PG_init( void ) for (i = 0; debugger_languages[i] != NULL; i++) debugger_languages[i]->initialize(); + prev_shmem_request_hook = shmem_request_hook; + shmem_request_hook = pldebugger_shmem_request; +} + +static void pldebugger_shmem_request( void ) +{ + if (prev_shmem_request_hook) + prev_shmem_request_hook(); + reserveBreakpoints(); dbgcomm_reserve(); }

view thread (27+ messages)  latest in thread

Message-ID: <1723772.1658329911@sss.pgh.pa.us>
Permalink:  ../1723772.1658329911@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1723772.1658329911@sss.pgh.pa.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, dpage@postgresql.org, andres@anarazel.de, pavel.stehule@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Default to hidden visibility for extension libraries where possi
  In-Reply-To: <1723772.1658329911@sss.pgh.pa.us>
  References: <20220720140430.2s6nyy5s6b4rpu23@alvherre.pgsql> <1723772.1658329911@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox