[Midnightbsd-cvs] src [11048] trunk/contrib/gdb: sync with freebsd
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Jun 17 15:21:05 EDT 2018
Revision: 11048
http://svnweb.midnightbsd.org/src/?rev=11048
Author: laffer1
Date: 2018-06-17 15:20:35 -0400 (Sun, 17 Jun 2018)
Log Message:
-----------
sync with freebsd
Modified Paths:
--------------
trunk/contrib/gdb/FREEBSD-Xlist
trunk/contrib/gdb/FREEBSD-upgrade
trunk/contrib/gdb/gdb/ada-tasks.c
trunk/contrib/gdb/gdb/amd64fbsd-nat.c
trunk/contrib/gdb/gdb/corelow.c
trunk/contrib/gdb/gdb/doc/agentexpr.texi
trunk/contrib/gdb/gdb/doc/gdbint.texinfo
trunk/contrib/gdb/gdb/doc/stabs.texinfo
trunk/contrib/gdb/gdb/dwarf2expr.c
trunk/contrib/gdb/gdb/frame-unwind.c
trunk/contrib/gdb/gdb/gdb.1
trunk/contrib/gdb/gdb/mips-tdep.c
trunk/contrib/gdb/gdb/mipsfbsd-tdep.c
trunk/contrib/gdb/gdb/osabi.c
trunk/contrib/gdb/gdb/remote.c
trunk/contrib/gdb/gdb/std-regs.c
trunk/contrib/gdb/gdb/target.c
Modified: trunk/contrib/gdb/FREEBSD-Xlist
===================================================================
--- trunk/contrib/gdb/FREEBSD-Xlist 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/FREEBSD-Xlist 2018-06-17 19:20:35 UTC (rev 11048)
@@ -1,4 +1,4 @@
-$FreeBSD$
+$FreeBSD: stable/10/contrib/gdb/FREEBSD-Xlist 190827 2009-04-07 20:15:51Z emaste $
gdb-*/bfd/*
gdb-*/config/*
gdb-*/etc/*
Modified: trunk/contrib/gdb/FREEBSD-upgrade
===================================================================
--- trunk/contrib/gdb/FREEBSD-upgrade 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/FREEBSD-upgrade 2018-06-17 19:20:35 UTC (rev 11048)
@@ -1,4 +1,4 @@
-$FreeBSD$
+$FreeBSD: stable/10/contrib/gdb/FREEBSD-upgrade 131081 2004-06-25 05:04:09Z marcel $
To strip down a new version of gdb for import, extract the files like this:
Modified: trunk/contrib/gdb/gdb/ada-tasks.c
===================================================================
--- trunk/contrib/gdb/gdb/ada-tasks.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/ada-tasks.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -4,7 +4,7 @@
.
This file is part of GDB.
- [$Id: ada-tasks.c,v 1.1.1.2 2006-02-25 02:33:01 laffer1 Exp $]
+ [$Id: ada-tasks.c,v 1.7 2003/06/17 20:58:32 ciceron Exp $]
Authors: Roch-Alexandre Nomine Beguin, Arnaud Charlet <charlet at gnat.com>
This program is free software; you can redistribute it and/or modify
Modified: trunk/contrib/gdb/gdb/amd64fbsd-nat.c
===================================================================
--- trunk/contrib/gdb/gdb/amd64fbsd-nat.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/amd64fbsd-nat.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/sysctl.h>
+#include <sys/user.h>
#include <machine/reg.h>
#ifdef HAVE_SYS_PROCFS_H
@@ -212,24 +213,23 @@
SC_RBP_OFFSET = offset;
- /* FreeBSD provides a kern.ps_strings sysctl that we can use to
+ /* FreeBSD provides a kern.proc.sigtramp sysctl that we can use to
locate the sigtramp. That way we can still recognize a sigtramp
- if its location is changed in a new kernel. Of course this is
- still based on the assumption that the sigtramp is placed
- directly under the location where the program arguments and
- environment can be found. */
+ if its location is changed in a new kernel. */
{
- int mib[2];
- long ps_strings;
+ int mib[4];
+ struct kinfo_sigtramp kst;
size_t len;
mib[0] = CTL_KERN;
- mib[1] = KERN_PS_STRINGS;
- len = sizeof (ps_strings);
- if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_SIGTRAMP;
+ mib[3] = getpid();
+ len = sizeof (kst);
+ if (sysctl (mib, sizeof(mib) / sizeof(mib[0]), &kst, &len, NULL, 0) == 0)
{
- amd64fbsd_sigtramp_start_addr = ps_strings - 32;
- amd64fbsd_sigtramp_end_addr = ps_strings;
+ amd64fbsd_sigtramp_start_addr = kst.ksigtramp_start;
+ amd64fbsd_sigtramp_end_addr = kst.ksigtramp_end;
}
}
}
Modified: trunk/contrib/gdb/gdb/corelow.c
===================================================================
--- trunk/contrib/gdb/gdb/corelow.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/corelow.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -432,15 +432,16 @@
char *human_name,
int required)
{
- char section_name[100];
+ static char *section_name = NULL;
struct bfd_section *section;
bfd_size_type size;
char *contents;
+ xfree (section_name);
if (PIDGET (inferior_ptid))
- sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid));
+ section_name = xstrprintf ("%s/%d", name, PIDGET (inferior_ptid));
else
- strcpy (section_name, name);
+ section_name = xstrdup (name);
section = bfd_get_section_by_name (core_bfd, section_name);
if (! section)
Modified: trunk/contrib/gdb/gdb/doc/agentexpr.texi
===================================================================
--- trunk/contrib/gdb/gdb/doc/agentexpr.texi 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/doc/agentexpr.texi 2018-06-17 19:20:35 UTC (rev 11048)
@@ -5,7 +5,7 @@
@c @setchapternewpage off
@c %**end of header
- at c Revision: $Id: agentexpr.texi,v 1.1.1.2 2006-02-25 02:33:06 laffer1 Exp $
+ at c Revision: $Id: agentexpr.texi,v 1.2 1998/12/09 21:23:46 jimb Exp $
@node Agent Expressions
@appendix The GDB Agent Expression Mechanism
Modified: trunk/contrib/gdb/gdb/doc/gdbint.texinfo
===================================================================
--- trunk/contrib/gdb/gdb/doc/gdbint.texinfo 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/doc/gdbint.texinfo 2018-06-17 19:20:35 UTC (rev 11048)
@@ -38,7 +38,7 @@
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.1.1.2 $} % For use in headers, footers too
+\xdef\manvers{\$Revision$} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
Modified: trunk/contrib/gdb/gdb/doc/stabs.texinfo
===================================================================
--- trunk/contrib/gdb/gdb/doc/stabs.texinfo 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/doc/stabs.texinfo 2018-06-17 19:20:35 UTC (rev 11048)
@@ -35,7 +35,7 @@
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.1.1.2 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 2.130 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Support\par
\hfill \manvers\par
Modified: trunk/contrib/gdb/gdb/dwarf2expr.c
===================================================================
--- trunk/contrib/gdb/gdb/dwarf2expr.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/dwarf2expr.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -575,6 +575,7 @@
break;
case DW_OP_div:
binop = BINOP_DIV;
+ break;
case DW_OP_minus:
binop = BINOP_SUB;
break;
@@ -595,6 +596,7 @@
break;
case DW_OP_shr:
binop = BINOP_RSH;
+ break;
case DW_OP_shra:
binop = BINOP_RSH;
val1 = value_from_longest (signed_address_type (), first);
Modified: trunk/contrib/gdb/gdb/frame-unwind.c
===================================================================
--- trunk/contrib/gdb/gdb/frame-unwind.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/frame-unwind.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -27,6 +27,8 @@
static struct gdbarch_data *frame_unwind_data;
+frame_unwind_sniffer_ftype *kgdb_sniffer_kluge;
+
struct frame_unwind_table
{
frame_unwind_sniffer_ftype **sniffer;
@@ -49,6 +51,8 @@
{
struct frame_unwind_table *table = XCALLOC (1, struct frame_unwind_table);
append_predicate (table, dummy_frame_sniffer);
+ if (kgdb_sniffer_kluge != NULL)
+ append_predicate (table, kgdb_sniffer_kluge);
return table;
}
Modified: trunk/contrib/gdb/gdb/gdb.1
===================================================================
--- trunk/contrib/gdb/gdb/gdb.1 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/gdb.1 2018-06-17 19:20:35 UTC (rev 11048)
@@ -1,6 +1,6 @@
.\" Copyright 1991, 1999 Free Software Foundation, Inc.
.\" See section COPYING for conditions for redistribution
-.\" $Id: gdb.1,v 1.1.1.2 2006-02-25 02:33:02 laffer1 Exp $
+.\" $Id: gdb.1,v 1.4 1999/01/05 00:50:50 jsm Exp $
.TH gdb 1 "22may2002" "GNU Tools" "GNU Tools"
.SH NAME
gdb \- The GNU Debugger
Modified: trunk/contrib/gdb/gdb/mips-tdep.c
===================================================================
--- trunk/contrib/gdb/gdb/mips-tdep.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/mips-tdep.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -5437,6 +5437,13 @@
}
}
+ /* Default 64-bit objects to N64 instead of O32. */
+ if (found_abi == MIPS_ABI_UNKNOWN
+ && info.abfd != NULL
+ && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
+ && elf_elfheader (info.abfd)->e_ident[EI_CLASS] == ELFCLASS64)
+ found_abi = MIPS_ABI_N64;
+
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "mips_gdbarch_init: found_abi = %d\n",
found_abi);
Modified: trunk/contrib/gdb/gdb/mipsfbsd-tdep.c
===================================================================
--- trunk/contrib/gdb/gdb/mipsfbsd-tdep.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/mipsfbsd-tdep.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -205,6 +205,8 @@
* 0x7ffeffec sigcode -> 44 bytes
*
* 0x7ffeffc4 sigcode end env strings etc start
+ *
+ * XXX This is out-of-date and varies by ABI.
*/
#define MIPS_FBSD_SIGTRAMP_START (0x7ffeffc4)
#define MIPS_FBSD_SIGTRAMP_END (0x7ffeffec)
Modified: trunk/contrib/gdb/gdb/osabi.c
===================================================================
--- trunk/contrib/gdb/gdb/osabi.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/osabi.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -463,6 +463,26 @@
return;
}
+
+ /* .note.tag notes, used by FreeBSD. */
+ if (strcmp (name, ".note.tag") == 0)
+ {
+ /* FreeBSD. */
+ if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_TAG))
+ {
+ /* There is no need to check the version yet. */
+ *osabi = GDB_OSABI_FREEBSD_ELF;
+ return;
+ }
+ if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_NOINIT_TAG))
+ {
+ /* There is no need to check the version yet. */
+ *osabi = GDB_OSABI_FREEBSD_ELF;
+ return;
+ }
+
+ return;
+ }
/* .note.netbsd.ident notes, used by NetBSD. */
if (strcmp (name, ".note.netbsd.ident") == 0
Modified: trunk/contrib/gdb/gdb/remote.c
===================================================================
--- trunk/contrib/gdb/gdb/remote.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/remote.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -3463,7 +3463,7 @@
{
int i;
regs = alloca (rs->sizeof_g_packet);
- memset (regs, rs->sizeof_g_packet, 0);
+ memset (regs, 0, rs->sizeof_g_packet);
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
{
struct packet_reg *r = &rs->regs[i];
Modified: trunk/contrib/gdb/gdb/std-regs.c
===================================================================
--- trunk/contrib/gdb/gdb/std-regs.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/std-regs.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -61,7 +61,7 @@
val = allocate_value (builtin_type_frame_reg);
VALUE_LVAL (val) = not_lval;
buf = VALUE_CONTENTS_RAW (val);
- memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val)));
/* frame.base. */
if (frame != NULL)
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
@@ -87,7 +87,7 @@
struct value *val = allocate_value (builtin_type_void_data_ptr);
char *buf = VALUE_CONTENTS_RAW (val);
if (frame == NULL)
- memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val)));
else
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
get_frame_base_address (frame));
@@ -105,7 +105,7 @@
struct value *val = allocate_value (builtin_type_void_data_ptr);
char *buf = VALUE_CONTENTS_RAW (val);
if (frame == NULL)
- memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val)));
else
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
get_frame_pc (frame));
Modified: trunk/contrib/gdb/gdb/target.c
===================================================================
--- trunk/contrib/gdb/gdb/target.c 2018-06-17 19:18:44 UTC (rev 11047)
+++ trunk/contrib/gdb/gdb/target.c 2018-06-17 19:20:35 UTC (rev 11048)
@@ -1425,6 +1425,13 @@
(*t)->to_sections_end = target->to_sections_end;
}
}
+ /* There is a flattened view of the target stack in current_target,
+ so its to_sections pointer might also need updating. */
+ if (current_target.to_sections == old_value)
+ {
+ current_target.to_sections = target->to_sections;
+ current_target.to_sections_end = target->to_sections_end;
+ }
}
return old_count;
More information about the Midnightbsd-cvs
mailing list