Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2003 21:41:08 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 34394 for review
Message-ID:  <200307120441.h6C4f8uQ005193@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=34394

Change 34394 by marcel@marcel_nfs on 2003/07/11 21:40:17

	IFC @34393

Affected files ...

.. //depot/projects/ia64/UPDATING#44 integrate
.. //depot/projects/ia64/sys/contrib/ia64/libuwx/src/uwx_uinfo.c#2 integrate
.. //depot/projects/ia64/sys/ia64/ia64/db_trace.c#12 integrate
.. //depot/projects/ia64/sys/ia64/ia64/unwind.c#9 integrate
.. //depot/projects/ia64/sys/ia64/include/unwind.h#5 integrate
.. //depot/projects/ia64/sys/kern/kern_proc.c#43 integrate
.. //depot/projects/ia64/sys/sys/sysctl.h#16 integrate

Differences ...

==== //depot/projects/ia64/UPDATING#44 (text+ko) ====

@@ -17,6 +17,11 @@
 	developers choose to disable these features on build machines
 	to maximize performance.
 
+20030711:
+	gcc was upgraded to 3.3.  You are advised to not build -DNOCLEAN
+	across this point.  Further, it might be a good idea to remove
+	/usr/obj.
+
 20030613: [retrospective]
 	There was a small window in which sed(1) was broken.  If you
 	happen to have sed(1) installed during that window, which is
@@ -1309,4 +1314,4 @@
 Contact Warner Losh if you have any questions about your use of
 this document.
 
-$FreeBSD: src/UPDATING,v 1.255 2003/06/13 20:05:46 marcel Exp $
+$FreeBSD: src/UPDATING,v 1.258 2003/07/12 01:16:54 ceri Exp $

==== //depot/projects/ia64/sys/contrib/ia64/libuwx/src/uwx_uinfo.c#2 (text+ko) ====

@@ -232,9 +232,9 @@
 	if ((b0 & 0x20) == 0) {
 	    TRACE_I_DECODE_RHDR_1("(R1) prologue", b0)
 	    rhdr->is_prologue = 1;
+	} else {
+	    TRACE_I_DECODE_RHDR_1("(R1) body", b0)
 	}
-	else
-	    TRACE_I_DECODE_RHDR_1("(R1) body", b0)
 	rhdr->rlen = b0 & 0x1f;
     }
 
@@ -263,9 +263,9 @@
 	if ((b0 & 0x03) == 0) {
 	    TRACE_I_DECODE_RHDR_1L("(R3) prologue", b0, val)
 	    rhdr->is_prologue = 1;
+	} else {
+	    TRACE_I_DECODE_RHDR_1L("(R3) body", b0, val)
 	}
-	else
-	    TRACE_I_DECODE_RHDR_1L("(R3) body", b0, val)
 	rhdr->rlen = (unsigned int) val;
     }
 

==== //depot/projects/ia64/sys/ia64/ia64/db_trace.c#12 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/ia64/ia64/db_trace.c,v 1.16 2003/07/05 23:21:58 marcel Exp $
+ *	$FreeBSD: src/sys/ia64/ia64/db_trace.c,v 1.17 2003/07/12 04:35:09 marcel Exp $
  */
 
 #include <sys/param.h>
@@ -49,19 +49,23 @@
     char *modif)
 {
 	struct unw_regstate rs;
+	struct trapframe *tf;
 	const char *name;
 	db_expr_t offset;
-	uint64_t bsp, cfm, ip, pfs, reg;
+	uint64_t bsp, cfm, ip, pfs, reg, sp;
 	c_db_sym_t sym;
 	int args, error, i;
 
-	error = unw_create(&rs, &ddb_regs);
+	tf = &ddb_regs;
+	error = unw_create(&rs, tf);
 	while (!error && count--) {
 		error = unw_get_cfm(&rs, &cfm);
 		if (!error)
 			error = unw_get_bsp(&rs, &bsp);
 		if (!error)
 			error = unw_get_ip(&rs, &ip);
+		if (!error)
+			error = unw_get_sp(&rs, &sp);
 		if (error)
 			break;
 
@@ -98,6 +102,21 @@
 
 		db_printsym(ip, DB_STGY_PROC);
 		db_printf("\n");
+
+		if (error != EOVERFLOW)
+			continue;
+		if (sp < IA64_RR_BASE(5))
+			break;
+
+		tf = (struct trapframe *)(sp + 16);
+		if ((tf->tf_flags & FRAME_SYSCALL) != 0 ||
+		    tf->tf_special.iip < IA64_RR_BASE(5))
+			break;
+
+		/* XXX ask if we should unwind across the trapframe. */
+		db_printf("--- trapframe at %p\n", tf);
+		unw_delete(&rs);
+		error = unw_create(&rs, tf);
 	}
 
 	unw_delete(&rs);

==== //depot/projects/ia64/sys/ia64/ia64/unwind.c#9 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/unwind.c,v 1.8 2003/07/05 23:21:58 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/unwind.c,v 1.9 2003/07/12 04:35:09 marcel Exp $");
 
 #include "opt_ddb.h"
 
@@ -282,16 +282,19 @@
 unw_delete(struct unw_regstate *rs)
 {
 
-	uwx_free(rs->env);
+	if (rs->env != NULL)
+		uwx_free(rs->env);
 }
 
 int
 unw_step(struct unw_regstate *rs)
 {
-	int uwxerr;
+	int err;
 
-	uwxerr = uwx_step(rs->env);
-	return ((uwxerr) ? EINVAL : 0);		/* XXX */
+	err = uwx_step(rs->env);
+	if (err == UWX_ABI_FRAME)
+		return (EOVERFLOW);
+	return ((err != 0) ? EINVAL : 0);	/* XXX */
 }
 
 int
@@ -322,6 +325,15 @@
 }
 
 int
+unw_get_sp(struct unw_regstate *s, uint64_t *r)
+{
+	int uwxerr;
+
+	uwxerr = uwx_get_reg(s->env, UWX_REG_SP, r);
+	return ((uwxerr) ? EINVAL : 0); 	/* XXX */
+}
+
+int
 unw_table_add(uint64_t base, uint64_t start, uint64_t end)
 {
 	struct unw_table *ut;

==== //depot/projects/ia64/sys/ia64/include/unwind.h#5 (text+ko) ====

@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/ia64/include/unwind.h,v 1.4 2003/07/05 23:21:58 marcel Exp $
+ * $FreeBSD: src/sys/ia64/include/unwind.h,v 1.5 2003/07/12 04:35:09 marcel Exp $
  */
 
 #ifndef _MACHINE_UNWIND_H_
@@ -44,6 +44,7 @@
 int unw_get_bsp(struct unw_regstate *s, uint64_t *r);
 int unw_get_cfm(struct unw_regstate *s, uint64_t *r);
 int unw_get_ip(struct unw_regstate *s, uint64_t *r);
+int unw_get_sp(struct unw_regstate *s, uint64_t *r);
 
 int unw_table_add(uint64_t, uint64_t, uint64_t);
 void unw_table_remove(uint64_t);

==== //depot/projects/ia64/sys/kern/kern_proc.c#43 (text+ko) ====

@@ -31,11 +31,11 @@
  * SUCH DAMAGE.
  *
  *	@(#)kern_proc.c	8.7 (Berkeley) 2/14/95
- * $FreeBSD: src/sys/kern/kern_proc.c,v 1.190 2003/06/17 19:14:00 scottl Exp $
+ * $FreeBSD: src/sys/kern/kern_proc.c,v 1.191 2003/07/12 02:00:16 robert Exp $
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_proc.c,v 1.190 2003/06/17 19:14:00 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_proc.c,v 1.191 2003/07/12 02:00:16 robert Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_kstack_pages.h"
@@ -47,6 +47,7 @@
 #include <sys/malloc.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
+#include <sys/sysent.h>
 #include <sys/kse.h>
 #include <sys/sched.h>
 #include <sys/smp.h>
@@ -1127,6 +1128,31 @@
 	return (0);
 }
 
+static int
+sysctl_kern_proc_sv_name(SYSCTL_HANDLER_ARGS)
+{
+	struct proc *p;
+	char *sv_name;
+	int *name;
+	int namelen;
+
+	namelen = arg2;
+	if (namelen != 1) 
+		return (EINVAL);
+
+	name = (int *)arg1;
+	if ((p = pfind((pid_t)name[0])) == NULL)
+		return (0);
+	if (p_cansee(curthread, p)) {
+		PROC_UNLOCK(p);
+		return (0);
+	}
+	sv_name = p->p_sysent->sv_name;
+	PROC_UNLOCK(p);
+	return (sysctl_handle_string(oidp, sv_name, 0, req));
+}
+
+
 SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD,  0, "Process table");
 
 SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT,
@@ -1152,3 +1178,6 @@
 
 SYSCTL_NODE(_kern_proc, KERN_PROC_ARGS, args, CTLFLAG_RW | CTLFLAG_ANYBODY,
 	sysctl_kern_proc_args, "Process argument list");
+
+SYSCTL_NODE(_kern_proc, KERN_PROC_SV_NAME, sv_name, CTLFLAG_RD,
+	sysctl_kern_proc_sv_name, "Process syscall vector name (ABI type)");

==== //depot/projects/ia64/sys/sys/sysctl.h#16 (text+ko) ====

@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)sysctl.h	8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/sys/sys/sysctl.h,v 1.117 2003/06/12 16:34:19 scottl Exp $
+ * $FreeBSD: src/sys/sys/sysctl.h,v 1.118 2003/07/12 02:00:16 robert Exp $
  */
 
 #ifndef _SYS_SYSCTL_H_
@@ -413,6 +413,7 @@
 #define	KERN_PROC_RUID		6	/* by real uid */
 #define	KERN_PROC_ARGS		7	/* get/set arguments/proctitle */
 #define	KERN_PROC_PROC		8	/* only return procs */
+#define	KERN_PROC_SV_NAME	9	/* get syscall vector name */
 
 /*
  * KERN_IPC identifiers



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307120441.h6C4f8uQ005193>