View | Details | Raw Unified | Return to bug 206044
Collapse All | Expand All

(-)devel/gdb/Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	gdb
4
PORTNAME=	gdb
5
PORTVERSION=	7.10
5
PORTVERSION=	7.10
6
PORTREVISION=	4
6
PORTREVISION=	5
7
CATEGORIES=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	GNU
8
MASTER_SITES=	GNU
9
9
(-)devel/gdb/files/kgdb/amd64fbsd-kern.c (-1 / +1 lines)
Lines 210-216 Link Here
210
}
210
}
211
211
212
static const struct frame_unwind amd64fbsd_trapframe_unwind = {
212
static const struct frame_unwind amd64fbsd_trapframe_unwind = {
213
  NORMAL_FRAME,
213
  SIGTRAMP_FRAME,
214
  default_frame_unwind_stop_reason,
214
  default_frame_unwind_stop_reason,
215
  amd64fbsd_trapframe_this_id,
215
  amd64fbsd_trapframe_this_id,
216
  amd64fbsd_trapframe_prev_register,
216
  amd64fbsd_trapframe_prev_register,
(-)devel/gdb/files/kgdb/fbsd-kld.c (-3 lines)
Lines 386-394 Link Here
386
{
386
{
387
	struct kld_info *info;
387
	struct kld_info *info;
388
388
389
	if (!have_partial_symbols())
390
		return;
391
392
	info = get_kld_info();
389
	info = get_kld_info();
393
	
390
	
394
	/*
391
	/*
(-)devel/gdb/files/kgdb/i386fbsd-kern.c (-2 / +2 lines)
Lines 277-283 Link Here
277
}
277
}
278
278
279
static const struct frame_unwind i386fbsd_dblfault_unwind = {
279
static const struct frame_unwind i386fbsd_dblfault_unwind = {
280
  NORMAL_FRAME,
280
  SIGTRAMP_FRAME,
281
  default_frame_unwind_stop_reason,
281
  default_frame_unwind_stop_reason,
282
  i386fbsd_dblfault_this_id,
282
  i386fbsd_dblfault_this_id,
283
  i386fbsd_dblfault_prev_register,
283
  i386fbsd_dblfault_prev_register,
Lines 436-442 Link Here
436
}
436
}
437
437
438
static const struct frame_unwind i386fbsd_trapframe_unwind = {
438
static const struct frame_unwind i386fbsd_trapframe_unwind = {
439
  NORMAL_FRAME,
439
  SIGTRAMP_FRAME,
440
  default_frame_unwind_stop_reason,
440
  default_frame_unwind_stop_reason,
441
  i386fbsd_trapframe_this_id,
441
  i386fbsd_trapframe_this_id,
442
  i386fbsd_trapframe_prev_register,
442
  i386fbsd_trapframe_prev_register,
(-)devel/gdb/files/kgdb/kgdb-main.c (-18 / +12 lines)
Lines 62-71 Link Here
62
62
63
#include "kgdb.h"
63
#include "kgdb.h"
64
64
65
static int dumpnr;
66
static int verbose;
65
static int verbose;
67
66
68
static char crashdir[PATH_MAX];
67
static char crashdir[PATH_MAX];
68
static char *dumpnr;
69
static char *kernel;
69
static char *kernel;
70
static char *remote;
70
static char *remote;
71
static char *vmcore;
71
static char *vmcore;
Lines 96-102 Link Here
96
}
96
}
97
97
98
static void
98
static void
99
kernel_from_dumpnr(int nr)
99
kernel_from_dumpnr(const char *nr)
100
{
100
{
101
	char line[PATH_MAX], path[PATH_MAX];
101
	char line[PATH_MAX], path[PATH_MAX];
102
	FILE *info;
102
	FILE *info;
Lines 110-116 Link Here
110
	 * subdirectory kernel.<nr> and called kernel.  The latter allows us
110
	 * subdirectory kernel.<nr> and called kernel.  The latter allows us
111
	 * to collect the modules in the same place.
111
	 * to collect the modules in the same place.
112
	 */
112
	 */
113
	snprintf(path, sizeof(path), "%s/kernel.%d", crashdir, nr);
113
	snprintf(path, sizeof(path), "%s/kernel.%s", crashdir, nr);
114
	if (stat(path, &st) == 0) {
114
	if (stat(path, &st) == 0) {
115
		if (S_ISREG(st.st_mode)) {
115
		if (S_ISREG(st.st_mode)) {
116
			kernel = strdup(path);
116
			kernel = strdup(path);
Lines 117-123 Link Here
117
			return;
117
			return;
118
		}
118
		}
119
		if (S_ISDIR(st.st_mode)) {
119
		if (S_ISDIR(st.st_mode)) {
120
			snprintf(path, sizeof(path), "%s/kernel.%d/kernel",
120
			snprintf(path, sizeof(path), "%s/kernel.%s/kernel",
121
			    crashdir, nr);
121
			    crashdir, nr);
122
			if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
122
			if (stat(path, &st) == 0 && S_ISREG(st.st_mode)) {
123
				kernel = strdup(path);
123
				kernel = strdup(path);
Lines 133-139 Link Here
133
	 * with debugging info (called either kernel.full or kernel.debug).
133
	 * with debugging info (called either kernel.full or kernel.debug).
134
	 * If we have a debug kernel, use it.
134
	 * If we have a debug kernel, use it.
135
	 */
135
	 */
136
	snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr);
136
	snprintf(path, sizeof(path), "%s/info.%s", crashdir, nr);
137
	info = fopen(path, "r");
137
	info = fopen(path, "r");
138
	if (info == NULL) {
138
	if (info == NULL) {
139
		warn("%s", path);
139
		warn("%s", path);
Lines 223-229 Link Here
223
	char *s;
223
	char *s;
224
	int a, ch;
224
	int a, ch;
225
225
226
	dumpnr = -1;
226
	dumpnr = NULL;
227
227
228
	strlcpy(crashdir, "/var/crash", sizeof(crashdir));
228
	strlcpy(crashdir, "/var/crash", sizeof(crashdir));
229
	s = getenv("KGDB_CRASH_DIR");
229
	s = getenv("KGDB_CRASH_DIR");
Lines 284-296 Link Here
284
			annotation_level = 1;
284
			annotation_level = 1;
285
			break;
285
			break;
286
		case 'n':	/* use dump with given number. */
286
		case 'n':	/* use dump with given number. */
287
			dumpnr = strtol(optarg, &s, 0);
287
			dumpnr = optarg;
288
			if (dumpnr < 0 || *s != '\0') {
289
				warnx("option %c: invalid kernel dump number",
290
				    optopt);
291
				usage();
292
				/* NOTREACHED */
293
			}
294
			break;
288
			break;
295
		case 'q':
289
		case 'q':
296
			kgdb_quiet = 1;
290
			kgdb_quiet = 1;
Lines 317-323 Link Here
317
		}
311
		}
318
	}
312
	}
319
313
320
	if (((vmcore != NULL) ? 1 : 0) + ((dumpnr >= 0) ? 1 : 0) +
314
	if (((vmcore != NULL) ? 1 : 0) + ((dumpnr != NULL) ? 1 : 0) +
321
	    ((remote != NULL) ? 1 : 0) > 1) {
315
	    ((remote != NULL) ? 1 : 0) > 1) {
322
		warnx("options -c, -n and -r are mutually exclusive");
316
		warnx("options -c, -n and -r are mutually exclusive");
323
		usage();
317
		usage();
Lines 330-342 Link Here
330
	if (argc > optind)
324
	if (argc > optind)
331
		kernel = strdup(argv[optind++]);
325
		kernel = strdup(argv[optind++]);
332
326
333
	if (argc > optind && (dumpnr >= 0 || remote != NULL)) {
327
	if (argc > optind && (dumpnr != NULL || remote != NULL)) {
334
		warnx("options -n and -r do not take a core file. Ignored");
328
		warnx("options -n and -r do not take a core file. Ignored");
335
		optind = argc;
329
		optind = argc;
336
	}
330
	}
337
331
338
	if (dumpnr >= 0) {
332
	if (dumpnr != NULL) {
339
		snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr);
333
		snprintf(path, sizeof(path), "%s/vmcore.%s", crashdir, dumpnr);
340
		if (stat(path, &st) == -1)
334
		if (stat(path, &st) == -1)
341
			err(1, "%s", path);
335
			err(1, "%s", path);
342
		if (!S_ISREG(st.st_mode))
336
		if (!S_ISREG(st.st_mode))
Lines 372-378 Link Here
372
366
373
	/* If we don't have a kernel image yet, try to find one. */
367
	/* If we don't have a kernel image yet, try to find one. */
374
	if (kernel == NULL) {
368
	if (kernel == NULL) {
375
		if (dumpnr >= 0)
369
		if (dumpnr != NULL)
376
			kernel_from_dumpnr(dumpnr);
370
			kernel_from_dumpnr(dumpnr);
377
371
378
		if (kernel == NULL)
372
		if (kernel == NULL)
(-)devel/gdb/files/kgdb/ppcfbsd-kern.c (-1 / +1 lines)
Lines 189-195 Link Here
189
189
190
static const struct frame_unwind ppcfbsd_trapframe_unwind =
190
static const struct frame_unwind ppcfbsd_trapframe_unwind =
191
{
191
{
192
  NORMAL_FRAME,
192
  SIGTRAMP_FRAME,
193
  default_frame_unwind_stop_reason,
193
  default_frame_unwind_stop_reason,
194
  ppcfbsd_trapframe_this_id,
194
  ppcfbsd_trapframe_this_id,
195
  ppcfbsd_trapframe_prev_register,
195
  ppcfbsd_trapframe_prev_register,
(-)devel/gdb/files/kgdb/sparc64fbsd-kern.c (-1 / +1 lines)
Lines 159-165 Link Here
159
159
160
static const struct frame_unwind sparc64fbsd_trapframe_unwind =
160
static const struct frame_unwind sparc64fbsd_trapframe_unwind =
161
{
161
{
162
  NORMAL_FRAME,
162
  SIGTRAMP_FRAME,
163
  default_frame_unwind_stop_reason,
163
  default_frame_unwind_stop_reason,
164
  sparc64fbsd_trapframe_this_id,
164
  sparc64fbsd_trapframe_this_id,
165
  sparc64fbsd_trapframe_prev_register,
165
  sparc64fbsd_trapframe_prev_register,

Return to bug 206044