Re: [Beginner Question] How to print the call link graph?

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Wen Yi <wen-yi(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: [Beginner Question] How to print the call link graph?
Date: 2023-07-01 16:08:59
Message-ID: 20230701160859.oj743fqb564rlr45@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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&nbsp;&nbsp;&nbsp;&nbsp; in pqcomm.c
> (gdb)&nbsp; next
> [...]
> It's too slow to input 'next' to run the postgres, I used to try to use
> the&nbsp; '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:
>
>
> ... -&gt; pq_getbyte () at pqcomm.c:980 -&gt; SocketBackend (inBuf=0x7ffc8f7e1310) at postgres.c:372 -&gt; ...
>
> 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).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Garfield Lewis 2023-07-01 17:05:29 Re: [EXT] Re: [Beginner Question] How to print the call link graph?
Previous Message Ron 2023-07-01 15:26:07 Re: [Beginner Question] How to print the call link graph?