[04/12] gdbserver: add comments to read_inferior_memory function

Message ID c3fbbf5803c68dfde911948f84418ca6a8c5cbe3.1666341010.git.aburgess@redhat.com
State New
Headers
Series Infcalls from B/P conditions in multi-threaded inferiors |

Commit Message

Andrew Burgess Oct. 21, 2022, 8:43 a.m. UTC
  Just adding some comments to the gdbserver read_inferior_memory
function.  No actual code changes.
---
 gdbserver/target.cc     | 2 ++
 gdbserver/target.h      | 3 +++
 gdbserver/tracepoint.cc | 2 ++
 3 files changed, 7 insertions(+)
  

Comments

Andrew Burgess Jan. 13, 2023, 4:42 p.m. UTC | #1
Andrew Burgess <aburgess@redhat.com> writes:

> Just adding some comments to the gdbserver read_inferior_memory
> function.  No actual code changes.

I've gone ahead and pushed this.  I'm reasonably sure the comments I've
added are correct, I'm happy to update them if anyone disagrees.

Thanks,
Andrew


> ---
>  gdbserver/target.cc     | 2 ++
>  gdbserver/target.h      | 3 +++
>  gdbserver/tracepoint.cc | 2 ++
>  3 files changed, 7 insertions(+)
>
> diff --git a/gdbserver/target.cc b/gdbserver/target.cc
> index adcfe6e7bcc..6b29c99a61b 100644
> --- a/gdbserver/target.cc
> +++ b/gdbserver/target.cc
> @@ -79,6 +79,8 @@ set_desired_process ()
>    return proc != nullptr;
>  }
>  
> +/* See target.h.  */
> +
>  int
>  read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
>  {
> diff --git a/gdbserver/target.h b/gdbserver/target.h
> index 6c536a30778..a49d7d4bac0 100644
> --- a/gdbserver/target.h
> +++ b/gdbserver/target.h
> @@ -697,6 +697,9 @@ target_thread_pending_child (thread_info *thread)
>    return the_target->thread_pending_child (thread);
>  }
>  
> +/* Read LEN bytes from MEMADDR in the buffer MYADDR.  Return 0 if the read
> +   is successful, otherwise, return a non-zero error code.  */
> +
>  int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len);
>  
>  /* Set GDBserver's current thread to the thread the client requested
> diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
> index 18b2b0b3d77..efcdfe12beb 100644
> --- a/gdbserver/tracepoint.cc
> +++ b/gdbserver/tracepoint.cc
> @@ -344,6 +344,8 @@ tracepoint_look_up_symbols (void)
>     GDBserver side.  */
>  
>  #ifdef IN_PROCESS_AGENT
> +/* See target.h.  */
> +
>  int
>  read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
>  {
> -- 
> 2.25.4
  

Patch

diff --git a/gdbserver/target.cc b/gdbserver/target.cc
index adcfe6e7bcc..6b29c99a61b 100644
--- a/gdbserver/target.cc
+++ b/gdbserver/target.cc
@@ -79,6 +79,8 @@  set_desired_process ()
   return proc != nullptr;
 }
 
+/* See target.h.  */
+
 int
 read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 {
diff --git a/gdbserver/target.h b/gdbserver/target.h
index 6c536a30778..a49d7d4bac0 100644
--- a/gdbserver/target.h
+++ b/gdbserver/target.h
@@ -697,6 +697,9 @@  target_thread_pending_child (thread_info *thread)
   return the_target->thread_pending_child (thread);
 }
 
+/* Read LEN bytes from MEMADDR in the buffer MYADDR.  Return 0 if the read
+   is successful, otherwise, return a non-zero error code.  */
+
 int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len);
 
 /* Set GDBserver's current thread to the thread the client requested
diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index 18b2b0b3d77..efcdfe12beb 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -344,6 +344,8 @@  tracepoint_look_up_symbols (void)
    GDBserver side.  */
 
 #ifdef IN_PROCESS_AGENT
+/* See target.h.  */
+
 int
 read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 {