public inbox for
 help / color / mirror / Atom feed
From: Gary Benson <>
Subject: [RFC 4/5] Declare Infinity proc_service functions in gdb_proc_service.h
Date: Thu, 08 Jun 2017 09:24:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

This commit adds declarations for the two new proc_service functions
required by Infinity


	* gdb_proc_service.h (ps_infinity_reloc_f): New typedef.
	(ps_visit_infinity_note_f): Likewise.
	(ps_get_register): New declaration.
	(ps_foreach_infinity_note): Likewise.
 gdb/ChangeLog          |  7 +++++++
 gdb/gdb_proc_service.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/gdb/gdb_proc_service.h b/gdb/gdb_proc_service.h
index 734fcb2..59b8d6e 100644
--- a/gdb/gdb_proc_service.h
+++ b/gdb/gdb_proc_service.h
@@ -175,6 +175,52 @@ typedef gdb_fpregset_t gdb_prfpregset_t;
 typedef prfpregset_t gdb_prfpregset_t;
+/* XXX need to check for ps_get_register and ps_foreach_infinity_note
+   in ./configure if HAVE_PROC_SERVICE_H and only define them here if
+   we don't already have them.  */
+/* Get the contents of a single register.  */
+extern ps_err_e ps_get_register (struct ps_prochandle *ph,
+				 lwpid_t lwpid, int dwarf_regnum,
+				 psaddr_t *result);
+/* Callback to relocate addresses in Infinity notes.  */
+typedef ps_err_e ps_infinity_reloc_f (void *rf_arg,
+				      psaddr_t unrelocated,
+				      psaddr_t *result);
+/* Callback for iteration over Infinity notes.  Should return PS_OK to
+   indicate success, or any other value to indicate failure.  CB_ARG
+   is whatever was passed as CB_ARG to ps_foreach_infinity_note.  BUF
+   is is a pointer to a buffer of BUFSIZ bytes containing the encoded
+   note.  SRCNAME is an identifier used to construct error messages,
+   typically a filename, and may be NULL if unset.  SRCOFFSET is the
+   offset into SRCNAME of the start of BUF, and may be -1 if unset.
+   RF is a function that should be used to relocate addresses in this
+   notes, and RF_ARG is an argument that should be passed as to RF.  */
+typedef ps_err_e ps_visit_infinity_note_f (void *cb_arg,
+					   const char *buf,
+					   size_t bufsiz,
+					   const char *srcname,
+					   ssize_t srcoffset,
+					   ps_infinity_reloc_f *rf,
+					   void *rf_arg);
+/* Call the callback CB for each Infinity note in the process.  The
+   callback should return PS_OK to indicate that iteration should
+   continue, or any other value to indicate that iteration should stop
+   and that ps_foreach_infinity_note should return the non-PS_OK value
+   that the callback returned.  Return PS_OK if the callback returned
+   PS_OK for all Infinity notes, or if there are no Infinity notes in
+   the process.  */
+extern ps_err_e ps_foreach_infinity_note (struct ps_prochandle *ph,
+					  ps_visit_infinity_note_f *cb,
+					  void *cb_arg);
 /* GDB specific structure that identifies the target process.  */
 struct ps_prochandle

      parent reply	other threads:[~2017-06-08  9:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08  9:15 [RFC 0/5] New proc_service functionality for Infinity Gary Benson
2017-06-08  9:15 ` [RFC 2/5] Add NT_GNU_INFINITY Gary Benson
2017-06-08  9:15 ` [RFC 3/5] Support ELF Infinity notes Gary Benson
2017-06-08  9:15 ` [RFC 1/5] Add FS_BASE and GS_BASE to DWARF register table on amd64 Gary Benson
2017-06-08  9:24 ` [RFC 5/5] Implement Infinity proc_service functions in GDB Gary Benson
2017-06-08  9:24 ` Gary Benson [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).