From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126096 invoked by alias); 8 Jun 2017 09:24:51 -0000 Mailing-List: contact infinity-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: infinity-owner@sourceware.org Received: (qmail 124325 invoked by uid 89); 8 Jun 2017 09:24:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2740, xxx X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Jun 2017 09:24:47 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59497334583; Thu, 8 Jun 2017 09:15:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 59497334583 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=gbenson@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 59497334583 Received: from blade.nx (unknown [10.33.36.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18F0F8640B; Thu, 8 Jun 2017 09:15:46 +0000 (UTC) Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id BAF1A8105A0B; Thu, 8 Jun 2017 10:15:44 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Cc: infinity@sourceware.org Subject: [RFC 4/5] Declare Infinity proc_service functions in gdb_proc_service.h Date: Thu, 08 Jun 2017 09:24:00 -0000 Message-Id: <1496913338-22195-5-git-send-email-gbenson@redhat.com> In-Reply-To: <1496913338-22195-1-git-send-email-gbenson@redhat.com> References: <1496913338-22195-1-git-send-email-gbenson@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 08 Jun 2017 09:15:46 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2017-q2/txt/msg00015.txt.bz2 This commit adds declarations for the two new proc_service functions required by Infinity libthread_db.so. gdb/ChangeLog: * 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; #endif +/* 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. */ + +EXTERN_C_PUSH + +/* 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); + +EXTERN_C_POP + /* GDB specific structure that identifies the target process. */ struct ps_prochandle { -- 1.8.3.1