Adjusting my IDE expectations for a C extension development
От | postgres@lobeshare.co.za |
---|---|
Тема | Adjusting my IDE expectations for a C extension development |
Дата | |
Msg-id | 12e8cf402e58da68ac2f58056282d259@lobeshare.co.za обсуждение исходный текст |
Список | pgsql-hackers |
Folks, Last time I wrote a C extension for PostgreSQL it was easy enough to write, debug and test the C functions separately as a terminal application before dropping main() into a #ifdef DEBUG to compile the extension with prescribed make command invoking PGXS. To get VSCode C/C++ Intellisense to not see everythjng as errors I just had to set the include path it uses to see find postgres.h That was then, but now I’m writing another extension and this time my C code has to interact with PostgreSQL memory contexts and management and I’m going to need to get some form of visibility of what’s happening run-time. The trouble is I’m getting nowhere fast trying to find a setup in VSCode that will let me build and hopefully debug my extension within that environment. What do you do? The only VS Code extension making any reference to PGXS is PostgreSQL Hacker Helper which hasn’t been updated forever. Internet “wisdom” suggests replacing PGXS with CMake but I’d like to remain as default and standard as possible which I see as sticking with PGXS, right? Am I barking up the wrong tree with VSCode in this situation? Though my primary desktop is macOS I do have a Win11 machine with Visual Studio Community but no local PostgreSQL yet and several Linux (mostly Ubuntu) servers including some with running PostgreSQL servers. If I knew it was the only feasible way I can easily pivot to developing the extension purely the Linux terminal way - I can still switch into vi mode when I have to. Whether VS Code is in the mix or a command line toolchain my only option, I’d still like to know what toolchain and basic workflow you’d use or recommend for active c extension development today. P.S. I have no need for or skills pertaining to C++ (nor Objective C, C# or Java for that matter).
В списке pgsql-hackers по дате отправления: