]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 26 May 2018 00:02:19 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 25 May 2018 00:02:12 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 24 May 2018 00:02:08 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 23 May 2018 00:01:47 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 22 May 2018 00:01:56 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 21 May 2018 00:02:00 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 20 May 2018 00:02:12 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 19 May 2018 00:01:26 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 18 May 2018 00:01:28 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 17 May 2018 00:01:28 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 16 May 2018 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 15 May 2018 00:01:38 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 14 May 2018 00:01:09 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 13 May 2018 00:02:09 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 12 May 2018 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 11 May 2018 00:01:20 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agogdbserver/Windows: crash during connection establishment phase
Joel Brobecker [Thu, 10 May 2018 15:27:13 +0000 (10:27 -0500)] 
gdbserver/Windows: crash during connection establishment phase

On Windows, starting a new process with GDBserver seems to work,
in the sense that the program does get started, and GDBserver
confirms that it is listening for GDB to connect. However, as soon as
GDB establishes the connection with GDBserver, and starts discussing
with it, GDBserver crashes, with a SEGV.

This SEGV occurs in remote-utils.c::prepare_resume_reply...

  | regp = current_target_desc ()->expedite_regs;
  | [...]
  | while (*regp)

... because, in our case, REGP is NULL.

This patches fixes the issues by adding a parameter to init_target_desc,
in order to make sure that we always provide the list of registers when
we initialize a target description.

gdb/ChangeLog:

        PR server/23158:
        * regformats/regdat.sh: Adjust script, following the addition
        of the new expedite_regs parameter to init_target_desc.

gdb/gdbserver/ChangeLog:

        PR server/23158:
        * tdesc.h (init_target_desc) <expedite_regs>: New parameter.
        * tdesc.c (init_target_desc) <expedite_regs>: New parameter.
        Use it to set the expedite_regs field in the given tdesc.
        * x86-tdesc.h: New file.
        * linux-aarch64-tdesc.c (aarch64_linux_read_description):
        Adjust following the addition of the new expedite_regs parameter
        to init_target_desc.
        * linux-tic6x-low.c (tic6x_read_description): Likewise.
        * linux-x86-tdesc.c: #include "x86-tdesc.h".
        (i386_linux_read_description, amd64_linux_read_description):
        Adjust following the addition of the new expedite_regs parameter
        to init_target_desc.
        * lynx-i386-low.c: #include "x86-tdesc.h".
        (lynx_i386_arch_setup): Adjust following the addition of the new
        expedite_regs parameter to init_target_desc.
        * nto-x86-low.c: #include "x86-tdesc.h".
        (nto_x86_arch_setup): Adjust following the addition of the new
        expedite_regs parameter to init_target_desc.
        * win32-i386-low.c: #include "x86-tdesc.h".
        (i386_arch_setup): Adjust following the addition of the new
        expedite_regs parameter to init_target_desc.

7 years agogdbserver/Windows: Fix "no program to debug" error
Joel Brobecker [Thu, 10 May 2018 15:24:33 +0000 (10:24 -0500)] 
gdbserver/Windows: Fix "no program to debug" error

Trying to start a program with GDBserver on Windows yields
the following error:

    $ gdbserver.exe --once :4444 simple_main.exe
    Killing process(es): 5008
    No program to debug
    Exiting

The error itself comes from the following code shortly after
create_inferior gets called (in server.c::main):

    /* Wait till we are at first instruction in program.  */
    create_inferior (program_path.get (), program_args);
    [...]

    if (last_status.kind == TARGET_WAITKIND_EXITED
        || last_status.kind == TARGET_WAITKIND_SIGNALLED)
      was_running = 0;
    else
      was_running = 1;

    if (!was_running && !multi_mode)
      error ("No program to debug");

What happens is that the "last_status" global starts initialized
as zeroes, which means last_status.kind == TARGET_WAITKIND_EXITED,
and we expect create_inferior to be waiting for the inferior to
start until reaching the SIGTRAP, and to set the "last_status"
global to match that last event we received.

I suspect this is an unintended side-effect of the following change...

    commit 2090129c36c7e582943b7d300968d19b46160d84
    Date:   Thu Dec 22 21:11:11 2016 -0500
    Subject: Share fork_inferior et al with gdbserver

... which removes some code in server.c that was responsible for
starting the inferior in a functin that was named start_inferior,
and looked like this:

   signal_pid = create_inferior (new_argv[0], &new_argv[0]);
   [...]
   /* Wait till we are at 1st instruction in program, return new pid
      (assuming success).  */
   last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);

The code has been transitioned to using fork_inferior, but sadly,
only for the targets that support it. On Windows, the calls to wait
setting "last_status" simply disappeared.

This patch adds it back in the Windows-specific implementation of
create_inferior.

gdb/gdbserver/ChangeLog:

        PR server/23158:
        * win32-low.c (win32_create_inferior): Add call to my_wait
        setting last_status global.

7 years ago[gdbserver/win32] fatal "glob could not process pattern '(null)'" error
Joel Brobecker [Thu, 10 May 2018 15:23:10 +0000 (10:23 -0500)] 
[gdbserver/win32] fatal "glob could not process pattern '(null)'" error

Trying to start GDBserver on Windows currently yields the following
error...

    $ gdbserver.exe --once :4444 simple_main.exe
    glob could not process pattern '(null)'.
    Exiting

... after which GDB terminates with a nonzero status.

This is because create_process in win32-low.c calls gdb_tilde_expand
with the result of a call to get_inferior_cwd without verifying that
the returned directory is not NULL:

    | static BOOL
    | create_process (const char *program, char *args,
    |                 DWORD flags, PROCESS_INFORMATION *pi)
    | {
    |   const char *inferior_cwd = get_inferior_cwd ();
    |   std::string expanded_infcwd = gdb_tilde_expand (inferior_cwd);

This patch avoids this by only calling gdb_tilde_expand when
INFERIOR_CWD is not NULL, which is similar to what is done on
GNU/Linux for instance.

gdb/gdbserver/ChangeLog:

        PR server/23158:
        * win32-low.c (create_process): Only call gdb_tilde_expand if
        inferior_cwd is not NULL.

7 years agoFix tagged pointer support
Omair Javaid [Tue, 1 May 2018 01:31:32 +0000 (06:31 +0500)] 
Fix tagged pointer support

This patch fixes tagged pointer support for AArch64 GDB. Linux kernel
debugging failure was reported after tagged pointer support was committed.

After a discussion around best path forward to manage tagged pointers
on GDB side we are going to disable tagged pointers support for
aarch64-none-elf-gdb because for non-linux applications we cant be
sure if tagged pointers will be used by MMU or not.

Also for aarch64-linux-gdb we are going to sign extend user-space
address after clearing tag bits. This will help debug both kernel
and user-space addresses based on information from linux kernel
documentation given below:

According to AArch64 memory map:
https://www.kernel.org/doc/Documentation/arm64/memory.txt

"User addresses have bits 63:48 set to 0 while the kernel addresses have
the same bits set to 1."

According to AArch64 tagged pointers document:
https://www.kernel.org/doc/Documentation/arm64/tagged-pointers.txt

The kernel configures the translation tables so that translations made
via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of
the virtual address ignored by the translation hardware. This frees up
this byte for application use.

Running gdb testsuite after applying this patch introduces no regressions
and tagged pointer test cases still pass.

gdb/ChangeLog:
2018-05-10  Omair Javaid  <omair.javaid@linaro.org>

PR gdb/23127
* aarch64-linux-tdep.c (aarch64_linux_init_abi): Add call to
set_gdbarch_significant_addr_bit.
* aarch64-tdep.c (aarch64_gdbarch_init): Remove call to
set_gdbarch_significant_addr_bit.
* utils.c (address_significant): Update to sign extend addr.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 10 May 2018 00:01:36 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 9 May 2018 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 8 May 2018 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 7 May 2018 00:01:35 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 6 May 2018 00:01:50 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 5 May 2018 00:01:24 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 4 May 2018 00:01:27 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 3 May 2018 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 2 May 2018 00:01:44 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 1 May 2018 00:01:26 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 Apr 2018 00:01:43 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 Apr 2018 00:02:30 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 Apr 2018 00:01:26 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 Apr 2018 00:01:34 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Apr 2018 00:01:48 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Apr 2018 00:01:48 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Apr 2018 00:01:20 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Apr 2018 00:01:42 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Apr 2018 00:01:40 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Apr 2018 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Apr 2018 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Apr 2018 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Apr 2018 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Apr 2018 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 Apr 2018 00:01:17 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 Apr 2018 00:02:08 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 Apr 2018 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 Apr 2018 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoFix -D_GLIBCXX_DEBUG gdb-add-index regression
Jan Kratochvil [Thu, 12 Apr 2018 20:31:39 +0000 (22:31 +0200)] 
Fix -D_GLIBCXX_DEBUG gdb-add-index regression

Fedora Rawhide started to use -D_GLIBCXX_DEBUG which made gdb-add-index
failing:
gdb: Out-of-bounds vector access while running gdb-add-index
https://bugzilla.redhat.com/show_bug.cgi?id=1540559

/usr/include/c++/7/debug/safe_iterator.h:270:
Error: attempt to dereference a past-the-end iterator.
Objects involved in the operation:
    iterator "this" @ 0x0x7fffffffcb90 {
      type = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::__cxx1998::vector<unsigned char, gdb::default_init_allocator<unsigned char, std::allocator<unsigned char> > > >, std::__debug::vector<unsigned char, gdb::default_init_allocator<unsigned char, std::allocator<unsigned char> > > > (mutable iterator);
      state = past-the-end;
      references sequence with type 'std::__debug::vector<unsigned char, gdb::default_init_allocator<unsigned char, std::allocator<unsigned char> > >' @ 0x0x7fffffffcc50
    }

/usr/include/c++/7/debug/vector:417:
Error: attempt to subscript container with out-of-bounds index 556, but
container only holds 556 elements.
Objects involved in the operation:
    sequence "this" @ 0x0x2e87af8 {
      type = std::__debug::vector<partial_symbol*, std::allocator<partial_symbol*> >;
    }

The two -D_GLIBCXX_DEBUG regressions were made by:

commit bc8f2430e08cc2a520db49a42686e0529be4a3bc
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Jun 12 16:29:53 2017 +0100
    Code cleanup: C++ify .gdb_index producer

commit af5bf4ada48ff65b6658be1fab8f9c8f8ab5f319
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Sat Oct 14 08:06:29 2017 -0400
    Replace psymbol_allocation_list with std::vector

gdb/ChangeLog
2018-04-12  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR gdb/23053
* dwarf2read.c (data_buf::grow) (write_one_signatured_type)
(recursively_write_psymbols) (debug_names::recursively_write_psymbols)
(debug_names::write_one_signatured_type): Fix -D_GLIBCXX_DEBUG
regression.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Apr 2018 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 11 Apr 2018 00:01:12 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 Apr 2018 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 Apr 2018 00:01:04 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 Apr 2018 00:01:50 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Apr 2018 00:01:52 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Apr 2018 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Apr 2018 00:01:14 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoi386: Clear vex instead of vex.evex
H.J. Lu [Wed, 4 Apr 2018 11:36:44 +0000 (04:36 -0700)] 
i386: Clear vex instead of vex.evex

"vex" has many fields to control how to decode an instruction.  Clear
all fields in "vex" before decoding an instruction to avoid using values
left from the previous instruction.

gas/

PR gdb/23028
PR binutils/23025
* testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with
VEX and EVEX prefixes.
* testsuite/gas/i386/prefix.d: Updated.

opcodes/

PR gdb/23028
PR binutils/23025
* i386-dis.c (get_valid_dis386): Don't set vex.prefix nor vex.w
to 0.
(print_insn): Clear vex instead of vex.evex.

(cherry picked from commit caf0678c84b5b55fbc4bcc853954745a4ad8b658)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Apr 2018 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Apr 2018 00:01:11 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Apr 2018 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Apr 2018 00:01:41 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 31 Mar 2018 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 30 Mar 2018 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 29 Mar 2018 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 28 Mar 2018 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Mar 2018 00:01:12 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Mar 2018 00:01:32 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Mar 2018 00:01:55 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Mar 2018 00:01:36 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 23 Mar 2018 00:01:27 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 22 Mar 2018 00:01:41 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 21 Mar 2018 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 20 Mar 2018 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 19 Mar 2018 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 18 Mar 2018 00:01:47 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 17 Mar 2018 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 16 Mar 2018 00:01:09 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in users/ARM/embedded-gdb-8.1-branch-2018q2
GDB Administrator [Thu, 15 Mar 2018 00:01:02 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 14 Mar 2018 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 13 Mar 2018 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 12 Mar 2018 00:01:11 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 11 Mar 2018 00:02:02 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 10 Mar 2018 00:01:07 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 9 Mar 2018 00:01:11 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 8 Mar 2018 00:01:16 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 7 Mar 2018 00:01:12 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 6 Mar 2018 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 5 Mar 2018 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 4 Mar 2018 00:01:55 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 3 Mar 2018 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoConditionally include "<windows.h>" on common/pathstuff.c (and unbreak build on mingw*)
Sergio Durigan Junior [Thu, 1 Mar 2018 20:11:44 +0000 (15:11 -0500)] 
Conditionally include "<windows.h>" on common/pathstuff.c (and unbreak build on mingw*)

commit b4987c956dfa44ca9fd8552f63e15f5fa094b2a4
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Fri Feb 9 18:44:59 2018 -0500

    Create new common/pathstuff.[ch]

Introduced a regression when compiling for mingw*:

  /gdb/common/pathstuff.c: In function 'gdb::unique_xmalloc_ptr<char>
  gdb_realpath(const char*)':
  /gdb/common/pathstuff.c:56:14: error: 'MAX_PATH' was not declared in this scope
       char buf[MAX_PATH];
^
  /gdb/common/pathstuff.c:57:5: error: 'DWORD' was not declared in this scope
       DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL);
       ^
  /gdb/common/pathstuff.c:57:11: error: expected ';' before 'len'
       DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL);
     ^
  /gdb/common/pathstuff.c:63:9: error: 'len' was not declared in this scope
       if (len > 0 && len < MAX_PATH)
   ^
  /gdb/common/pathstuff.c:64:54: error: 'buf' was not declared in this scope
 return gdb::unique_xmalloc_ptr<char> (xstrdup (buf));
^
  make[2]: *** [pathstuff.o] Error 1

The proper fix is to conditionally include "<windows.h>".  This commit
does that, without introducing any regressions as per tests made by
our BuildBot.

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

PR gdb/22907
* common/pathstuff.c: Conditionally include "<windows.h>".

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 2 Mar 2018 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoChange order of error message printed when gdbserver can't find CWD
Sergio Durigan Junior [Wed, 28 Feb 2018 16:43:48 +0000 (11:43 -0500)] 
Change order of error message printed when gdbserver can't find CWD

I forgot to address Pedro's comment about my last patch and change the
order of the message printed when getcwd returns NULL on gdbserver.
This obvious commit does it.

gdb/gdbserver/ChangeLog:
2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>

* server.c (captured_main): Change order of error message printed
when the current working directory cannot be found.

7 years agoMake gdbserver work with filename-only binaries
Sergio Durigan Junior [Fri, 9 Feb 2018 23:54:41 +0000 (18:54 -0500)] 
Make gdbserver work with filename-only binaries

Simon mentioned on IRC that, after the startup-with-shell feature has
been implemented on gdbserver, it is not possible to specify a
filename-only binary, like:

  $ gdbserver :1234 a.out
  /bin/bash: line 0: exec: a.out: not found
  During startup program exited with code 127.
  Exiting

This happens on systems where the current directory "." is not listed
in the PATH environment variable.  Although including "." in the PATH
variable is a possible workaround, this can be considered a regression
because before startup-with-shell it was possible to use only the
filename (due to reason that gdbserver used "exec*" directly).

The idea of the patch is to verify if the program path provided by the
user (or by the remote protocol) contains a directory separator
character.  If it doesn't, it means we're dealing with a filename-only
binary, so we call "gdb_abspath" to properly expand it and transform
it into a full path.  Otherwise, we leave the program path untouched.
This mimicks the behaviour seen on GDB (look at "openp" and
"attach_inferior", for example).

I am also submitting a testcase which exercises the scenario described
above.  This test requires gdbserver to be executed in a different CWD
than the original, so I also created a helper function, "with_cwd" (on
testsuite/lib/gdb.exp), which takes care of cd'ing into and out of the
specified dir.

Built and regtested on BuildBot, without regressions.

gdb/ChangeLog:
2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>
    Simon Marchi  <simon.marchi@polymtl.ca>

* common/common-utils.c: Include "sys/stat.h".
(is_regular_file): Move here from "source.c"; change return
type to "bool".
* common/common-utils.h (is_regular_file): New prototype.
* common/pathstuff.c (contains_dir_separator): New function.
* common/pathstuff.h (contains_dir_separator): New prototype.
* source.c: Don't include "sys/stat.h".
(is_regular_file): Move to "common/common-utils.c".

gdb/gdbserver/ChangeLog:
2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>

* server.c: Include "filenames.h" and "pathstuff.h".
(program_name): Delete variable.
(program_path): New anonymous class.
(get_exec_wrapper): Use "program_path" instead of
"program_name".
(handle_v_run): Likewise.
(captured_main): Likewise.
(process_serial_event): Likewise.

gdb/testsuite/ChangeLog:
2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.server/abspath.exp: New file.
* lib/gdb.exp (with_cwd): New procedure.

7 years agoCreate new common/pathstuff.[ch]
Sergio Durigan Junior [Fri, 9 Feb 2018 23:44:59 +0000 (18:44 -0500)] 
Create new common/pathstuff.[ch]

This commit moves the path manipulation routines found on utils.c to a
new common/pathstuff.c, and updates the Makefile.in's accordingly.
The routines moved are "gdb_realpath", "gdb_realpath_keepfile" and
"gdb_abspath".

This will be needed because gdbserver will have to call "gdb_abspath"
on my next patch, which implements a way to expand the path of the
inferior provided by the user in order to allow specifying just the
binary name when starting gdbserver, like:

  $ gdbserver :1234 a.out

With the recent addition of the startup-with-shell feature on
gdbserver, this scenario doesn't work anymore if the user doesn't have
the current directory listed in the PATH variable.

I had to do a minor adjustment on "gdb_abspath" because we don't have
access to "tilde_expand" on gdbserver, so now the function is using
"gdb_tilde_expand" instead.  Otherwise, the code is the same.

Regression tested on the BuildBot, without regressions.

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

* Makefile.in (SFILES): Add "common/pathstuff.c".
(HFILES_NO_SRCDIR): Add "common/pathstuff.h".
(COMMON_OBS): Add "pathstuff.o".
* auto-load.c: Include "common/pathstuff.h".
* common/common-def.h (current_directory): Move here.
* common/gdb_tilde_expand.c (gdb_tilde_expand_up): New
function.
* common/gdb_tilde_expand.h (gdb_tilde_expand_up): New
prototype.
* common/pathstuff.c: New file.
* common/pathstuff.h: New file.
* compile/compile.c: Include "common/pathstuff.h".
* defs.h (current_directory): Move to "common/common-defs.h".
* dwarf2read.c: Include "common/pathstuff.h".
* exec.c: Likewise.
* guile/scm-safe-call.c: Likewise.
* linux-thread-db.c: Likewise.
* main.c: Likewise.
* nto-tdep.c: Likewise.
* objfiles.c: Likewise.
* source.c: Likewise.
* symtab.c: Likewise.
* utils.c: Include "common/pathstuff.h".
(gdb_realpath): Move to "common/pathstuff.c".
(gdb_realpath_keepfile): Likewise.
(gdb_abspath): Likewise.
* utils.h (gdb_realpath): Move to "common/pathstuff.h".
(gdb_realpath_keepfile): Likewise.
(gdb_abspath): Likewise.

gdb/gdbserver/ChangeLog:
2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>

* Makefile.in (SFILES): Add "$(srcdir)/common/pathstuff.c".
(OBJS): Add "pathstuff.o".
* server.c (current_directory): New global variable.
(captured_main): Initialize "current_directory".

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 1 Mar 2018 00:01:29 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 28 Feb 2018 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Feb 2018 00:01:03 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Feb 2018 00:01:24 +0000 (00:01 +0000)] 
Automatic date update in version.in