Commit Graph

41859 Commits

Author SHA1 Message Date
Andrew Burgess 35ee2dc2e4 gdb: Guard against NULL dereference in dwarf2_init_integer_type
In this commit:

    commit eb77c9df9f
    Date:   Thu Oct 18 14:04:27 2018 +0100

        gdb: Handle ICC's unexpected void return type

A potential dereference of a NULL pointer was introduced if a
DW_TAG_base_type is missing a DW_AT_name attribute.

I have taken this opportunity to fix a slight confusion that existed
in the test also added in the above commit, the test had two C
variables, declared like this:

    int var_a = 5;

    void *var_ptr = &var_a;

However, the fake DWARF in the test script declared them like this:

    void var_a = 5;

    void *var_ptr = &var_a;

This wasn't a problem as the test never uses 'var_a' directly, this
only exists so 'var_ptr' can be initialised.  However, it seemed worth
fixing.

I've also added a test for a DW_TAG_base_type with a missing
DW_AT_name, as clearly there's not test currently that covers this
(the original patch tested cleanly).  I can confirm that the new test
causes GDB to crash before this patch, and passes with this patch.

gdb/ChangeLog:

	* dwarf2read.c (dwarf2_init_integer_type): Check for name being
	NULL before dereferencing it.

gdb/testsuite/ChangeLog:

	* gdb.dwarf2/void-type.exp: Rename types, and make var_a an 'int'.
	* gdb.dwarf2/missing-type-name.exp: New file.
2018-11-07 12:58:56 +00:00
Tom de Vries 31aceee863 [gdb] Fix gdb crash when reading core file
Consider the test-case from this patch, compiled with O0.

The executable segfaults, and generates a core dump:
...
$ ./a.out
Segmentation fault (core dumped)
...

When loading the core file, limiting stack size to 4MB, gdb crashes:
...
$ ulimit -s 4096
$ gdb -batch ./a.out core.saved
[New LWP 19379]
Segmentation fault (core dumped)
...

The crash originates here in linux_vsyscall_range_raw, where we call alloca
with phdrs_size == 4194112 (roughly 4MB):
...
      phdrs = (Elf_Internal_Phdr *) alloca (phdrs_size);
...

While for this test-case gdb runs fine with the system default stack limit of
8MB, there are cases reported of 12MB phdrs_size where gdb also crashes with
the system default stack limit.

Fix this by using xmalloc instead of alloca, which prevents the crash provided
the stack limit is at least 112kb.

Build and reg-tested on x86_64-linux.

2018-11-06  Tom de Vries  <tdevries@suse.de>

	* linux-tdep.c (linux_vsyscall_range_raw): Use xmalloc to allocate
	program headers.

	* gdb.base/many-headers.c: New test.
	* gdb.base/many-headers.exp: New file.
2018-11-06 23:15:41 +01:00
Jim Wilson 109be305bb RISC-V: Force variables to .data for code_elim.
RISC-V puts a global variable in .sdata by default, which causes the
add-symbol-file commands with -s .data to fail as there is no .data section.
This fixes 3 testsuite failures.

	gdb/testsuite/
	* gdb.base/code_elim.exp: For riscv, set additional_flags
	to include -msmall-data-limit=0.
2018-11-06 11:06:23 -08:00
Max Filippov f11acc5ec0 gdb: xtensa: use linux ABI code for uclinux
gdb/
2018-11-06  Max Filippov  <jcmvbkbc@gmail.com>

	* configure.tgt (xtensa*-*-linux*): Change to xtensa*-*-*linux*
	so that it applies to uclinux as well.
2018-11-06 10:25:11 -08:00
Marius Muench 9e237747bd ARM: Do not use FP reg when on AAPCS
GDB tries to dereference the frame pointer in arm_scan_prologue as a
last resort to create frame information.
However, the more recent AAPCS ABI does not make use of a frame pointer.

This patch checks whether the specified arm_abi is AAPCS before
dereferencing the "frame pointer". If so, just return as efforts to use
it for restoring frame information won't work.

gdb/ChangeLog
2018-11-06  Marius Muench  <marius.muench@eurecom.fr>

	* arm-tdep.c (arm_scan_prologue): Don't dereference FP reg
	when on AAPCS.
2018-11-06 10:54:08 -07:00
John Baldwin bcecc11da2 Note that PT_GETREGS supplies SSTATUS for FreeBSD/riscv.
This permits reading the value of the SSTATUS CSR returned by ptrace()
for live FreeBSD/riscv processes.

	* riscv-fbsd-nat.c (getregs_supplies): Return true for
	RISCV_CSR_SSTATUS_REGNUM.
2018-11-06 09:47:21 -08:00
Philippe Waroquiers bb20ccab70 ChangeLog for 'Fix 4K leak each time next/step changes of function.' 2018-11-05 23:09:44 +01:00
Philippe Waroquiers 8e6a5953e1 Fix 4K leak in open_source_file each time next/step changes of function.
When current function changes after a next/step, GDB shows a message such as:
  (gdb) s
  info_fun1 ()
      at /bd/home/philippe/gdb/git/build_smallthing/gdb/testsuite/../../../smallthing/gdb/testsuite/gdb.base/info_qt.c:41
  41	  info_qt_inc++;
  (gdb)

Valgrind reports a 4K definite leak for each such message (full stacktrace of
the leak below).

This patch fixes this leak, by transferring the current s->fullname to the
unique_xmalloc_ptr fullname given to find_and_open_source.

Note that I do not understand why find_and_open_source always tries to
re-execute the substitution rules on the provided fullname, as source.c
symtab_to_fullname just blindly returns a non NULL s->fullname, counting on
forget_cached_source_info to be called if search dir or substitution rules are
changed.  Similarly, psymtab_to_fullname also just returns a non NULL
ps->fullname.

==15309== VALGRIND_GDB_ERROR_BEGIN
==15309== 69,632 bytes in 17 blocks are definitely lost in loss record 3,158 of 3,186
==15309==    at 0x4C2BE2D: malloc (vg_replace_malloc.c:299)
==15309==    by 0x5BF0987: realpath@@GLIBC_2.3 (canonicalize.c:78)
==15309==    by 0x41F713: gdb_realpath(char const*) (pathstuff.c:72)
==15309==    by 0x608833: openp(char const*, enum_flags<openp_flag>, char const*, int, std::unique_ptr<char, gdb::xfree_deleter<char> >*) (source.c:861)
==15309==    by 0x608B89: find_and_open_source(char const*, char const*, std::unique_ptr<char, gdb::xfree_deleter<char> >*) (source.c:1049)
==15309==    by 0x608D0B: open_source_file(symtab*) (source.c:1074)
==15309==    by 0x609101: print_source_lines_base(symtab*, int, int, enum_flags<print_source_lines_flag>) (source.c:1291)
==15309==    by 0x614ADF: print_frame_info(frame_info*, int, print_what, int, int) (stack.c:911)
==15309==    by 0x614C45: print_stack_frame(frame_info*, int, print_what, int) (stack.c:181)
==15309==    by 0x511D5E: print_stop_location (infrun.c:8044)
==15309==    by 0x511D5E: print_stop_event(ui_out*) (infrun.c:8061)
==15309==    by 0x40DD6D: cli_on_normal_stop(bpstats*, int) (cli-interp.c:145)
==15309==    by 0x512409: operator() (functional:2127)
==15309==    by 0x512409: notify (observable.h:106)
==15309==    by 0x512409: normal_stop() (infrun.c:8334)
==15309==    by 0x5156D8: fetch_inferior_event(void*) (infrun.c:3955)
==15309==    by 0x4B3EEC: gdb_wait_for_event(int) (event-loop.c:859)
==15309==    by 0x4B3FF6: gdb_do_one_event() [clone .part.4] (event-loop.c:322)
==15309==    by 0x4B41B4: gdb_do_one_event (common-exceptions.h:219)
==15309==    by 0x4B41B4: start_event_loop() (event-loop.c:371)
==15309==    by 0x551217: captured_command_loop() (main.c:330)
==15309==    by 0x55220C: captured_main (main.c:1177)
==15309==    by 0x55220C: gdb_main(captured_main_args*) (main.c:1193)
==15309==    by 0x29B4F7: main (gdb.c:32)
==15309==
==15309== VALGRIND_GDB_ERROR_END

gdb/ChangeLog
2018-11-04  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* source.c (open_source_file): Fix leak by transferring the
	current s->fullname to the unique_xmalloc_ptr fullname given
	to find_and_open_source.
2018-11-05 21:26:03 +01:00
Tom Tromey a31abe80ea Return gdbpy_ref from gdbpy_get_varobj_pretty_printer
This changes gdbpy_get_varobj_pretty_printer to return a gdbpy_ref.

gdb/ChangeLog
2018-11-04  Tom Tromey  <tom@tromey.com>

	* varobj.c (install_default_visualizer): Update.
	* python/python-internal.h (gdbpy_get_varobj_pretty_printer):
	Return gdbpy_ref.
	* python/py-prettyprint.c (search_pp_list): Return gdbpy_ref.
	(find_pretty_printer_from_progspace)
	(find_pretty_printer_from_gdb, find_pretty_printer)
	(gdbpy_get_varobj_pretty_printer): Return gdbpy_ref.
	(gdbpy_get_varobj_pretty_printer, gdbpy_default_visualizer):
	Update.
2018-11-04 08:01:01 -07:00
Tom Tromey 833d985d1c Return gdbpy_ref from some Python string functions
This changes python_string_to_unicode,
python_string_to_target_python_string, and
host_string_to_python_string to return gdbpy_ref.

gdb/ChangeLog
2018-11-04  Tom Tromey  <tom@tromey.com>

	* python/python.c (gdbpy_parameter_value): Update.
	* python/python-internal.h (python_string_to_unicode)
	(python_string_to_target_python_string)
	(host_string_to_python_string): Return gdbpy_ref.
	* python/py-utils.c (python_string_to_unicode)
	(unicode_to_encoded_python_string)
	(unicode_to_target_python_string)
	(python_string_to_target_string)
	(python_string_to_target_python_string): Return gdbpy_ref.
	(python_string_to_host_string): Update.
	(host_string_to_python_string): Return gdbpy_ref.
	* python/py-symtab.c (stpy_get_filename, stpy_get_producer)
	(stpy_fullname): Update.
	* python/py-progspace.c (pspy_get_filename, pspy_solib_name):
	Update.
	* python/py-prettyprint.c (print_string_repr): Update.
	* python/py-objfile.c (objfpy_get_filename, objfpy_get_username)
	(objfpy_get_build_id): Update.
	* python/py-breakpoint.c (bppy_get_location)
	(bppy_get_expression, bppy_get_condition, bppy_get_commands):
	Update.
2018-11-04 08:01:01 -07:00
Tom Tromey 12dfa12a3c Return gdbpy_ref from gdb_py_object_from_*longest
This changes gdb_py_object_from_longest and
gdb_py_object_from_ulongest to return a gdbpy_ref rather than a
PyObject*.

gdb/ChangeLog
2018-11-04  Tom Tromey  <tom@tromey.com>

	* python/python-internal.h (gdb_py_object_from_longest)
	(gdb_py_object_from_ulongest): Return gdbpy_ref.
	* python/py-value.c (valpy_int): Update.
	* python/py-utils.c (gdb_py_object_from_longest): Return
	gdbpy_ref.
	(gdb_py_object_from_ulongest): Likewise.
	* python/py-type.c (typy_get_alignof): Update.
	* python/py-linetable.c (ltpy_get_all_source_lines)
	(ltpy_entry_get_line, ltpy_entry_get_pc): Update.
	* python/py-block.c (blpy_get_start, blpy_get_end): Update.
2018-11-04 08:01:00 -07:00
Philippe Waroquiers 470678d7c9 OBVIOUS Fix a typo in ada-lang.c add_prefix_cmd for "set ada"
Correct typo in add_prefix_cmd doc arg for "set ada".
2018-11-03 21:33:42 +01:00
Philippe Waroquiers 814fa4f632 OBVIOUS Remove a useless const char *type and its initialization.
Valgrind detected a leak for the line:
  type = xstrdup ("auto");

as the compile probably dropped the type variable completely, as its
only usage was this initialization.

So, remove the useless variable.
2018-11-03 19:31:41 +01:00
Philippe Waroquiers 3c6dd3d1c7 OBVIOUS fix the month of the last gdb/ChangeLog entry to be 11 instead of 12. 2018-11-03 19:19:05 +01:00
Joel Brobecker e8bf1ce461 (Ada) Add ravenscar tasking support on AArch64
This patch adds support for debugging Ravenscar tasks, similar to what
is done for ppc and sparc.

gdb/ChangeLog:

        * aarch64-ravenscar-thread.h, aarch64-ravenscar-thread.c:
        New files.
        * aarch64-tdep.c: #include "aarch64-ravenscar-thread.h".
        (aarch64_gdbarch_init): Add call to register_aarch64_ravenscar_ops.
        * Makefile.in (ALL_64_TARGET_OBS): Add aarch64-ravenscar-thread.o.
        (HFILES_NO_SRCDIR): Add aarch64-ravenscar-thread.h.
        (ALLDEPFILES): Add aarch64-ravenscar-thread.c.
        * configure.tgt (cpu_obs) [aarch64*-*-*]: Add ravenscar-thread.o
        and aarch64-ravenscar-thread.o.
        * NEWS: Add entry documenting Ravenscar tasking support
        on AArch64 ELF.
2018-11-02 13:37:29 -04:00
Philippe Waroquiers d54cfd762b QUIET flag initialization missing in 2 places.
Fix by Matthew Malcomson  <matthew.malcomson@arm.com>

Pushed as obvious.
2018-11-02 14:20:59 +01:00
Jim Wilson 3ba2ee38a6 RISC-V: Don't allow unaligned breakpoints.
Some hardware doesn't support unaligned accesses, and a bare metal target
may not have an unaligned access trap handler.  So if the PC is 2-byte
aligned, then use a 2-byte breakpoint to avoid unaligned accesses.

Tested on native RV64GC Linux with gdb testsuite and cross on spike
simulator and openocd with riscv-tests/debug.

	gdb/
	* riscv-tdep.c (riscv_breakpoint_kind_from_pc): New local unaligned_p.
	Set if pcptr if unaligned.  Return 2 if unaligned_p true.  Update
	debugging messages.
2018-11-01 17:25:15 -07:00
Joel Brobecker e2b7af7242 (Ada) fix "error in expression" when using watch -location command
The "watch -l EXPR" command with the language set to Ada currently
fails with the following error:

     (gdb) watch -l global_var
     Error in expression, near ` 0x000000000062d2d8'.

The error occurs because GDB internally translate the request into
a watchpoint on a different expression: "* (TYPE *) ADDR" where
TYPE and ADDR are the type and the address of the object returned
by the expression's evaluation (resp.). So, in the example above,
global_var being an integer stored at 0x000000000062d2d8, GDB tries
to set a watchpoint on "* (integer *) 0x000000000062d2d8", which
fails, because we try to parse this expression with Ada, when
in fact it is not valid.

This patch fixes the issue by implementing the la_watch_location_expression
language method, using a syntax that the Ada parser recognizes
("{TYPE} ADDR").

gdb/ChangeLog:

	* ada-lang.c (ada_watch_location_expression): New function.
        (ada_language_defn): Set la_watch_location_expression to
        ada_watch_location_expression.

gdb/testsuite/ChangeLog:

        * gdb.ada/watch_minus_l: New testcase.
2018-11-01 15:15:41 -07:00
Joel Brobecker 8b578f9c76 remove trailing spaces in print-utils.c ("int_string" function)
gdb/ChangeLog:

        * print-utils.c (int_string): Remove unnecessary trailing spaces.
2018-11-01 15:08:57 -07:00
Joel Brobecker 87f7ab7b84 gdb.texinfo: Fix the output of the "info tasks 2" example
gdb/doc/ChangeLog:

        * gdb.texinfo (Ada Tasks): Update the "info task 2" example
        output to match the current implementation.
2018-11-01 15:05:40 -07:00
Joel Brobecker 1cc62f2e44 rs6000-tdep.c:skip_prologue avoid negative left shift
the rs6000-tdep.c::skip_prologue function has the following code:

          unsigned int all_mask = ~((1U << fdata->saved_gpr) - 1);

          /* Not a recognized prologue instruction.
             Handle optimizer code motions into the prologue by continuing
             the search if we have no valid frame yet or if the return
             address is not yet saved in the frame.  Also skip instructions
             if some of the GPRs expected to be saved are not yet saved.  */
          if (fdata->frameless == 0 && fdata->nosavedpc == 0
              && (fdata->gpr_mask & all_mask) == all_mask)
            break;

The problem is that fdata->saved_gpr is initialized to -1, and so,
if no instruction is found in the function's prologue that causes us
to set that field to a non-negative value, the sanitizer crashes
with the following message:

    rs6000-tdep.c:1965:34: runtime error: shift exponent -1 is negative

This patch fixes the issue the by only doing the shift if saved_gpr
is not negative. When saved_gpr is negative, we actually don't need
the shift.

gdb/ChangeLog:

        * rs6000-tdep.c (skip_prologue): Fix potential negative left
        shifting.

Tested on ppc-linux native.
Also tested on ppc-elf (baremetal) using AdaCore's testsuite.
2018-11-01 17:46:58 -04:00
Jerome Guitton e1c3a37375 arm-pikeos: software single step
On ARM, PikeOS does not support hardware single step, causing various
semi-random errors when trying to next/step over some user code. So
this patch changes this target to use software-single-step instead.

The challenge is that, up to now, the PikeOS target was in all respects
identical to a baremetal target as far as GDB was concerned, meaning
we were using the baremetal osabi for this target too. This is no longer
possible, and we need to introduce a new OSABI variant. Unfortunately,
there isn't anything in the object file that would allow us to
differentiate between the two platforms. So we have to rely on a
heuristic instead, where we look for some known symbols that are
required in a PikeOS application (these symbols are expected to be
defined by the default linker script, and correspond to routines used
to allocate the application stack).

For the long run, the hope is that the stub implementation provided
by PikeOS is enhanced so that it includes vContSupported+ to the
$qSupported query, and then that the reply to the "vCont?" query
only return support for "continue" operations (thus exclusing "step"
operations). We could then use that information to reliably determine
at connection time that the target does not support single-stepping
and therefore automatically turn software single-stepping automatically
based on it.

gdb/ChangeLog:

        * defs.h (enum gdb_osabi): Add GDB_OSABI_PIKEOS.
        * osabi.c (gdb_osabi_names): Add name for GDB_OSABI_PIKEOS.
        * arm-pikeos-tdep.c: New file.
        * configure.tgt: Add arm-pikeos-tdep.o to the case of ARM
        embedded system.
        * Makefile.in (ALL_TARGET_OBS): Add arm-pikeos-tdep.o.

Tested on arm-pikeos and arm-elf using AdaCore's testsuite.
We also evaluated it on armhf-linux as a cross platform.
2018-11-01 14:43:44 -07:00
Simon Marchi e8d8cce69b Import mkdtemp gnulib module, fix mingw build
Building with mingw currently fails:

  CXX    unittests/mkdir-recursive-selftests.o
/home/emaisin/src/binutils-gdb/gdb/unittests/mkdir-recursive-selftests.c: In function ‘void selftests::mkdir_recursive::test()’:
/home/emaisin/src/binutils-gdb/gdb/unittests/mkdir-recursive-selftests.c:49:20: error: ‘mkdtemp’ was not declared in this scope
   if (mkdtemp (base) == NULL)
                    ^
Commit

    e418a61a67 ("Move mkdir_recursive to common/filestuff.c")

moved this code, but also removed the HAVE_MKDTEMP guard which prevented
the mkdtemp call to be compiled on mingw.

We can either put back the HAVE_MKDTEMP ifdef, or import the gnulib
mkdtemp module, which provides the function for mingw.  Since the
mkdir_recursive is susceptible to be used on mingw at some point, I
think it would be nice to have it tested on mingw, so I did the latter.

Once built, I tested it on Windows (copied the resulting gdb.exe on a
Windows machine, ran it, and ran "maint selftest mkdir_recursive").  It
failed, because the temporary directory is hardcoded to "/tmp/...".  I
therefore added and used a new get_standard_temp_dir function, which
returns an appropriate temporary directory for the host platform.

gdb/ChangeLog:

	* common/pathstuff.c (get_standard_temp_dir): New.
	* common/pathstuff.h (get_standard_temp_dir): New.
	* config.in: Re-generate.
	* configure: Re-generate.
	* configure.ac: Don't check for mkdtemp.
	* gnulib/aclocal-m4-deps.mk: Re-generate.
	* gnulib/aclocal.m4: Re-generate.
	* gnulib/config.in: Re-generate.
	* gnulib/configure: Re-generate.
	* gnulib/import/Makefile.am: Re-generate.
	* gnulib/import/Makefile.in: Re-generate.
	* gnulib/import/m4/gnulib-cache.m4: Re-generate.
	* gnulib/import/m4/gnulib-comp.m4: Re-generate.
	* gnulib/import/m4/mkdtemp.m4: New file.
	* gnulib/import/mkdtemp.c: New file.
	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES):
	Add mkdtemp module.
	* unittests/mkdir-recursive-selftests.c (test): Use
	get_standard_temp_dir.
	(_initialize_mkdir_recursive_selftests): Remove HAVE_MKDTEMP
	ifdef.
	* compile/compile.c (get_compile_file_tempdir): Likewise.
2018-11-01 15:41:43 -04:00
Sangamesh Mallayya cdcda965ea Reading signal handler frame in AIX
In AIX if gdb is debugging an application which has a signal handler
and reaches the signal handler frame, then we need to read the back
chain address from sigcontext saved on the stack, similarly the LR.

As backchain at an offset 0 will be 0, because we will have a
sigconext saved after the minimum stack size. So the correct
backchain will be at an offset after minimum stack and the LR at
an offset 8 will be of the signal millicode address.
If the back chain pointer is NULL and the LR field is in the kernel
segment(ex. 0x00004a14) then we can probably assume we are in a
signal  handler.

sample output

(gdb) bt
0  sig_handle_aix (signo=11) at aix-sighandle.c:7
1  0x0000000000004a94 in ?? ()
(gdb)

expected output

(gdb) bt
0  sig_handle_aix (signo=11) at aix-sighandle.c:7
1  <signal handler called>
2  0x0000000100000748 in foo () at aix-sighandle.c:14
3  0x000000010000079c in main () at aix-sighandle.c:19

gdb/ChangeLog:

2018-11-01  Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>

	* rs6000-aix-tdep.c: Include "trad-frame.h" and "frame-unwind.h".
	(SIG_FRAME_LR_OFFSET64): New define.
	(SIG_FRAME_FP_OFFSET64): New define.
	(aix_sighandle_frame_cache): New Function.
	(aix_sighandle_frame_this_id): New Function.
	(aix_sighandle_frame_prev_register): New Function.
	(aix_sighandle_frame_sniffer): New Function.
	(aix_sighandle_frame_unwind): New global variable.
	(rs6000_aix_init_osabi): Install new frame unwinder.

gdb/testsuite/ChangeLog:

2018-11-01  Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>

	* gdb.arch/aix-sighandle.c: New file.
	* gdb.arch/aix-sighandle.exp: New file.
2018-11-01 06:23:59 -04:00
Sergio Durigan Junior 656efb5e26 Fix PR gdb/23835: Don't redefine _FORTIFY_SOURCE if it's already defined
Gentoo has a local GCC patch which always defines _FORTIFY_SOURCE=2.
This causes a build problem when building GDB there, because
"common/common-defs.h" also defines _FORTIFY_SOURCE=2:

    CXX    gdb.o
  In file included from ../../gdb/defs.h:28:0,
		   from ../../gdb/gdb.c:19:
  ../../gdb/common/common-defs.h:71:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
   #define _FORTIFY_SOURCE 2

  <built-in>: note: this is the location of the previous definition
  cc1plus: all warnings being treated as errors
  make[2]: *** [Makefile:1619: gdb.o] Error 1

Even though it is questionable whether Gentoo's approach is the
correct one:

  https://jira.mongodb.org/browse/SERVER-29982
  https://bugs.gentoo.org/621036

it is still possible for GDB to be a bit more robust here and make
sure it just defines _FORTIFY_SOURCE if it hasn't been defined
already.  This patch does that.

Tested by rebuilding and making sure the macro was defined.

gdb/ChangeLog:
2018-10-31  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR gdb/23835
	* common/common-defs.h: Don't redefine _FORTIFY_SOURCE if it's
	already defined.
2018-10-31 17:42:43 -04:00
Andrew Burgess 92dcebf3fa gdb/riscv: Fix failures on rv64 in gdb.arch/riscv-reg-aliases.exp test
The gdb.arch/riscv-reg-aliases.exp test didn't take into account that
on RV64 (and RV128) the floating point registers are represented as a
union.  This patch updates the test to handle this.

Tested against RV32 and RV64.

gdb/testsuite/ChangeLog:

	* gdb.arch/riscv-reg-aliases.exp: Rewrite to take account of float
	registers being unions.
2018-10-31 18:03:01 +00:00
Tom de Vries 68b9ac18cf [gdb/testsuite] Factor out lib/valgrind.exp
Factor out common code related to vgdb setup and cleanup in valgrind-bt.exp,
valgrind-disp-step.exp and gdb.base/valgrind-infcall.exp.

Tested on x86_64-linux with and without --target_board=native-gdbserver.

2018-10-31  Tom de Vries  <tdevries@suse.de>

	* lib/valgrind.exp: New file.
	 (vgdb_start, vgdb_stop): New procs, factored out of ...
	* gdb.base/valgrind-bt.exp: ... here, ...
	* gdb.base/valgrind-disp-step.exp: ... here and ...
	* gdb.base/valgrind-infcall.exp: ... here.
2018-10-31 18:26:40 +01:00
Tom de Vries 1443936e96 [gdb/testsuite] get_valueof: Don't output value in test name
The get_valueof outputs the value it has read as part of the test name.  This
causes test names to vary from run to run, and adds some noise when diffing
test results.  e.g.:

-PASS: gdb.guile/scm-ports.exp: buffered: get valueof "$sp" (140737488343920)
+PASS: gdb.guile/scm-ports.exp: buffered: get valueof "$sp" (140737488343968)
-PASS: gdb.guile/scm-ports.exp: unbuffered: get valueof "$sp" (140737488343920)
+PASS: gdb.guile/scm-ports.exp: unbuffered: get valueof "$sp" (140737488343968)

This patch removes that, since it's probably not very useful.

Tested on x86_64-linux.

2018-10-31  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (get_valueof): Don't output read value in test name.
2018-10-31 17:45:38 +01:00
Pedro Franco de Carvalho 64f57f3d7d [PowerPC] Include nat/linux-ptrace.h in native targets
Patch "[PowerPC] Add support for PPR and DSCR" used
PTRACE_GETREGSET/SETREGSET without including the fallback definitions
from "nat/linux-ptrace.h".  Include this header to avoid breaking
builds in systems that don't define them.

gdb/ChangeLog:
2018-10-31  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

	* ppc-linux-nat.c: Include nat/linux-ptrace.h.

gdb/gdbserver/ChangeLog:
2018-10-31  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

	* linux-ppc-low.c: Include nat/linux-ptrace.h.
2018-10-31 10:59:26 -03:00
Andrew Burgess eb77c9df9f gdb: Handle ICC's unexpected void return type
I encountered a binary compiled with Intel's C Compiler (ICC) version
14.0.5.212, which seemed to contain some non-standard DWARF.

The DWARF spec (V5 3.3.2) says:

    Debugging information entries for C void functions should not have
    an attribute for the return type.

However, what I observed in the DWARF from this ICC compiled binary
was this:

    ...
    <0><857>: Abbrev Number: 1 (DW_TAG_compile_unit)
       <858>   DW_AT_comp_dir    : (indirect string, offset: 0x48d): /tmp/
       <85c>   DW_AT_language    : 1       (ANSI C)
       <85d>   DW_AT_name        : (indirect string, offset: 0x77c): filename.c
       <861>   DW_AT_producer    : (indirect string, offset: 0x520): Intel(R) C Intel(R) 64 Compiler ...
       <865>   DW_AT_low_pc      : 0x4378d0
       <86d>   DW_AT_high_pc     : 0x4378f0
       <875>   DW_AT_stmt_list   : 0xa37
    ...
    <1><7ea>: Abbrev Number: 2 (DW_TAG_base_type)
       <7eb>   DW_AT_byte_size   : 0
       <7ec>   DW_AT_encoding    : 5       (signed)
       <7ed>   DW_AT_name        : (indirect string, offset: 0x58f): void
    ...
    <1><7f1>: Abbrev Number: 3 (DW_TAG_subprogram)
       <7f2>   DW_AT_decl_line   : 268
       <7f4>   DW_AT_decl_column : 30
       <7f5>   DW_AT_decl_file   : 1
       <7f6>   DW_AT_type        : <0x7ea>
       <7fa>   DW_AT_prototyped  : 1
       <7fb>   DW_AT_name        : (indirect string, offset: 0x761): function_foo
       <7ff>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0x761): function_foo
       <803>   DW_AT_low_pc      : 0x4378a0
       <80b>   DW_AT_high_pc     : 0x4378d0
       <813>   DW_AT_external    : 1
    ...

So function 'function_foo' has void return type, but still has a
DW_AT_type attribute for a 0 sized type called void.

What was found was that when the 'finish' command was used to leave
'function_foo', GDB would crash.

The problem is that in infcmd.c:print_return_value GDB tries to filter
out void return types, by looking for the TYPE_CODE_VOID, this fails
for the 'void' type as it has code TYPE_CODE_INT and GDB then tries to
print the 'void' type.

This eventually ends in a call to valprint.c:maybe_negate_by_bytes,
however, the len (length) of the value being negated is 0, which is
not detected or expected by this code, and invalid memory accesses
occur, some of which might cause GDB to crash.

The above DWARF was seen on version 14.0.5.212 of ICC.

I have also tested ICC versions 18.0.2.199 and 17.0.7.259, on both of
these versions, the DW_AT_type on the DW_TAG_subprogram has been
removed, bringing ICC inline with the DWARF standard, and with the
DWARF produced by GCC.

I only have limited access to these specific versions of ICC so I am
unable to get more specific details for when the generated DWARF
became non-standard or when it was changed to be more inline with the
DWARF standard.

Further testing revealed additional places where ICC produced 'void'
related DWARF that GDB struggles with.  When I compiled code that
contained a function with this signature:

    void funcx (void *arg);

on ICC 17/18, I got the following DWARF (notice the void return type
is now gone):

    ...
    <1><32>: Abbrev Number: 2 (DW_TAG_subprogram)
       <33>   DW_AT_decl_line   : 2
       <34>   DW_AT_decl_file   : 1
       <35>   DW_AT_prototyped  : 1
       <36>   DW_AT_name        : (indirect string, offset: 0xc5): funcx
       <3a>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0xc5): funcx
       <3e>   DW_AT_low_pc      : 0x6dc
       <46>   DW_AT_high_pc     : 0x703
       <4e>   DW_AT_external    : 1
    <2><4f>: Abbrev Number: 3 (DW_TAG_formal_parameter)
       <50>   DW_AT_decl_line   : 2
       <51>   DW_AT_decl_file   : 1
       <52>   DW_AT_type        : <0x6a>
       <56>   DW_AT_name        : arg
       <5a>   DW_AT_location    : 2 byte block: 76 70      (DW_OP_breg6 (rbp): -16)
    ...
    <1><6a>: Abbrev Number: 5 (DW_TAG_pointer_type)
       <6b>   DW_AT_type        : <0x6f>
    <1><6f>: Abbrev Number: 6 (DW_TAG_base_type)
       <70>   DW_AT_byte_size   : 0
       <71>   DW_AT_encoding    : 5        (signed)
       <72>   DW_AT_name        : (indirect string, offset: 0xcb): void
    ...

However, the function argument 'arg' does still reference a 'void'
type.  This case doesn't seem as obviously non-standard as the
previous one, but I think that the DWARF standard (V5 5.2) does
suggest that the above is not the recommended approach.  If we compare
to the DWARF generated by GCC 7.3.1:

    ...
    <1><68>: Abbrev Number: 5 (DW_TAG_subprogram)
       <69>   DW_AT_external    : 1
       <69>   DW_AT_name        : (indirect string, offset: 0x221): funcx
       <6d>   DW_AT_decl_file   : 1
       <6e>   DW_AT_decl_line   : 2
       <6f>   DW_AT_prototyped  : 1
       <6f>   DW_AT_low_pc      : 0x400487
       <77>   DW_AT_high_pc     : 0x22
       <7f>   DW_AT_frame_base  : 1 byte block: 9c         (DW_OP_call_frame_cfa)
       <81>   DW_AT_GNU_all_call_sites: 1
       <81>   DW_AT_sibling     : <0xa0>
    <2><85>: Abbrev Number: 6 (DW_TAG_formal_parameter)
       <86>   DW_AT_name        : arg
       <8a>   DW_AT_decl_file   : 1
       <8b>   DW_AT_decl_line   : 2
       <8c>   DW_AT_type        : <0xa0>
       <90>   DW_AT_location    : 2 byte block: 91 58      (DW_OP_fbreg: -40)
    ...
    <1><a0>: Abbrev Number: 7 (DW_TAG_pointer_type)
       <a1>   DW_AT_byte_size   : 8
    ...

Here we see that the DW_TAG_pointer_type doesn't reference any further
type.  This also seems out of line with the DWARF standard (which I
think recommends using a DW_TAG_unspecified_type entry), however GDB
does handle the GCC generated DWARF better.

If we look at how GDB handles the DWARF from GCC, then we see this:

    (gdb) print *arg
    Attempt to dereference a generic pointer.

While on the current HEAD of master dereferencing arg causes undefined
behaviour which will likely crash GDB (for the same reason as was
described above for the 'finish' case).  On earlier versions of GDB
the ICC DWARF would cause this:

    (gdb) print *arg
    $1 = 0

In this patch both the return type, and general variable/parameter
type handling is fixed by transforming the synthetic void entries in
the DWARF, the ones that look like this:

    <1><6f>: Abbrev Number: 6 (DW_TAG_base_type)
       <70>   DW_AT_byte_size   : 0
       <71>   DW_AT_encoding    : 5        (signed)
       <72>   DW_AT_name        : (indirect string, offset: 0xcb): void

into GDB's builtin void type.  My criteria for performing the fix are:

  1. Binary produced by any version of ICC,
  2. We're producing an integer type,
  3. The size is 0, and
  4. The name is "void".

I ignore the signed / unsigned nature of the integer.

Potentially we could drop the ICC detection too, this should be a
reasonably safe transformation to perform, however, I'm generally
pretty nervous when it comes to modifying how the DWARF is parsed so,
for now, I have restricted this to ICC only.

I also added an assertion to maybe_negate_by_bytes.  This is nothing
to do with the actual fix, but should detect incorrect use of this
function in the future, without relying on undefined behaviour to
crash GDB.

I added a new test that makes use the of the testsuite's DWARF
generator.  As it is tricky to create target independent tests that
pass function parameters using the DWARF generator (as specifying the
argument location is target specific) I have instead made use of a
global variable void*.  This still shows the issue.

We already have a predicate in the DWARF parser to detect versions of
ICC prior to 14, however, this issue was spotted on a later version.
As a result I've added a new predicate that is true for any version of
ICC.

gdb/ChangeLog:

	* dwarf2read.c (struct dwarf2_cu): Add producer_is_icc field.
	(producer_is_icc): New function.
	(check_producer): Set producer_is_icc field on dwarf2_cu.
	(dwarf2_init_integer_type): New function.
	(read_base_type): Call dwarf2_init_integer_type instead of
	init_integer_type in all cases.
	(dwarf2_cu::dwarf2_cu): Initialise producer_is_icc field.
	* valprint.c (maybe_negate_by_bytes): Add an assertion that the
	LEN is greater than 0.

gdb/testsuite/ChangeLog:

	* gdb.dwarf2/void-type.c: New file.
	* gdb.dwarf2/void-type.exp: New file.
2018-10-31 13:15:59 +00:00
Tom Tromey 4d5d104997 Check return value of bfd_init
Alan recently added a way for BFD library users to check whether they
were in fact loading a compatible version of BFD:

https://sourceware.org/ml/binutils/2018-10/msg00198.html

It seemed reasonable to me that gdb should do this check as well, in
case someone is dynamically linking against BFD.

Simon pointed out that an earlier version of the patch would cause a
gdb crash if the test failed.  This version works around this by
lowering the call to bfd_init and adding a comment explaining where
'error' can safely be called in captured_main_1.

gdb/ChangeLog
2018-10-30  Tom Tromey  <tom@tromey.com>

	* main.c (captured_main_1): Check return value of bfd_init.
2018-10-30 07:06:17 -06:00
Sergio Durigan Junior fd332753fa Remove relational operators from common/offset-type.h
This patch is a follow-up of:

  https://sourceware.org/ml/gdb-patches/2018-10/msg00601.html

It removes the declaration of the relational operators for
common/offset-type.h.  As it turns out, these overloads are not being
used when a new offset type is declared, because, according to Pedro
Alves:

  I think the functions aren't called because they are templates, and
  thus the built-in (non-template) versions take precedence.  If you
  make them non-templates, then they should be called.  But, the
  built-ins are fine, so yeah, we can just remove the custom
  definitions.

The patch also adjusts the comments on the code.

No regressions introduced.

gdb/ChangeLog:
2018-10-29  Sergio Durigan Junior  <sergiodj@redhat.com>

	* common/offset-type.h (DEFINE_OFFSET_REL_OP): Delete.
	Adjust comments.
2018-10-29 23:48:37 -04:00
Simon Marchi 80e24d0986 Revert "GDBSERVER: Listen on a unix domain (instead of TCP) socket if requested."
This reverts commit f19c7ff839.
2018-10-29 13:28:24 -04:00
Simon Marchi 6a0b3457ee Revert "GDB: Document the unix::/path/to/socket of remote connection."
This reverts commit 6d0f8100c1.
2018-10-29 13:28:15 -04:00
Simon Marchi 6cf3675653 Revert "GDB: Fix documentation for invoking GDBSERVER"
This reverts commit 0a163825df.
2018-10-29 13:24:23 -04:00
Simon Marchi 431f22cc09 Revert "GDB: Remote target can now accept the form unix::/path/to/socket."
This reverts commit 88f5cc8cf8.
2018-10-29 13:22:47 -04:00
Simon Marchi 7f53228719 Revert "GDB: Only build for "unix:" connections if AF_LOCAL is supported."
This reverts commit 98a17ece01.
2018-10-29 13:22:42 -04:00
Rainer Orth 30a7953dbf Provide get_shell declaration in procfs.c
The Solaris build is currently broken:

/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In member function ‘virtual void procfs_target::create_inferior(const char*, const string&, char**, int)’:
/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:3038:28: error: ‘get_shell’ was not declared in this scope
   const char *shell_file = get_shell ();
                            ^~~~~~~~~
/vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:3038:28: note: suggested alternative: ‘getusershell’
   const char *shell_file = get_shell ();
                            ^~~~~~~~~
                            getusershell

The following patch fixes this.  Tested on amd64-pc-solaris2.11.


2018-10-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* procfs.c: Include common/pathstuff.h.
2018-10-29 10:28:40 +01:00
John Darrington 98a17ece01 GDB: Only build for "unix:" connections if AF_LOCAL is supported.
Commit f19c7ff839 added a new member to the
prefixes array which included a use of the symbol AF_LOCAL.   Unfortunately,
not all systems declare this symbol.    This change only compiles the "unix:"
member if the system knows about AF_LOCAL.

gdb/ChangeLog:

* configure.ac: New test HAVE_AF_LOCAL
* common/netstuff.c (parse_connection_spec) [prefixes]: Only compile "unix:"
   if HAVE_AF_LOCAL is true.
* configure: regenerate.
* config.in: regenerate.
2018-10-29 08:07:32 +01:00
Andrew Burgess a3d7226832 gdb/riscv: Add back missing braces in riscv-linux-nat.c
In this commit:

    commit ee67fd7f3f
    Date:   Thu Oct 25 12:03:31 2018 +0100

        gdb/riscv: Use correct regnum in riscv_linux_nat_target::fetch_registers

I incorrectly removed a set of braces in violation of the GDB coding
standard.  This commit adds them back.

gdb/ChangeLog:

	* riscv-linux-nat.c (riscv_linux_nat_target::fetch_registers):
	Add missing braces.  No functional change.
2018-10-28 10:43:26 +00:00
Philippe Waroquiers cd948f5b2b OBVIOUS Use report_unrecognized_option_error in 'demangle' and 'info macro' commands.
Rather than have some local logic to throw an error for an unrecognized option,
use the new cli-utils.h function throwing an error.

At the same time, fix some wrong indentation in info_macro_command
and fix a small bug in 'demangle' error handling:

Without the patch:
  (gdb) demangle -L c++ abcd
  Unrecognized option 'c++' to demangle command.  Try "help demangle".
  (gdb)

With the patch:
  (gdb) demangle -L c++ abcd
  Unrecognized option '-L' to demangle command.  Try "help demangle".

2018-10-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* macrocmd.c (info_macro_command): Use report_unrecognized_option_error
	to report a bad option and fix indentation.
	* demangle.c (demangle_command): Use report_unrecognized_option_error
	to report a bad option and correctly report the bad option.
2018-10-27 21:36:53 +02:00
Tom Tromey b50a8b9a91 Cache a copy of the user's shell on macOS
Recent versions of macOS have a feature called System Integrity
Protection.  Among other things, This feature prevents ptrace from
tracing certain programs --- for example, the programs in /bin, which
includes typical shells.

This means that startup-with-shell does not work properly.  This is PR
cli/23364.  Currently there is a workaround in gdb to disable
startup-with-shell when this feature might be in use.

This patch changes gdb to be a bit more precise about when
startup-with-shell will not work, by checking whether the shell
executable is restricted.

If the shell is restricted, then this patch will also cause gdb to
cache a copy of the shell in the gdb cache directory, and then reset
the SHELL environment variable to point to this copy.  This lets
startup-with-shell work again.

Tested on High Sierra by trying to start a program using redirection,
and by running startup-with-shell.exp.

gdb/ChangeLog
2018-10-27  Tom Tromey  <tom@tromey.com>

	PR cli/23364:
	* darwin-nat.c (copied_shell): New global.
	(may_have_sip): Rename from should_disable_startup_with_shell.
	(copy_shell_to_cache, maybe_cache_shell): New functions.
	(darwin_nat_target::create_inferior): Update.  Use
	copied_shell.
2018-10-27 11:58:41 -06:00
Tom Tromey 36033ef57c Do not reopen temporary files
The current callers of mkostemp close the file descriptor and then
re-open it with fopen.  It seemed better to me to continue to use the
already-opened file descriptor, so this patch rearranges the code a
little in order to do so.  It takes care to ensure that the files are
only unlinked after the file descriptor in question is closed, as
before.

gdb/ChangeLog
2018-10-27  Tom Tromey  <tom@tromey.com>

	* unittests/scoped_fd-selftests.c (test_to_file): New function.
	(run_tests): Call test_to_file.
	* dwarf-index-write.c (write_psymtabs_to_index): Do not reopen
	temporary files.
	* common/scoped_fd.h (scoped_fd::to_file): New method.
2018-10-27 11:58:41 -06:00
Tom Tromey b3279b601e Use mkostemp, not mkstemp
I noticed that gdb could leak file descriptors coming from mkstemp.
This patch fixes the problem by importing the gnulib mkostemp instead,
and then changing gdb to pass O_CLOEXEC.

A small gnulib patch was needed.  This has already been accepted
upstream.

gdb/ChangeLog
2018-10-27  Tom Tromey  <tom@tromey.com>

	* unittests/scoped_mmap-selftests.c (test_normal): Use
	gdb_mkostemp_cloexec.
	* unittests/scoped_fd-selftests.c (test_destroy, test_release):
	Use gdb_mkostemp_cloexec.
	* gnulib/aclocal-m4-deps.mk, gnulib/aclocal.m4,
	gnulib/config.in, gnulib/configure,
	gnulib/import/Makefile.am, gnulib/import/Makefile.in,
	gnulib/import/m4/gnulib-cache.m4,
	gnulib/import/m4/gnulib-comp.m4: Update.
	* gnulib/import/m4/mkostemp.m4: New file.
	* gnulib/import/m4/mkstemp.m4: Remove.
	* gnulib/import/mkostemp.c: New file.
	* gnulib/import/mkstemp.m4: Remove.
	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Remove
	mkstemp, add mkostemp.  Apply new patch.
	* gnulib/import/stdlib.in.h: Apply patch.
	* gnulib/patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch:
	New file.
	* dwarf-index-write.c (write_psymtabs_to_index): Use
	gdb_mkostemp_cloexec.
	* common/filestuff.h (gdb_mkostemp_cloexec): New function.
2018-10-27 11:58:41 -06:00
Tom Tromey e418a61a67 Move mkdir_recursive to common/filestuff.c
This moves mkdir_recursive from dwarf-index-cache.c to
common/filestuff.c, and also changes it to return a boolean that says
whether or not it worked.

gdb/ChangeLog
2018-10-27  Tom Tromey  <tom@tromey.com>

	* unittests/mkdir-recursive-selftests.c: New file.
	* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
	unittests/mkdir-recursive-selftests.c.
	* dwarf-index-cache.c (mkdir_recursive): Move to
	common/filestuff.c.
	(index_cache::store): Check return value of mkdir_recursive.
	(create_dir_and_check, test_mkdir_recursive): Move to new file.
	(_initialize_index_cache): Don't register test.
	* common/filestuff.h (mkdir_recursive): Declare.
	* common/filestuff.c (mkdir_recursive): Move from
	dwarf-index-cache.c.  Return bool.
2018-10-27 11:58:41 -06:00
Tom Tromey 29be4d9dee Move make_temp_filename to common/pathstuff.c
Currently make_temp_filename is a function local to
write_psymtabs_to_index.  This patch moves it to pathstuff.c so that
it can be used from other places in gdb.

gdb/ChangeLog
2018-10-27  Tom Tromey  <tom@tromey.com>

	* dwarf-index-write.c (write_psymtabs_to_index): Move
	make_temp_filename to common/pathstuff.c.
	* common/pathstuff.h (make_temp_filename): Declare.
	* common/pathstuff.c (make_temp_filename): New function, moved
	from dwarf-index-write.c.
2018-10-27 11:58:40 -06:00
Tom Tromey 974e684463 Unify shell-finding logic
I noticed several places in gdb that were using getenv("SHELL") and
then falling back to "/bin/sh" if it returned NULL.  This unifies
these into a single function.

gdb/ChangeLog
2018-10-27  Tom Tromey  <tom@tromey.com>

	* procfs.c (procfs_target::create_inferior): Use get_shell.
	* cli/cli-cmds.c (shell_escape): Use get_shell.
	* windows-nat.c (windows_nat_target::create_inferior): Use
	get_shell.
	* common/pathstuff.c (get_shell): New function.
	* nat/fork-inferior.c (SHELL_FILE, get_startup_shell): Remove.
	(fork_inferior): Use get_shell.
	* common/pathstuff.h (get_shell): Declare.
2018-10-27 11:58:40 -06:00
Philippe Waroquiers c8ee3f04a6 Remove a bunch of usages of gdb_suppress_tests in 'runto_main'.
In the 'info -q -t' patch series, I started a new test from
gdb.threads/threadapply.exp, that uses an obsolete way to do
runto_main.

This patch changes all occurrences of runto_main using gdb_suppress_tests
to use instead fail+return.

Note that there are still about 220 occurrences of gdb_suppress_tests
but unclear (to me) if these can be similarly trivially be replaced by a
fail+return.  Further cleanup can be done in follow-up patches.

Tests run on Debian/x86_64.

gdb/testsuite/ChangeLog
2018-10-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.arch/altivec-regs.exp: Do not use gdb_suppress_tests in
	runto_main, use fail + return instead.
	gdb.arch/amd64-byte.exp: Likewise.
	gdb.arch/amd64-dword.exp: Likewise.
	gdb.arch/amd64-word.exp: Likewise.
	gdb.arch/e500-abi.exp: Likewise.
	gdb.arch/e500-regs.exp: Likewise.
	gdb.arch/gdb1291.exp: Likewise.
	gdb.arch/gdb1431.exp: Likewise.
	gdb.arch/i386-avx.exp: Likewise.
	gdb.arch/i386-byte.exp: Likewise.
	gdb.arch/i386-prologue.exp: Likewise.
	gdb.arch/i386-sse.exp: Likewise.
	gdb.arch/i386-word.exp: Likewise.
	gdb.arch/iwmmxt-regs.exp: Likewise.
	gdb.arch/pa-nullify.exp: Likewise.
	gdb.arch/powerpc-prologue.exp: Likewise.
	gdb.arch/s390-tdbregs.exp: Likewise.
	gdb.arch/vsx-regs.exp: Likewise.
	gdb.asm/asm-source.exp: Likewise.
	gdb.base/auxv.exp: Likewise.
	gdb.base/bigcore.exp: Likewise.
	gdb.base/overlays.exp: Likewise.
	gdb.base/savedregs.exp: Likewise.
	gdb.base/setshow.exp: Likewise.
	gdb.base/sigaltstack.exp: Likewise.
	gdb.base/sigbpt.exp: Likewise.
	gdb.base/siginfo-addr.exp: Likewise.
	gdb.base/siginfo-obj.exp: Likewise.
	gdb.base/siginfo-thread.exp: Likewise.
	gdb.base/siginfo.exp: Likewise.
	gdb.base/signull.exp: Likewise.
	gdb.base/sigrepeat.exp: Likewise.
	gdb.base/structs2.exp: Likewise.
	gdb.threads/threadapply.exp: Likewise.
	gdb.threads/watchthreads.exp: Likewise.
	gdb.threads/watchthreads2.exp: Likewise.
2018-10-27 14:47:36 +02:00
Philippe Waroquiers 82b5e646c2 Add a test case for info args|functions|locals|variables [-q] [-t TYPEREGEXP] [NAMEREGEXP]
Add a test case for info args|functions|locals|variables [-q] [-t TYPEREGEXP] [NAMEREGEXP]

gdb/testsuite/ChangeLog
2018-10-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/info_qt.c: New file.
	* gdb.base/info_qt.exp: New file.
2018-10-27 13:54:12 +02:00
Philippe Waroquiers e0a7911fa2 Announce changes in NEWS to info [args|functions|locals|variables]
Announce changes in NEWS to info [args|functions|locals|variables]

gdb/ChangeLog
2018-10-27  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* NEWS: Mention changes to 'info [args|functions|locals|variables]'
2018-10-27 13:54:08 +02:00