Re: [PATCH 1/2] new memory-changed MI notification.

Eli Zaretskii
2012-09-28T07:36:31Z

> From: Yao Qi <yao@codesourcery.com>
> Date: Fri, 28 Sep 2012 08:49:06 +0800
>
> Hi,
> There are usually two views in MI front-end, 'memory view' and 'code
> view', which displays the contents of 'data' and 'code'. If user
> modified memory in console, both views should be updated to show the
> latest contents. In order to achieve this, this patch adds a new MI
> notification '=memory-changed', so that MI front-ends can refresh its
> 'memory view' and 'code view' once this notification arrives.

Thanks.

> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -57,6 +57,8 @@ py [command]
> using new async records "=tsv-created" and "=tsv-deleted".
> ** The start and stop of process record are now notified using new
> async record "=record-started" and "=record-stopped".
> + ** Memory changes are now notified using new async record
> + "=memory-changed".

This part is OK.

> +@item =memory-changed,thread-group=@var{id},addr=@var{addr},len=@var{len}"[,type=@var{type}"]

I think the quotes should be deleted; I see no sign of them in the
code that produces the "type=..." part.

> +Reports that bytes from @var{addr} to @var{data} + @var{len} were
> +written in an inferior. The @var{id} is the identifier of the
> +thread group corresponding to the affected inferior. @var{type}
> +is the type of the section written to, @code{code}; it exists only
> +when the type of the section is known.

If @var{type} can only be "code", then I suggest to say

...[,type=code]

explicitly.

Btw, why "code"? If this is the name of the section, it should be
".text", not code.

> --- a/gdb/doc/observer.texi
> +++ b/gdb/doc/observer.texi
> @@ -230,9 +230,9 @@ The inferior @var{inf} has been removed from the list of inferiors.
> This method is called immediately before freeing @var{inf}.
> @end deftypefun
>
> -@deftypefun void memory_changed (CORE_ADDR @var{addr}, ssize_t @var{len}, const bfd_byte *@var{data})
> +@deftypefun void memory_changed (struct inferior *@var{inferior}, CORE_ADDR @var{addr}, ssize_t @var{len}, const bfd_byte *@var{data})
> Bytes from @var{data} to @var{data} + @var{len} have been written
> -to the current inferior at @var{addr}.
> +to the @var{inferior} at @var{addr}.
> @end deftypefun

This part is OK.

Thanks.