From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] Collect return addresses at tracepoints
Date: Thu, 22 Sep 2011 23:42:00 -0000 [thread overview]
Message-ID: <4E7BC595.50708@codesourcery.com> (raw)
In-Reply-To: <4E7A5B0C.2020802@earthlink.net>
On 09/22/2011 05:45 AM, Stan Shebs wrote:
Stan,
I don't know the code very well, just two cents on function comment.
> Index: amd64-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
> \f
> + /* Generate a bytecode expression to get the value of the saved PC.
> + Since this is supposed to run on the target independently of GDB,
> + we don't have the full power of the unwinding machinery. Instead,
> + make a guess as to the most likely location of the return address,
> + and issue byte codes for that. */
> +
> + void
> + amd64_gen_return_address (struct gdbarch *gdbarch,
> + struct agent_expr *ax, struct axs_value *value,
> + CORE_ADDR scope)
The comments on function amd64_gen_return_address and
i386_gen_return_address are identical. I suggest that we move this
comment to gdbarch.sh ...
and write comment on function amd64_gen_return_address and
i386_gen_return_address like this,
/* This is the implementation of gdbarch method gen_return_address. */
> Index: gdbarch.sh
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbarch.sh,v
> retrieving revision 1.523
> diff -p -r1.523 gdbarch.sh
> *** gdbarch.sh 22 Jul 2011 15:31:50 -0000 1.523
> --- gdbarch.sh 21 Sep 2011 21:27:00 -0000
> *************** v:const char *:solib_symbols_extension::
> *** 820,825 ****
> --- 820,829 ----
> # is, absolute paths include a drive name, and the backslash is
> # considered a directory separator.
> v:int:has_dos_based_file_system:::0:0::0
> +
> + # Generate bytecodes to collect the return address in a frame.
> + m:void:gen_return_address:struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope:ax, value, scope::default_gen_return_address::0
> +
... here, and document the each parameter in comment.
> Index: i386-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386-tdep.c,v
> \f
> + /* Generate a bytecode expression to get the value of the saved PC.
> + Since this is supposed to run on the target independently of GDB,
> + we don't have the full power of the unwinding machinery. Instead,
> + make a guess as to the most likely location of the return address,
> + and issue byte codes for that. */
> +
> + void
> + i386_gen_return_address (struct gdbarch *gdbarch,
> + struct agent_expr *ax, struct axs_value *value,
> + CORE_ADDR scope)
--
Yao (é½å°§)
next prev parent reply other threads:[~2011-09-22 23:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 22:48 Stan Shebs
2011-09-22 18:22 ` Eli Zaretskii
2011-09-23 7:34 ` Stan Shebs
2011-09-23 8:45 ` Eli Zaretskii
2011-09-22 23:42 ` Yao Qi [this message]
2011-09-24 9:19 ` Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E7BC595.50708@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox