View | Details | Raw Unified | Return to bug 219028 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (+3 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	gdb
4
PORTNAME=	gdb
5
PORTVERSION=	7.12.1
5
PORTVERSION=	7.12.1
6
PORTREVISION=	1
6
CATEGORIES=	devel
7
CATEGORIES=	devel
7
MASTER_SITES=	GNU
8
MASTER_SITES=	GNU
8
9
Lines 98-103 Link Here
98
do-install-KGDB-on:
99
do-install-KGDB-on:
99
	${INSTALL_PROGRAM} ${WRKSRC}/gdb/kgdb \
100
	${INSTALL_PROGRAM} ${WRKSRC}/gdb/kgdb \
100
		${STAGEDIR}${PREFIX}/bin/kgdb${VER}
101
		${STAGEDIR}${PREFIX}/bin/kgdb${VER}
102
	${INSTALL_MAN} ${FILESDIR}/kgdb/kgdb.1 \
103
		${STAGEDIR}${MAN1PREFIX}/man/man1/kgdb${VER}.1
101
104
102
do-install-TUI-on:
105
do-install-TUI-on:
103
	${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER}
106
	${LN} -sf gdb${VER} ${STAGEDIR}${PREFIX}/bin/gdbtui${VER}
(-)files/extrapatch-kgdb (+10 lines)
Lines 95-100 Link Here
95
 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
95
 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
96
 #undef HAVE_LANGINFO_CODESET
96
 #undef HAVE_LANGINFO_CODESET
97
 
97
 
98
diff --git gdb/config/mips/fbsd.mh gdb/config/mips/fbsd.mh
99
index f433347a20..5470795612 100644
100
--- gdb/config/mips/fbsd.mh
101
+++ gdb/config/mips/fbsd.mh
102
@@ -1,3 +1,5 @@
103
 # Host: FreeBSD/mips
104
 NATDEPFILES= fork-child.o inf-ptrace.o fbsd-nat.o mips-fbsd-nat.o
105
 HAVE_NATIVE_GCORE_HOST = 1
106
+
107
+LOADLIBES= -lkvm
98
diff --git gdb/configure gdb/configure
108
diff --git gdb/configure gdb/configure
99
index b5c045cf10..68299ff16c 100755
109
index b5c045cf10..68299ff16c 100755
100
--- gdb/configure
110
--- gdb/configure
(-)files/kgdb/fbsd-kld.c (-4 / +8 lines)
Lines 150-161 Link Here
150
150
151
	info = get_kld_info();
151
	info = get_kld_info();
152
	if (exec_bfd) {
152
	if (exec_bfd) {
153
		kernel_dir = dirname(bfd_get_filename(exec_bfd));
153
		kernel_dir = ldirname(bfd_get_filename(exec_bfd));
154
		if (kernel_dir != NULL) {
154
		if (kernel_dir != NULL) {
155
			cleanup = make_cleanup(xfree, kernel_dir);
155
			snprintf(path, path_size, "%s/%s", kernel_dir,
156
			snprintf(path, path_size, "%s/%s", kernel_dir,
156
			    filename);
157
			    filename);
157
			if (check_kld_path(path, path_size))
158
			if (check_kld_path(path, path_size)) {
159
				do_cleanups(cleanup);
158
				return (1);
160
				return (1);
161
			}
162
			do_cleanups(cleanup);
159
		}
163
		}
160
	}
164
	}
161
	if (info->module_path_addr != 0) {
165
	if (info->module_path_addr != 0) {
Lines 206-212 Link Here
206
	struct kld_info *info;
210
	struct kld_info *info;
207
	CORE_ADDR kld;
211
	CORE_ADDR kld;
208
	char *kld_filename;
212
	char *kld_filename;
209
	char *filename;
213
	const char *filename;
210
	int error;
214
	int error;
211
215
212
	info = get_kld_info();
216
	info = get_kld_info();
Lines 214-220 Link Here
214
	    info->off_filename == 0 || info->off_next == 0)
218
	    info->off_filename == 0 || info->off_next == 0)
215
		return (0);
219
		return (0);
216
220
217
	filename = basename(arg);
221
	filename = lbasename(arg);
218
	for (kld = read_pointer(info->linker_files_addr); kld != 0;
222
	for (kld = read_pointer(info->linker_files_addr); kld != 0;
219
	     kld = read_pointer(kld + info->off_next)) {
223
	     kld = read_pointer(kld + info->off_next)) {
220
		/* Try to read this linker file's filename. */
224
		/* Try to read this linker file's filename. */
(-)files/kgdb/kgdb.1 (+140 lines)
Line 0 Link Here
1
.\" Copyright (c) 2004 Marcel Moolenaar
2
.\" All rights reserved.
3
.\"
4
.\" Redistribution and use in source and binary forms, with or without
5
.\" modification, are permitted provided that the following conditions
6
.\" are met:
7
.\" 1. Redistributions of source code must retain the above copyright
8
.\"    notice, this list of conditions and the following disclaimer.
9
.\" 2. Redistributions in binary form must reproduce the above copyright
10
.\"    notice, this list of conditions and the following disclaimer in the
11
.\"    documentation and/or other materials provided with the distribution.
12
.\"
13
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
20
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23
.\" SUCH DAMAGE.
24
.\"
25
.\" $FreeBSD: head/gnu/usr.bin/gdb/kgdb/kgdb.1 246958 2013-02-19 02:09:18Z adrian $
26
.\"
27
.Dd October 11, 2006
28
.Dt KGDB 1
29
.Os
30
.Sh NAME
31
.Nm kgdb
32
.Nd "kernel debugger"
33
.Sh SYNOPSIS
34
.Nm
35
.Op Fl a | Fl f | Fl fullname
36
.Op Fl b Ar rate
37
.Op Fl q | Fl quiet
38
.Op Fl v
39
.Op Fl w
40
.Op Fl d Ar crashdir
41
.Op Fl c Ar core | Fl n Ar dumpnr | Fl r Ar device
42
.Op Ar kernel Op Ar core
43
.Sh DESCRIPTION
44
The
45
.Nm
46
utility is a debugger based on
47
.Xr gdb 1
48
that allows debugging of kernel core files.
49
.Pp
50
The options are as follows:
51
.Bl -tag -width ".Fl d Ar crashdir"
52
.It Fl a
53
Increase the annotation level.
54
An annotation level of 1 features the historical
55
.Fl fullname
56
option of
57
.Xr gdb 1 .
58
This is useful when running
59
.Nm
60
in Emacs.
61
The
62
.Fl f
63
or
64
.Fl fullname
65
options are supported for backward compatibility as well.
66
.It Fl b Ar rate
67
Set the baudrate to
68
.Ar rate .
69
.It Fl q
70
Suppress printing of the banner when the debugger starts.
71
The
72
.Fl quiet
73
form is supported for compatibility as well.
74
.It Fl v
75
Increase verbosity.
76
.It Fl w
77
Opens kmem-based targets in read-write mode.
78
(This is identical to what
79
.Fl -wcore
80
used to do in previous
81
gdb versions for
82
.Fx . )
83
.It Fl d Ar crashdir
84
Use
85
.Ar crashdir
86
instead of the default,
87
.Pa /var/crash
88
to locate kernel core dump files in.
89
The name
90
.Pa vmcore.
91
plus the dump number will be appended to determine
92
the actual dump file name.
93
.It Fl c Ar core
94
Explicitly use
95
.Ar core
96
as the core dump file.
97
.It Fl n Ar dumpnr
98
Use the kernel core dump file numbered
99
.Ar dumpnr
100
for debugging.
101
.It Fl r Ar device
102
Use
103
.Ar device
104
to connect
105
.Nm
106
to for a remote debugging session.
107
.El
108
.Pp
109
The
110
.Fl c , n ,
111
and
112
.Fl r
113
options are mutually exclusive.
114
.Pp
115
Optionally, the name of the kernel symbol file and
116
the name of the core dump file can be supplied on the
117
command-line as positional arguments.
118
If no kernel symbol file name has been given, the
119
symbol file of the currently running kernel will be
120
used.
121
If no core dump file has been specified through either
122
of the options or the last command-line argument,
123
.Pa /dev/mem
124
will be opened to allow debugging the currently running
125
kernel.
126
.Sh FILES
127
.Bl -tag -width ".Pa /var/crash"
128
.It Pa /dev/mem
129
Default memory image to open if no core dump file
130
has been specified.
131
.It Pa /var/crash
132
Default directory to locate kernel core dump files.
133
.El
134
.Sh SEE ALSO
135
.Xr gdb 1
136
.Sh HISTORY
137
The
138
.Nm
139
utility first appeared in its current form in
140
.Fx 5.3 .

Return to bug 219028