]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
8 years agoFix tui compilation with Solaris libcurses: clear define (PR tui/21482)
Rainer Orth [Fri, 19 May 2017 13:03:52 +0000 (15:03 +0200)] 
Fix tui compilation with Solaris libcurses: clear define (PR tui/21482)

8 years agoFix tui compilation with Solaris libcurses: non-const last arg to mvwaddstr (PR tui...
Rainer Orth [Fri, 19 May 2017 12:01:50 +0000 (14:01 +0200)] 
Fix tui compilation with Solaris libcurses: non-const last arg to mvwaddstr (PR tui/21482)

8 years agoAvoid MinGW compilation warning in readline/input.c
Eli Zaretskii [Fri, 19 May 2017 08:05:59 +0000 (11:05 +0300)] 
Avoid MinGW compilation warning in readline/input.c

This change was already accepted upstream in Readline.

readline/ChangeLog.gdb:

2017-05-19  Eli Zaretskii  <eliz@gnu.org>

* input.c [_WIN32]: Include <conio.h> to avoid compiler warning on
MinGW.

(cherry picked from commit 50e1d299ef1d21b0833c2fe1484d3cc374e6486f)

8 years agoAvoid compiler warning in MinGW build
Eli Zaretskii [Sat, 13 May 2017 08:10:00 +0000 (11:10 +0300)] 
Avoid compiler warning in MinGW build

gdb:

2017-05-13  Eli Zaretskii  <eliz@gnu.org>

* tui/tui.c (tui_enable): Cast "unknown" to 'char *' to avoid a
C++ compiler warning.

(cherry picked from commit adf3dde510088ef8dc46d04df05baf36adb0ed1e)

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 19 May 2017 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoExpect prompt after no FPU warning
Thomas Preud'homme [Thu, 18 May 2017 15:44:25 +0000 (16:44 +0100)] 
Expect prompt after no FPU warning

2017-05-18  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gdb/testsuite/
* gdb.base/float.exp: Expect GDB prompt for targets without FPU.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 18 May 2017 00:01:49 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAdd alias command to cmd_list_element
Yao Qi [Wed, 17 May 2017 13:22:04 +0000 (14:22 +0100)] 
Add alias command to cmd_list_element

When we add alias command, we call add_alias_cmd and pass the alias name
and command name.  This implicitly requires the command and its prefix
commands are already added to cmdlist.  This may not be true, for example,

  add_com_alias ("tty", "set inferior-tty", class_alias, 0);

"inferior-tty" command is added to setlist, but setlist may not be added
to cmdlist (It depends on the order of related _initialize_XXX functions
called) so that we can't find "set inferior-tty" from cmdlist.

This patch fixes this problem by passing cmd_list_element of "inferior-tty"
to add_alias_cmd, so that cmd_list_element of "inferior-tty" doesn't have
to be reachable from cmdlist at that moment.

gdb:

2017-05-17  Yao Qi  <yao.qi@linaro.org>

* cli/cli-decode.c (add_alias_cmd): New function.
* command.h (add_alias_cmd): Declare.
* infcmd.c (_initialize_infcmd): Don't call add_com_alias,
instead call add_alias_cmd.

gdb/testsuite:

2017-05-17  Simon Marchi  <simon.marchi@ericsson.com>

* gdb.base/set-inferior-tty.exp (test_set_inferior_tty): Add
argument command.
(top-level): Invoke test_set_inferior_tty.

8 years agoAvoid exponential behavior in rust_evaluate_subexp
Tom Tromey [Fri, 12 May 2017 04:22:36 +0000 (22:22 -0600)] 
Avoid exponential behavior in rust_evaluate_subexp

The STRUCTOP_STRUCT case in rust_evaluate_subexp would evaluate its
LHS, and then, if it did not need Rust-specific treatment, it would
back up and re-evaluate the entire STRUCTOP_STRUCT part of the
expression using evaluate_subexp_standard.  This yields exponential
behavior and causes some expressions to evaluate extremely slowly.

The fix is to simply do the needed work inline.

This is PR rust/21483.

2017-05-12  Tom Tromey  <tom@tromey.com>

PR rust/21483:
* rust-lang.c (rust_evaluate_subexp) <STRUCTOP_STRUCT>: Don't
recurse, just call value_struct_elt directly.

8 years agoFix rust_dump_subexp_body
Tom Tromey [Fri, 12 May 2017 01:50:47 +0000 (19:50 -0600)] 
Fix rust_dump_subexp_body

rust_dump_subexp_body was not correct in a couple of cases.  While
debugging the bug I was really interested in, this caused a crash.
This patch fixes the problems.  No test case because, IIRC there
generally aren't tests for expression dumping.

2017-05-12  Tom Tromey  <tom@tromey.com>

* rust-lang.c (rust_dump_subexp_body) <STRUCTOP_ANONYMOUS,
OP_RUST_ARRAY>: Fix.

8 years agoReplace "return" with "break"
Tom Tromey [Fri, 12 May 2017 01:44:43 +0000 (19:44 -0600)] 
Replace "return" with "break"

This replaces a "return" with a "break" in rust_print_subexp, for
consistency.

2017-05-12  Tom Tromey  <tom@tromey.com>

* rust-lang.c (rust_print_subexp): Replace "return" with "break".

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 17 May 2017 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 16 May 2017 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoFix gdb 8.0 procfs.c compilation on Solaris
Rainer Orth [Mon, 15 May 2017 12:36:06 +0000 (14:36 +0200)] 
Fix gdb 8.0 procfs.c compilation on Solaris

Prompted by the creation of the gdb 8.0 branch, I tried to build it on
x86_64-pc-solaris2.12, but failed:

/vol/src/gnu/gdb/gdb-8.0-branch/local/gdb/procfs.c: In function `target_ops* procfs_target()':
/vol/src/gnu/gdb/gdb-8.0-branch/local/gdb/procfs.c:186:27: error: invalid conversion from `void (*)(target_ops*, char*, char*, char**, int)' to `void (*)(target_ops*, const char*, const string&, char**, int) {aka void (*)(target_ops*, const char*, const std::__cxx11::basic_string<char>&, char**, int)}' [-fpermissive]
   t->to_create_inferior = procfs_create_inferior;
                           ^~~~~~~~~~~~~~~~~~~~~~
/vol/src/gnu/gdb/gdb-8.0-branch/local/gdb/procfs.c: At global scope:
/vol/src/gnu/gdb/gdb-8.0-branch/local/gdb/procfs.c:125:13: warning: `void procfs_create_inferior(target_ops*, char*, char*, char**, int)' declared `static' but never defined [-Wunused-function]
 static void procfs_create_inferior (struct target_ops *, char *,
             ^~~~~~~~~~~~~~~~~~~~~~
/vol/src/gnu/gdb/gdb-8.0-branch/local/gdb/procfs.c:4529:1: warning: `void procfs_create_inferior(target_ops*, const char*, const string&, char**, int)' defined but not used [-Wunused-function]
 procfs_create_inferior (struct target_ops *ops, const char *exec_file,
 ^~~~~~~~~~~~~~~~~~~~~~

This can easily be fixed by the following patch.

* procfs.c (procfs_create_inferior): Change prototype to match
definition.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 15 May 2017 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 14 May 2017 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 13 May 2017 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 12 May 2017 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 11 May 2017 00:01:11 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 10 May 2017 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 9 May 2017 00:01:09 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 8 May 2017 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 7 May 2017 00:01:14 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 6 May 2017 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 5 May 2017 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoBump GDB version number to 7.99.91.DATE-git.
Joel Brobecker [Thu, 4 May 2017 19:37:28 +0000 (12:37 -0700)] 
Bump GDB version number to 7.99.91.DATE-git.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.99.91.DATE-git.
* PROBLEMS: Likewise.

8 years agoDocument the GDB 7.99.91 release in gdb/ChangeLog
Joel Brobecker [Thu, 4 May 2017 19:37:15 +0000 (12:37 -0700)] 
Document the GDB 7.99.91 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.99.91 released.

8 years agoSet GDB version number to 7.99.91.
Joel Brobecker [Thu, 4 May 2017 19:17:21 +0000 (12:17 -0700)] 
Set GDB version number to 7.99.91.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.99.91.
* PROBLEMS: Likewise.

8 years agogdb/NEWS: rewrite "since GDB 7.12" into "in GDB 8.0"
Joel Brobecker [Thu, 4 May 2017 19:14:00 +0000 (12:14 -0700)] 
gdb/NEWS: rewrite "since GDB 7.12" into "in GDB 8.0"

gdb/ChangeLog:

        * NEWS: Rename the "Changes since GDB 7.12" section into
        "Changes in GDB 8.0".

8 years agoFix gdb.python/py-record-btrace-threads.exp with Python 3
Pedro Alves [Thu, 4 May 2017 15:05:15 +0000 (16:05 +0100)] 
Fix gdb.python/py-record-btrace-threads.exp with Python 3

Fix several instances of:

 ...
 python print not f1calls
   File "<string>", line 1
     print not f1calls
     ^
 SyntaxError: Missing parentheses in call to 'print'
 Error while executing Python code.
 (gdb) FAIL: gdb.python/py-record-btrace-threads.exp: thread=1: checking thread 1: python print not f1calls
 ...

gdb/testsuite/ChangeLog:
2017-05-04  Pedro Alves  <palves@redhat.com>

* gdb.python/py-record-btrace-threads.exp (check_insn_for_thread):
Add parens to print call for Python 3.

8 years agoPython: Introduce gdb.Instruction class
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Introduce gdb.Instruction class

This adds a generic instruction class to Python and has gdb.RecordInstruction
inherit from it.

8 years agoPython: Move and rename gdb.BtraceFunction
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Move and rename gdb.BtraceFunction

Remove gdb.BtraceFunctionCall and replace by gdb.FunctionSegment.  Additionally,
rename prev_segment and next_segment to prev and next.

8 years agoPython: Move and rename gdb.BtraceInstruction
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Move and rename gdb.BtraceInstruction

Remove gdb.BtraceInstruction and replace by gdb.RecordInstruction.

8 years agoPython: Introduce gdb.RecordGap class
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Introduce gdb.RecordGap class

As discussed here: https://sourceware.org/ml/gdb-patches/2017-04/msg00157.html

A gap is not an instruction and it should not pretend to be one.
gdb.Record.instruction_history is now a list of gdb.RecordInstruction and
gdb.RecordGap objects.  This allows the user to deal with Gaps in the record
in a more sane way.

8 years agoPython: Remove ptid from gdb.Record interface
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Remove ptid from gdb.Record interface

As discussed here: https://sourceware.org/ml/gdb-patches/2017-04/msg00166.html

8 years agoPython: Use correct ptid in btrace recording
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Use correct ptid in btrace recording

The user would always get the instruction_history and function_call_history
objects of the current thread, not the thread for which the gdb.Record object
was created.

The attached testcase fails without this patch and passes with the patch.

8 years agoPython: Fix indentation in py-record-btrace.c
Tim Wiederhake [Thu, 4 May 2017 07:05:00 +0000 (09:05 +0200)] 
Python: Fix indentation in py-record-btrace.c

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 4 May 2017 00:01:29 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoMake sure malloc is linked into gdb.cp/oranking.cc.
Keith Seitz [Wed, 3 May 2017 19:40:01 +0000 (12:40 -0700)] 
Make sure malloc is linked into gdb.cp/oranking.cc.

On some platforms, e.g., arm-eabi-none, we need to make certain that
malloc is linked into the program because the test suite uses function
calls requiring malloc:

(gdb) p foo101("abc")
evaluation of this expression requires the program to have a function "malloc".

gdb/testsuite/ChangeLog

* gdb.cp/oranking.cc (dummy): New function to grab malloc.
(main): Call it.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 3 May 2017 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 2 May 2017 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 1 May 2017 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 30 Apr 2017 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Apr 2017 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoUse ptid method lwp in mips_linux_new_thread
Yao Qi [Fri, 28 Apr 2017 08:50:51 +0000 (09:50 +0100)] 
Use ptid method lwp in mips_linux_new_thread

gdb:

2017-04-28  Yao Qi  <yao.qi@linaro.org>

* mips-linux-nat.c (mips_linux_new_thread): Use ptid method
lwp instead of ptid_get_lwp.

8 years ago[MIPS] Use lwpid from lwp_info instead of inferior_ptid
Yao Qi [Fri, 28 Apr 2017 08:33:16 +0000 (09:33 +0100)] 
[MIPS] Use lwpid from lwp_info instead of inferior_ptid

RAJESH reported that GDB gets "Couldn't write debug register: No such
process." on mips64 when GDB attaches to a multi threaded application.

Looks GDB nows PTRACE_GET_WATCH_REGS for inferior_ptid but
PTRACE_SET_WATCH_REGS for lwp->ptid, they may be different.

gdb:

2017-04-28  Yao Qi  <yao.qi@linaro.org>

* mips-linux-nat.c (mips_linux_new_thread): Get lwpid from
lwp_info instead of getting from inferior_ptid.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Apr 2017 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoFix overload resolution involving rvalue references and cv qualifiers.
Keith Seitz [Thu, 27 Apr 2017 23:04:33 +0000 (16:04 -0700)] 
Fix overload resolution involving rvalue references and cv qualifiers.

The following patch fixes several outstanding overload resolution problems
with rvalue references and cv qualifiers in the test suite. The tests for
these problems typically passed with one compiler version and failed with
another. This behavior occurs because of the ordering of the overloaded
functions in the debug info. So the first best match "won out" over the
a subsequent better match.

One of the bugs addressed by this patch is the failure of rank_one_type to
account for type equality of two overloads based on CV qualifiers.  This was
leading directly to problems evaluating rvalue reference overload quality,
but it is also highlighted in gdb.cp/oranking.exp, where two test KFAIL as
a result of this shortcoming.

I found the overload resolution code committed with the rvalue reference
patch (f9aeb8d49) needlessly over-complicated, and I have greatly simplified
it. This fixes some KFAILing tests in gdb.exp/rvalue-ref-overload.exp.

gdb/ChangeLog

* gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS)
DIFFERENT_REFERENCE_TYPE_BADNESS): Remove.
(CV_CONVERSION_BADNESS): Define.
(rank_one_type): Remove overly restrictive rvalue reference
rank checks.
Add cv-qualifier checks and subranks for type equality.
* gdbtypes.h (REFERENCE_CONVERSION_RVALUE,
REFERENCE_CONVERSION_CONST_LVALUE, CV_CONVERSION_BADNESS,
CV_CONVERSION_CONST, CV_CONVERSION_VOLATILE): Declare.

gdb/testsuite/ChangeLog

* gdb.cp/oranking.cc (test15): New function.
(main): Call test15 and declare additional variables for testing.
* gdb.cp/oranking.exp: Remove kfail status for "p foo4(&a)" and
"p foo101('abc')" tests.
* gdb.cp/rvalue-ref-overloads.exp: Remove kfail status for
"lvalue reference overload" test.
* gdb.cp/rvalue-ref-params.exp: Remove kfail status for
"print value of f1 on Child&& in f2" test.

8 years agoAdd missing incref when creating Inferior Python object
Simon Marchi [Thu, 27 Apr 2017 21:03:20 +0000 (17:03 -0400)] 
Add missing incref when creating Inferior Python object

The test py-inferior.exp fails when using a debug build of Python 3.6.  I don't
see it failing with my system's default Python, but it might be related to the
different memory allocation scheme used when doing a build with pydebug.

The issue is that we are missing a Py_INCREF in
inferior_to_inferior_object.  The PyObject_New function initializes the
object with a refcount of 1.  If we assume that this refcount
corresponds to the reference we are returning, then we are missing an
incref for the reference in the inferior data.

The counterpart for the incref that corresponds to the reference in the
inferior data is in py_free_inferior, in the form the gdbpy_ref instance.

Here's how I can get it to crash (with some debug output):

  $ ./gdb -nx -ex "set debug python 1"
  (gdb) add-inferior
  Added inferior 2
  (gdb) python infs = gdb.inferiors()
  Creating Python Inferior object inf = 1
  Creating Python Inferior object inf = 2
  (gdb) remove-inferiors 2
  py_free_inferior inf = 2
  infpy_dealloc inf = <unknown>
  (gdb) python infs = None
  Fatal Python error: Objects/tupleobject.c:243 object at 0x7f9cf1a568d8 has negative ref count -1

  Current thread 0x00007f9cf1b68780 (most recent call first):
    File "<string>", line 1 in <module>
  [1]    408 abort (core dumped)  ./gdb -nx -ex "set debug python 1"

After having created the inferiors object, their refcount is 1 (which
comes from PyObject_New), but it should be two.  The gdb inferior object
has a reference and the "infs" list has a reference.

When invoking remove-inferiors, py_free_inferior gets called.  It does
the decref that corresponds to the reference that the gdb inferior
object kept.  At this moment, the refcount drops to 0 and the object
gets deallocated, even though the "infs" list still has a reference.
When we set "infs" to None, Python tries to decref the already zero
refcount and the assert triggers.

With this patch, it looks better:

  (gdb) add-inferior
  Added inferior 2
  (gdb) python infs = gdb.inferiors()
  Creating Python Inferior object inf = 1
  Creating Python Inferior object inf = 2
  (gdb) remove-inferiors 2
  py_free_inferior inf = 2
  (gdb) python infs = None
  infpy_dealloc inf = <unknown>

gdb/ChangeLog:

* python/py-inferior.c (inferior_to_inferior_object): Increment reference
count when creating the object.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Apr 2017 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Apr 2017 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoChange gdbarch_wchar_bit for AArch64 and ARM
Yao Qi [Tue, 25 Apr 2017 14:15:54 +0000 (15:15 +0100)] 
Change gdbarch_wchar_bit for AArch64 and ARM

The size of wchar_t on AArch64 and ARM is 4-byte, so we can use the
default value (4*TARGET_CHAR_BIT).

This patch fixes some fails in gdb.cp/wide_char_types.exp on
aarch64-linux.

gdb:

2017-04-25  Yao Qi  <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
set_gdbarch_wchar_bit.
* arm-tdep.c (arm_gdbarch_init): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Apr 2017 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Apr 2017 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 23 Apr 2017 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Apr 2017 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agorelease branch: Fix: --enable-werror
Jan Kratochvil [Fri, 21 Apr 2017 14:14:37 +0000 (16:14 +0200)] 
release branch: Fix: --enable-werror

gdb-8.0-branch
./configure --enable-werror --enable-targets=all
aarch64-tdep.c:3045:13: error: â€˜void selftests::aarch64_process_record_test()’ declared â€˜static’ but never defined [-Werror=unused-function]
arm-tdep.c:9601:13: error: â€˜void selftests::arm_record_test()’ declared â€˜static’ but never defined [-Werror=unused-function]

gdb/ChangeLog
2017-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

* aarch64-tdep.c (selftests::aarch64_process_record_test): Make it #if
GDB_SELF_TEST.
* arm-tdep.c (selftests::arm_record_test): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Apr 2017 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Apr 2017 00:01:21 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Apr 2017 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoPR threads/20743: Don't attempt to suspend or resume exited threads.
John Baldwin [Tue, 18 Apr 2017 16:44:32 +0000 (09:44 -0700)] 
PR threads/20743: Don't attempt to suspend or resume exited threads.

When resuming a native FreeBSD process, ignore exited threads when
suspending/resuming individual threads prior to continuing the process.

gdb/ChangeLog:

PR threads/20743
* fbsd-nat.c (resume_one_thread_cb): Remove.
(resume_all_threads_cb): Remove.
(fbsd_resume): Use ALL_NON_EXITED_THREADS instead of
iterate_over_threads.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Apr 2017 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoSet development mode to "off" by default.
Joel Brobecker [Mon, 17 Apr 2017 14:23:29 +0000 (07:23 -0700)] 
Set development mode to "off" by default.

bfd/ChangeLog:

* development.sh (development): Set to false.

8 years agoBump version to 7.99.90.DATE-git.
Joel Brobecker [Mon, 17 Apr 2017 14:10:21 +0000 (07:10 -0700)] 
Bump version to 7.99.90.DATE-git.

Now that the GDB 8.0 branch has been created, we can bump the version
number to a pre-8.0 number.

gdb/ChangeLog:

GDB 8.0 branch created (725bf5cf125783c2a7ca4ab63d3768e220bab2db):
* version.in: Bump version to 7.99.90.DATE-git.

8 years agoAutomatic date update in version.in gdb-8.0-branchpoint
GDB Administrator [Sat, 15 Apr 2017 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoFix build breakage on Cygwin (PR gdb/21385)
Sergio Durigan Junior [Fri, 14 Apr 2017 01:01:53 +0000 (21:01 -0400)] 
Fix build breakage on Cygwin (PR gdb/21385)

On gdb/windows-nat.c:windows_create_inferior, ALLARGS needs to be
declared independently of the host that we're building for.  This
fixes a build breakage on Cygwin.

2017-04-13  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/21385
* windows-nat.c (windows_create_inferior): Declare 'allargs'
independently of the host, and fix build breakage on Cygwin.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Apr 2017 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoMake inferior a class with cdtors, and use new/delete
Pedro Alves [Thu, 13 Apr 2017 15:15:35 +0000 (16:15 +0100)] 
Make inferior a class with cdtors, and use new/delete

struct inferior became a non-POD when enum_flags was made a non-POD,
so we should be allocating/destroying inferiors with new/delete, etc.
That's what this commit does.

Note: this commit makes all boolean fields of inferior be "bool",
except the "detaching" field.  That'll require more work, so I split
it to a separate patch.

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* inferior.c (free_inferior): Convert to ...
(inferior::~inferior): ... this dtor.
(inferior::inferior): New ctor, factored out from ...
(add_inferior_silent): ... here.  Allocate the inferior with a new
expression.
(delete_inferior): Call delete instead of free_inferior.
* inferior.h (gdb_environ, continuation): Forward declare.
(inferior): Now a class.  Add in-class initialization to all
members.  Make boolean fields bool, except 'detaching'.
(inferior::inferior): New explicit ctor.
(inferior::~inferior): New.

8 years agoGC inferior.c:init_inferior_list
Pedro Alves [Thu, 13 Apr 2017 15:15:34 +0000 (16:15 +0100)] 
GC inferior.c:init_inferior_list

Not used anywhere.  This was actually never used.  It came in because
I originally created inferior.c by copying thread.c, and doing
s/thread/inferior/g, and missed that nothing needs this.  :-)

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* inferior.c (init_inferior_list): Delete.
* inferior.h (init_inferior_list): Delete.

8 years agoImprove coverage of the PR threads/13217 regression test
Pedro Alves [Thu, 13 Apr 2017 15:15:34 +0000 (16:15 +0100)] 
Improve coverage of the PR threads/13217 regression test

- Make sure we end up with no thread selected after the detach.

- Test both "thread apply all" and "thread apply $some_threads", for
  completeness.

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

PR threads/13217
* gdb.threads/threadapply.exp (thr_apply_detach): New procedure.
(top level): Call it twice, with different thread sets.

8 years agoC++fy thread_apply_all_command
Pedro Alves [Thu, 13 Apr 2017 15:15:34 +0000 (16:15 +0100)] 
C++fy thread_apply_all_command

This eliminates a couple cleanups.

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* thread.c: Include <algorithm>.
(thread_array_cleanup): Delete.
(scoped_inc_dec_ref): New class.
(live_threads_count): New function.
(set_thread_refcount): Delete.
(tp_array_compar_ascending): Now a bool.
(tp_array_compar): Convert to a std::sort comparison function.
(thread_apply_all_command): Use std::vector and scoped_inc_dec_ref
and live_threads_count.

8 years agoFix follow-fork latent bug
Pedro Alves [Thu, 13 Apr 2017 15:15:34 +0000 (16:15 +0100)] 
Fix follow-fork latent bug

A later patch in the series adds an assertion to switch_to_thread that
the resulting inferior_ptid always matches the "current_inferior()"
inferior.  This exposed a latent bug in the follow-fork code, where
we're building the fork child inferior.  We're switching
inferior_ptid, but not the current inferior object...

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* infrun.c (follow_fork_inferior): Also switch the current
inferior.

8 years agowatch_command_1: Fix dangling frame access
Pedro Alves [Thu, 13 Apr 2017 15:15:34 +0000 (16:15 +0100)] 
watch_command_1: Fix dangling frame access

While working on some changes to switch_to_thread, I inadvertently
make switch_to_thread call reinit_frame_cache more frequently, even
when the thread didn't change.  This exposed a latent bug in
watch_command_1, where we're referencing a frame after
creating/inserting breakpoints, which potentially calls
reinit_frame_cache if it needs to install breakpoints with a different
thread selected.

Handle this similarly to how it's already handled in other similar
cases.  I.e., save any frame-related information we might need before
creating a breakpoint.

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* breakpoint.c (watch_command_1): Save watchpoint-frame info
before calling create_internal_breakpoint.

8 years agoreadelf: fix out of range subtraction, seg fault from a NULL pointer and memory exhau...
Nick Clifton [Thu, 13 Apr 2017 15:06:30 +0000 (16:06 +0100)] 
readelf: fix out of range subtraction, seg fault from a NULL pointer and memory exhaustion, all from parsing corrupt binaries.

PR binutils/21379
* readelf.c (process_dynamic_section): Detect over large section
offsets in the DT_SYMTAB entry.

PR binutils/21345
* readelf.c (process_mips_specific): Catch an unfeasible memory
allocation before it happens and print a suitable error message.

8 years agoAdd note merging to strip and add code to merge stack size notes.
Nick Clifton [Thu, 13 Apr 2017 13:50:56 +0000 (14:50 +0100)] 
Add note merging to strip and add code to merge stack size notes.

* objcopy.c: Add --no-merge-notes option to disable note merging.
Add --[no-]merge-notes option to strip, and enable it by default.
(num_bytes): New function.
(merge_gnu_build_notes): Add code to merge stack size notes.
* binutils.texi: Update strip and objcopy documentation.
* readelf.c (print_gnu_build_attribute_name): Use defined
constants for note types.

8 years agoRegen cgen files
Alan Modra [Thu, 13 Apr 2017 01:03:53 +0000 (10:33 +0930)] 
Regen cgen files

* epiphany-desc.c: Regenerate.
* fr30-desc.c: Regenerate.
* frv-desc.c: Regenerate.
* ip2k-desc.c: Regenerate.
* iq2000-desc.c: Regenerate.
* lm32-desc.c: Regenerate.
* m32c-desc.c: Regenerate.
* m32r-desc.c: Regenerate.
* mep-desc.c: Regenerate.
* mt-desc.c: Regenerate.
* or1k-desc.c: Regenerate.
* xc16x-desc.c: Regenerate.
* xstormy16-desc.c: Regenerate.

8 years agofork-child.c: Avoid unnecessary heap-allocation / string copying
Pedro Alves [Thu, 13 Apr 2017 10:46:07 +0000 (11:46 +0100)] 
fork-child.c: Avoid unnecessary heap-allocation / string copying

The previous change to fork-child.c converted the argv building from
an alloca-allocated array of non-owning arg pointers, to a std::vector
of owning pointers, which results in N string dups, with N being the
number of arguments in the vector, and then requires manually
releasing the pointers owned by the vector.

This patch makes the vector hold non-owning pointers, and avoids the
string dups, by doing one single string copy of the arguments upfront,
and replacing separators with NULL terminators in place, like we used
to.  All the logic to do that is encapsulated in a new class.

With this, there's no need to remember to manually release the argv
elements with free_vector_argv either.

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* fork-child.c (execv_argv): New class.
(breakup_args): Refactored as ...
(execv_argv::init_for_no_shell): .. this method of execv_argv.
Copy arguments to storage and replace separators with NULL
terminators in place.
(escape_bang_in_quoted_argument): Adjust to return bool.
(execv_argv::execv_argv): New ctor.
(execv_argv::init_for_shell): New method, factored out from
fork_inferior.  Don't strdup strings into the vector.
(fork_inferior): Eliminate "shell" local and use execv_argv.  Use
Remove free_vector_argv call.

8 years ago * config.sub: Sync with master version in config project.
Andrew Jenner [Thu, 13 Apr 2017 09:34:19 +0000 (02:34 -0700)] 
* config.sub: Sync with master version in config project.

8 years agoAdd ChangeLog entries
Iain Buclaw [Thu, 13 Apr 2017 08:39:13 +0000 (10:39 +0200)] 
Add ChangeLog entries

ChangeLog entries were left unstaged in my previous commit on March 30th.

8 years agoWrap long lines
Alan Modra [Thu, 13 Apr 2017 03:54:18 +0000 (13:24 +0930)] 
Wrap long lines

Not a comprehensive change, just some split out from fixes made for
the %A and %B changes.

* coffcode.h: Wrap some overly long _bfd_error_handler args.
* elf.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-mep.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-x86-64.c: Likewise.
* elflink.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.

8 years agoUse %A and %B in more error messages
Alan Modra [Thu, 13 Apr 2017 03:50:15 +0000 (13:20 +0930)] 
Use %A and %B in more error messages

* aoutx.h: Use %B and %A in error messages throughout file.
* aout-cris.c: Likewise.
* archive.c: Likewise.
* binary.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-tic4x.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coffswap.h: Likewise.
* cpu-arm.c: Likewise.
* elf-eh-frame.c: Likewise.
* elf-m10300.c: Likewise.
* elf.c: Likewise.
* elf32-arc.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-iq2000.c: Likewise.
* elf32-m32c.c: Likewise.
* elf32-microblaze.c: Likewise.
* elf32-nds32.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-sh64.c: Likewise.
* elf32-v850.c: Likewise.
* elf32-vax.c: Likewise.
* elf32-visium.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfcode.h: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* hpux-core.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* linker.c: Likewise.
* merge.c: Likewise.
* mmo.c: Likewise.
* oasys.c: Likewise.
* pdp11.c: Likewise.
* peXXigen.c: Likewise.
* rs6000-core.c: Likewise.
* vms-alpha.c: Likewise.
* xcofflink.c: Likewise.

8 years agoRewrite bfd error handler
Alan Modra [Thu, 13 Apr 2017 01:28:40 +0000 (10:58 +0930)] 
Rewrite bfd error handler

This steals _doprnt from libiberty, extended to handle %A and %B.
Which lets us do away with the current horrible %A and %B handling
that requires all %A and %B arguments to be passed first, rather than
in the natural order.

* bfd.c (PRINT_TYPE): Define.
(_doprnt): New function.
(error_handler_internal): Use _doprnt.
* coff-arm.c: Put %A and %B arguments to _bfd_error_handler
calls in their natural order, throughout file.
* coff-mcore.c: Likewise.
* coff-ppc.c: Likewise.
* coff-tic80.c: Likewise.
* cofflink.c: Likewise.
* elf-s390-common.c: Likewise.
* elf.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-msp430.c: Likewise.
* elf32-spu.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elflink.c: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.

8 years agoMissing _bfd_error_handler args
Alan Modra [Thu, 13 Apr 2017 01:14:20 +0000 (10:44 +0930)] 
Missing _bfd_error_handler args

* elf32-arm.c (arm_type_of_stub): Supply missing args to "long
branch veneers" error.  Fix double space and format message.
* elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
* elf64-ppc.c (tocsave_find): Supply missing %B arg.

8 years agoRegen bfd-in2.h
Alan Modra [Thu, 13 Apr 2017 01:03:11 +0000 (10:33 +0930)] 
Regen bfd-in2.h

* bfd-in2.h: Regenerate.

8 years agoFix a typo in rx_fpsw_type
Yao Qi [Thu, 13 Apr 2017 07:29:44 +0000 (08:29 +0100)] 
Fix a typo in rx_fpsw_type

gdb:

2017-04-13  Yao Qi  <yao.qi@linaro.org>

* rx-tdep.c (rx_fpsw_type): Check tdep->rx_fpsw_type instead of
tdep->rx_psw_type.

8 years agoXCNEW gdbarch_tdep in rl78 and rx
Yao Qi [Thu, 13 Apr 2017 07:29:43 +0000 (08:29 +0100)] 
XCNEW gdbarch_tdep in rl78 and rx

"struct gdbarch_tdep" is XNEW'ed in rl78 and rx, so the memory is not
cleared.  As the result, tdep->rl78_psw_type is never initialized
properly.

  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);

  if (tdep->rl78_psw_type == NULL)
    {
      tdep->rl78_psw_type = arch_flags_type (gdbarch,
     "builtin_type_rl78_psw", 1);

The bug is found by my unit test in the following patch.

gdb:

2017-04-13  Yao Qi  <yao.qi@linaro.org>

* rl78-tdep.c (rl78_gdbarch_init): Use XCNEW instead of XNEW.
* rx-tdep.c (rx_gdbarch_init): Likewise.

8 years agostruct breakpoint: Fix indentation
Pedro Alves [Thu, 13 Apr 2017 02:07:21 +0000 (03:07 +0100)] 
struct breakpoint: Fix indentation

I'm going to need to touch all these fields to add in-class
initialization anyway, might as well take the opportunity to finally
fix this...

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* breakpoint.h (struct breakpoint): Reindent.

8 years agobreakpoint.c: bp_location (the array) shadows bp_location (the type)
Pedro Alves [Thu, 13 Apr 2017 01:12:53 +0000 (02:12 +0100)] 
breakpoint.c: bp_location (the array) shadows bp_location (the type)

The bp_location array has the same name as the "struct bp_location",
type preventing refering to the structure without the "struct" inside
breakpoint.c.  I.e., we must write:

 "new struct bp_location;"

instead of:

 "new bp_location"

Rename the array and the associated variables/functions to avoid the
shadowing.

gdb/ChangeLog:
2017-04-13  Pedro Alves  <palves@redhat.com>

* breakpoint.c (bp_location): Rename to ...
(bp_locations): ... this.  All references updated.
(bp_location_count): Rename to ...
(bp_locations_count): ... this.  All references updated.
(bp_location_placed_address_before_address_max): Rename to ...
(bp_locations_placed_address_before_address_max): ... this.  All
references updated.
(bp_location_shadow_len_after_address_max): Rename to ...
(bp_locations_shadow_len_after_address_max): ... this.  All
references updated.
(bp_location_compare_addrs): Rename to ...
(bp_locations_compare_addrs): ... this.  All references updated.
(bp_location_compare):Rename to ...
(bp_locations_compare): ... this.  All references updated.
(bp_location_target_extensions_update): Rename to ...
(bp_locations_target_extensions_update): ... this.  All references
updated.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Apr 2017 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

8 years agoCreate gdb_termios.h (and cleanup gdb/{,gdbserver/}terminal.h)
Sergio Durigan Junior [Wed, 12 Apr 2017 01:05:12 +0000 (21:05 -0400)] 
Create gdb_termios.h (and cleanup gdb/{,gdbserver/}terminal.h)

As requested, I'm sending this as a separate patch because it is ready
to be included as-is.

The idea here is that both gdb/terminal.h and gdb/gdbserver/terminal.h
share the same code, which is responsible for setting a bunch of
defines on based on the presence of termios.h and a few other headers.
This simple patch just moves this common code to common/gdb_termios.h
and makes the necessary adjustments on both GDB and gdbserver so that
they can use this new header.  It also implements the some header
checks on common/common.m4.

As a bonus, gdb/gdbserver/terminal.h can be removed because it's now
empty.

Built on x86_64, no regressions found.

gdb/ChangeLog:
2017-04-12  Sergio Durigan Junior  <sergiodj@redhat.com>

* Makefile.in (HFILES_NO_SRCDIR): Add "common/gdb_termios.h".
* common/common.m4: Check headers 'termios.h', 'termio.h' and
'sgtty.h'.
* common/gdb_termios.h: New file, with parts of "terminal.h".
* inflow.c: Include "gdb_termios.h".
* ser-unix.c: Include "gdb_termios.h".
* terminal.h: Move terminal-related defines to
"common/gdb_termios.h".

gdb/gdbserver/ChangeLog:
2017-04-12  Sergio Durigan Junior  <sergiodj@redhat.com>

* remote-utils.c: Include "gdb_termios.h" instead of
"terminal.h".
* terminal.h: Delete file.

8 years agoChange linespec_result::location to be an event_location_up
Tom Tromey [Mon, 10 Apr 2017 21:53:22 +0000 (15:53 -0600)] 
Change linespec_result::location to be an event_location_up

This is a follow-up to another patch.  It changes
linespec_result::location to be an event_location_up.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* probe.c (parse_probes): Update.
* location.h (delete_event_location): Don't declare.
(event_location_deleter::operator()): Update.
* location.c (event_location_deleter::operator()): Rename from
delete_event_location.
* linespec.h (linespec_result) <location>: Change type to
event_location_up.
* linespec.c (canonicalize_linespec, event_location_to_sals)
(decode_objc): Update.
(linespec_result): Don't call delete_event_location.
* breakpoint.c (create_breakpoints_sal)
(bkpt_probe_create_sals_from_location)
(strace_marker_create_sals_from_location): Update.

8 years agoAdd a constructor and destructor to linespec_result
Tom Tromey [Mon, 10 Apr 2017 21:47:21 +0000 (15:47 -0600)] 
Add a constructor and destructor to linespec_result

linespec_result is only ever allocated on the stack, so it's
relatively easy to convert to having a constructor and a destructor.
This patch makes this change.  This removes some cleanups.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* linespec.h (struct linespec_result): Add constructor and
destructor.
(init_linespec_result, destroy_linespec_result)
(make_cleanup_destroy_linespec_result): Don't declare.
* linespec.c (init_linespec_result): Remove.
(linespec_result::~linespec_result): Rename from
destroy_linespec_result.  Update.
(cleanup_linespec_result, make_cleanup_destroy_linespec_result):
Remove.
* breakpoint.c (create_breakpoint, break_range_command)
(decode_location_default): Update.
* ax-gdb.c (agent_command_1): Update.

8 years agoChange breakpoint event locations to event_location_up
Tom Tromey [Mon, 10 Apr 2017 21:41:25 +0000 (15:41 -0600)] 
Change breakpoint event locations to event_location_up

This is a follow-up to an earlier patch.  It changes breakpoint's
location and location_range_end members to be of type
event_location_up, then fixes up the users.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* remote.c (remote_download_tracepoint): Update.
* python/py-breakpoint.c (bppy_get_location): Update.
* guile/scm-breakpoint.c (bpscm_print_breakpoint_smob)
(gdbscm_breakpoint_location): Update.
* elfread.c (elf_gnu_ifunc_resolver_return_stop): Update.
* breakpoint.h (struct breakpoint) <location, location_range_end>:
Change type to event_location_up.
* breakpoint.c (create_overlay_event_breakpoint)
(create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint)
(breakpoint_event_location_empty_p, print_breakpoint_location)
(print_one_breakpoint_location, create_thread_event_breakpoint)
(init_breakpoint_sal, create_breakpoint)
(print_recreate_ranged_breakpoint, break_range_command)
(init_ada_exception_breakpoint, say_where): Update.
(base_breakpoint_dtor): Don't call delete_event_location.
(bkpt_print_recreate, tracepoint_print_recreate)
(dprintf_print_recreate, update_static_tracepoint)
(breakpoint_re_set_default): Update.

8 years agoUse std::vector in compile-loc2c.c
Tom Tromey [Fri, 7 Apr 2017 22:05:42 +0000 (16:05 -0600)] 
Use std::vector in compile-loc2c.c

This changes compile-loc2c.c to use std::vector in place of a VEC,
allowing the removal of a cleanup.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* compile/compile-loc2c.c (compute_stack_depth_worker): Change
type of "to_do".  Update.
(compute_stack_depth): Use std::vector.

8 years agoUse std::vector in find_instruction_backward
Tom Tromey [Fri, 7 Apr 2017 22:01:10 +0000 (16:01 -0600)] 
Use std::vector in find_instruction_backward

This changes find_instruction_backward to use std::vector, removing a
cleanup.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* printcmd.c (find_instruction_backward): Use std::vector.

8 years agoUse std::vector in reread_symbols
Tom Tromey [Fri, 7 Apr 2017 21:58:25 +0000 (15:58 -0600)] 
Use std::vector in reread_symbols

This changes reread_symbols to use std::vector, removing a cleanup.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* symfile.c (objfilep): Remove typedef.
(reread_symbols): Use a std::vector.

8 years agoUse scoped_restore in more places
Tom Tromey [Fri, 7 Apr 2017 21:37:25 +0000 (15:37 -0600)] 
Use scoped_restore in more places

This changes a few more places to use scoped_restore, allowing some
cleanup removals.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* mi/mi-main.c (exec_direction_forward): Remove.
(exec_reverse_continue, mi_execute_command): Use scoped_restore.
* guile/scm-ports.c (ioscm_with_output_to_port_worker): Use
scoped_restore.
* guile/guile.c (guile_repl_command, guile_command)
(gdbscm_execute_gdb_command): Use scoped_restore.
* go-exp.y (go_parse): Use scoped_restore.
* d-exp.y (d_parse): Use scoped_restore.
* cli/cli-decode.c (cmd_func): Use scoped_restore.
* c-exp.y (c_parse): Use scoped_restore.

8 years agoC++ify mi_parse
Tom Tromey [Fri, 7 Apr 2017 21:34:02 +0000 (15:34 -0600)] 
C++ify mi_parse

This changes mi_parse to return a unique_ptr, and to use "new"; then
fixes up the users.  This allows removing one cleanup.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* mi/mi-parse.h (struct mi_parse): Add constructor, destructor.
(mi_parse): Update return type.
(mi_parse_free): Remove.
* mi/mi-parse.c (mi_parse::mi_parse): New constructor.
(mi_parse::~mi_parse): Rename from mi_parse_free.
(mi_parse_cleanup): Remove.
(mi_parse): Return a unique_ptr.  Use new.
* mi/mi-main.c (mi_execute_command): Update.

8 years agoRemove some cleanups from location.c
Tom Tromey [Fri, 7 Apr 2017 05:26:14 +0000 (23:26 -0600)] 
Remove some cleanups from location.c

This removes some more cleanups from location.c by using
unique_xmalloc_ptr.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* location.c (explicit_location_lex_one): Return a
unique_xmalloc_ptr.
(string_to_explicit_location): Update.  Remove cleanups.

8 years agoRemove some cleanups from gnu-v3-abi.c
Tom Tromey [Fri, 7 Apr 2017 04:48:27 +0000 (22:48 -0600)] 
Remove some cleanups from gnu-v3-abi.c

This removes some cleanups from gnu-v3-abi.c, by using std::vector
rather than VEC.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

* gnu-v3-abi.c (value_and_voffset_p): Remove typedef.
(compare_value_and_voffset): Change type.  Update.
(compute_vtable_size): Change type of "offset_vec".
(gnuv3_print_vtable): Use std::vector.  Remove cleanups.
(gnuv3_get_typeid): Remove extraneous declaration.