Re: [Beginner Question] How to print the call link graph? - Mailing list pgsql-general

From Julien Rouhaud
Subject Re: [Beginner Question] How to print the call link graph?
Date
Msg-id 20230701160859.oj743fqb564rlr45@jrouhaud
Whole thread Raw
In response to [Beginner Question] How to print the call link graph?  ("Wen Yi" <wen-yi@qq.com>)
List pgsql-general
On Sat, Jul 01, 2023 at 03:10:27PM +0800, Wen Yi wrote:
> Hi community,
> I use the gdb to track the postgres like this:
>
> ...
>
> pq_getbyte () at pqcomm.c:980
> 980     in pqcomm.c
> (gdb)  next
> [...]
> It's too slow to input 'next' to run the postgres, I used to try to use
> the  'continut', but the gdb will run the postgres directly and not
> print the function name and code line
>
>
> I want to it print like this:
>
>
> ... -> pq_getbyte () at pqcomm.c:980 -> SocketBackend (inBuf=0x7ffc8f7e1310) at postgres.c:372 -> ...
>
> Can someone provide me some advice?
> Thanks in advance!

I'm not sure what you want to do exactly, but just in case the usual way to do
is to put a breakpoint at the function you're interested in (e.g. "break
exec_simple_query"), or a specific line (e.g. "break filename.c:42"), and then
show the backtrace (backtrace or just bt).



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: [Beginner Question] How to print the call link graph?
Next
From: Garfield Lewis
Date:
Subject: Re: [EXT] Re: [Beginner Question] How to print the call link graph?