[PATCH] Documented the use of cyclic memory buffer log with lldb

Maxim Dounin mdounin at mdounin.ru
Wed Feb 22 03:42:29 UTC 2023


Hello!

On Tue, Feb 21, 2023 at 02:46:05PM +0400, Sergey Kandaurov wrote:

> # HG changeset patch
> # User Sergey Kandaurov <pluknet at nginx.com>
> # Date 1676976309 -14400
> #      Tue Feb 21 14:45:09 2023 +0400
> # Node ID 8cb435f59e89b34371bab83f8032efa0bea37817
> # Parent  159dc1fda0d7404aa012cad2ae37a770c4bb8164
> Documented the use of cyclic memory buffer log with lldb.
> 
> diff --git a/xml/en/docs/debugging_log.xml b/xml/en/docs/debugging_log.xml
> --- a/xml/en/docs/debugging_log.xml
> +++ b/xml/en/docs/debugging_log.xml
> @@ -8,7 +8,7 @@
>  <article name="A debugging log"
>           link="/en/docs/debugging_log.html"
>           lang="en"
> -         rev="5">
> +         rev="6">
>  
>  
>  <section>
> @@ -122,6 +122,13 @@ end
>  set $buf = (ngx_log_memory_buf_t *) $log->wdata
>  dump binary memory debug_log.txt $buf->start $buf->end
>  </example>
> +Or using an <command>lldb</command> script as follows:
> +<example>
> +expr ngx_log_t *$log = ngx_cycle->log
> +expr while ($log->writer != ngx_log_memory_writer) { $log = $log->next; }
> +expr ngx_log_memory_buf_t *$buf = (ngx_log_memory_buf_t *) $log->wdata
> +memory read --force --outfile debug_log.txt --binary $buf->start $buf->end
> +</example>
>  </para>
>  
>  </section>
> diff --git a/xml/ru/docs/debugging_log.xml b/xml/ru/docs/debugging_log.xml
> --- a/xml/ru/docs/debugging_log.xml
> +++ b/xml/ru/docs/debugging_log.xml
> @@ -8,7 +8,7 @@
>  <article name="Отладочный лог"
>           link="/ru/docs/debugging_log.html"
>           lang="ru"
> -         rev="5">
> +         rev="6">
>  
>  
>  <section>
> @@ -121,6 +121,13 @@ end
>  set $buf = (ngx_log_memory_buf_t *) $log->wdata
>  dump binary memory debug_log.txt $buf->start $buf->end
>  </example>
> +Или при помощи такого <command>lldb</command>-скрипта:
> +<example>
> +expr ngx_log_t *$log = ngx_cycle->log
> +expr while ($log->writer != ngx_log_memory_writer) { $log = $log->next; }
> +expr ngx_log_memory_buf_t *$buf = (ngx_log_memory_buf_t *) $log->wdata
> +memory read --force --outfile debug_log.txt --binary $buf->start $buf->end
> +</example>
>  </para>
>  
>  </section>

Looks fine.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list