ports/71839: [PATCH] lang/m3gdb: unbreak on 5.x
Yen-Ming Lee
leeym at FreeBSD.org
Sat Sep 18 04:10:31 UTC 2004
>Number: 71839
>Category: ports
>Synopsis: [PATCH] lang/m3gdb: unbreak on 5.x
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Sep 18 04:10:31 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Yen-Ming Lee
>Release: FreeBSD 5.3-BETA4 i386
>Organization:
FreeBSD Taiwan
>Environment:
System: FreeBSD utopia.leeym.com 5.3-BETA4 FreeBSD 5.3-BETA4 #7: Mon Sep 13 05:12:30 CST 2004
>Description:
- unbreak it on 5.x
(tested on 4.9-RC and 5.3-BETA4)
Added file(s):
- files/patch-defs.h
- files/patch-top.c
Port maintainer (jdp at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:
--- m3gdb-4.17.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/m3gdb/Makefile,v
retrieving revision 1.14
diff -u -u -r1.14 Makefile
--- Makefile 6 Feb 2004 13:11:37 -0000 1.14
+++ Makefile 18 Sep 2004 04:05:57 -0000
@@ -23,16 +23,12 @@
.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 500113
-BROKEN= "Does not build"
-.endif
-
.if ${PORTOBJFORMAT} == "aout"
BROKEN= does not support a.out systems
.endif
pre-build:
- @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} make depend
- @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} make libbuild
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} depend
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} libbuild
.include <bsd.port.post.mk>
Index: files/patch-aa
===================================================================
RCS file: /home/pcvs/ports/lang/m3gdb/files/patch-aa,v
retrieving revision 1.3
diff -u -u -r1.3 patch-aa
--- files/patch-aa 10 Sep 1999 00:40:04 -0000 1.3
+++ files/patch-aa 18 Sep 2004 04:05:58 -0000
@@ -1,7 +1,6 @@
--- Makefile.orig Wed Feb 17 09:55:20 1999
+++ Makefile Wed Sep 8 09:35:39 1999
-@@ -1,23 +1,25 @@
- # $Id: Makefile,v 1.38 1998/10/15 14:15:09 bde Exp $
+@@ -2,22 +2,24 @@
-PROG = m3gdb
+PROG= m3gdb
Index: files/patch-ae
===================================================================
RCS file: /home/pcvs/ports/lang/m3gdb/files/patch-ae,v
retrieving revision 1.2
diff -u -u -r1.2 patch-ae
--- files/patch-ae 24 May 2002 04:42:51 -0000 1.2
+++ files/patch-ae 18 Sep 2004 04:05:58 -0000
@@ -1,22 +1,43 @@
---- src/gnu/usr.bin/gdb/gdb/freebsd-nat.c.orig Mon Sep 14 15:49:02 1998
-+++ src/gnu/usr.bin/gdb/gdb/freebsd-nat.c Thu May 23 21:36:56 2002
-@@ -115,9 +115,7 @@
+--- src/gnu/usr.bin/gdb/gdb/freebsd-nat.c.orig Tue Sep 15 06:49:02 1998
++++ src/gnu/usr.bin/gdb/gdb/freebsd-nat.c Sat Sep 18 10:54:57 2004
+@@ -108,17 +108,23 @@
+ * First get virtual address of user structure. Then calculate offset.
+ */
+ memcpy(&tmp_uaddr,
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ &((struct user *) core_reg_sect)->u_kproc.ki_addr,
++#else
+ &((struct user *) core_reg_sect)->u_kproc.kp_proc.p_addr,
++#endif
+ sizeof(tmp_uaddr));
+ offset = -reg_addr - (int) tmp_uaddr;
+
for (regno = 0; regno < NUM_REGS; regno++)
{
cregno = tregmap[regno];
- if (cregno == tFS)
- addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_fs);
- else if (cregno == tGS)
+- addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
+ if (cregno == tGS)
- addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ addr = offsetof (struct user, u_kproc) + offsetof (struct kinfo_proc, ki_pcb) + offsetof (struct pcb, pcb_gs);
++#else
++ addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
++#endif
else
addr = offset + 4 * cregno;
-@@ -136,7 +134,7 @@
+ if (addr < 0 || addr >= core_reg_size)
+@@ -136,7 +134,11 @@
error ("Register %s not found in core file.", reg_names[bad_reg]);
}
- addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_savefpu);
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ addr = offsetof (struct user, u_kproc) + offsetof (struct kinfo_proc, ki_pcb) + offsetof (struct pcb, pcb_save);
++#else
+ addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_save);
++#endif
memcpy (&pcb_savefpu, core_reg_sect + addr, sizeof pcb_savefpu);
}
@@ -28,7 +49,7 @@
static void
i387_to_double (from, to)
-@@ -331,36 +328,14 @@
+@@ -331,41 +328,19 @@
void
i386_float_info ()
{
@@ -68,3 +89,9 @@
}
else
fpstatep = &pcb_savefpu;
+
+- print_387_status (fpstatep->sv_ex_sw, (struct env387 *)fpstatep);
++ print_387_status (fpstatep->sv_env, (struct env387 *)fpstatep);
+ }
+ #endif /* FLOAT_INFO */
+
Index: files/patch-af
===================================================================
RCS file: /home/pcvs/ports/lang/m3gdb/files/patch-af,v
retrieving revision 1.1
diff -u -u -r1.1 patch-af
--- files/patch-af 8 Sep 1999 18:02:33 -0000 1.1
+++ files/patch-af 18 Sep 2004 04:05:58 -0000
@@ -1,6 +1,58 @@
---- kvm-fbsd.c.orig Sun Feb 7 04:36:10 1999
-+++ kvm-fbsd.c Wed Sep 8 10:38:14 1999
-@@ -835,9 +835,8 @@
+--- kvm-fbsd.c.orig Sun Feb 7 20:36:10 1999
++++ kvm-fbsd.c Sat Sep 18 11:23:31 2004
+@@ -22,6 +22,7 @@
+ #include <errno.h>
+ #include <signal.h>
+ #include <fcntl.h>
++#include <sys/types.h>
+ #include <sys/sysctl.h>
+ #include <sys/param.h>
+ #include <sys/time.h>
+@@ -361,10 +362,19 @@
+ struct user *uaddr;
+
+ /* find the pcb for the current process */
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ if (cur_proc == NULL || kvread (&cur_proc->p_uarea, &uaddr))
++#else
+ if (cur_proc == NULL || kvread (&cur_proc->p_addr, &uaddr))
++#endif
+ error ("cannot read u area ptr for proc at %#x", cur_proc);
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ if (read_pcb (core_kd, (CORE_ADDR)&uaddr->u_kproc.ki_pcb) < 0)
++ error ("cannot read pcb at %#x", &uaddr->u_kproc.ki_pcb);
++#else
+ if (read_pcb (core_kd, (CORE_ADDR)&uaddr->u_pcb) < 0)
+ error ("cannot read pcb at %#x", &uaddr->u_pcb);
++#endif
+ }
+
+ static void
+@@ -450,7 +451,11 @@
+ kp = kvm_getprocs(core_kd, KERN_PROC_PID, paddr, &cnt);
+ if (!cnt)
+ error("invalid pid");
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ if (set_proc_context((CORE_ADDR)kp->ki_paddr))
++#else
+ if (set_proc_context((CORE_ADDR)kp->kp_eproc.e_paddr))
++#endif
+ error("invalid proc address");
+ }
+ }
+@@ -643,7 +644,11 @@
+ return (0);
+ if (lp.p_pid != pid)
+ continue;
++#if defined(__FreeBSD__) && __FreeBSD__ >= 5
++ kp.ki_paddr = p;
++#else
+ kp.kp_eproc.e_paddr = p;
++#endif
+ *cnt = 1;
+ return (1);
+ }
+@@ -835,9 +836,8 @@
supply_register (6, (char *)&pcb.pcb_esi);
supply_register (7, (char *)&pcb.pcb_edi);
supply_register (PC_REGNUM, (char *)&pcb.pcb_eip);
@@ -11,3 +63,12 @@
supply_register (15, (char *)&pcb.pcb_gs);
/* XXX 80387 registers? */
+@@ -919,7 +919,7 @@
+ #if 0
+ kcore_stratum, /* to_stratum */
+ #else
+- NULL, /* haven't yet found this one... */
++ 0, /* haven't yet found this one... */
+ #endif
+ NULL, /* to_next */
+ 0, /* to_has_all_memory */
Index: files/patch-defs.h
===================================================================
RCS file: files/patch-defs.h
diff -N files/patch-defs.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-defs.h 18 Sep 2004 04:05:58 -0000
@@ -0,0 +1,13 @@
+--- defs.h.orig Sat Sep 18 11:08:32 2004
++++ defs.h Sat Sep 18 11:08:47 2004
+@@ -420,10 +420,6 @@
+
+ extern int read_relative_register_raw_bytes PARAMS ((int, char *));
+
+-/* From readline (but not in any readline .h files). */
+-
+-extern char *tilde_expand PARAMS ((char *));
+-
+ /* Control types for commands */
+
+ enum misc_command_type
Index: files/patch-top.c
===================================================================
RCS file: files/patch-top.c
diff -N files/patch-top.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-top.c 18 Sep 2004 04:05:58 -0000
@@ -0,0 +1,10 @@
+--- top.c.orig Sat Sep 18 11:05:40 2004
++++ top.c Sat Sep 18 11:06:55 2004
+@@ -1503,7 +1503,6 @@
+ char *word;
+ {
+ /* From readline. */
+- extern char *filename_completion_function PARAMS ((char *, int));
+ int subsequent_name;
+ char **return_val;
+ int return_val_used;
--- m3gdb-4.17.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list