Binutils with MCST patches
Go to file
Joel Brobecker 7dbac825b0 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 2090129c36
    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.
2018-05-10 11:24:33 -04:00
bfd Automatic date update in version.in 2018-05-10 00:00:38 +00:00
binutils Add support for detecting Freescale S12Z binaries in readelf. 2018-05-10 12:51:42 +01:00
config config: Sync with GCC 2018-04-05 15:22:13 -07:00
cpu PR22069, Several instances of register accidentally spelled as regsiter 2018-05-09 15:55:28 +09:30
elfcpp PowerPC inline PLT call support 2018-04-09 17:25:20 +09:30
etc Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
gas gas: xtensa: fix literal movement 2018-05-09 12:44:08 -07:00
gdb gdbserver/Windows: Fix "no program to debug" error 2018-05-10 11:24:33 -04:00
gold Fix _GLOBAL_OFFSET_TABLE_ value for large GOTs (aarch64). 2018-05-10 00:13:33 -07:00
gprof Updated Spanish translation for gprof directory 2018-04-18 12:02:17 +01:00
include Add support for detecting Freescale S12Z binaries in readelf. 2018-05-10 12:51:42 +01:00
intl Require ngettext in test of system gettext implementation 2017-11-07 15:56:44 +10:30
ld Fix binary compatibility between GCC and the TI compiler for the PRU target. 2018-05-09 11:39:32 +01:00
libdecnumber
libiberty Resync libiberty sources with master version in GCC repository. 2018-04-17 13:53:38 +01:00
opcodes x86: Remove Disp<N> from movidir{i,64b} 2018-05-09 11:17:26 -07:00
readline
sim PR22069, Several instances of register accidentally spelled as regsiter 2018-05-09 15:55:28 +09:30
texinfo
zlib
.cvsignore
.gitattributes
.gitignore
COPYING
COPYING.LIB
COPYING.LIBGLOSS Update the address of the FSF in the copyright notice of files which were using the old address. 2017-12-14 12:48:55 +00:00
COPYING.NEWLIB
COPYING3
COPYING3.LIB
ChangeLog Bring in support for the NFP target in the config.sub file. 2018-05-01 16:35:04 +01:00
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
README
README-maintainer-mode
compile
config-ml.in Update top level configure files by synchronizing them with gcc. 2018-01-10 15:29:21 +00:00
config.guess Bring in support for the NFP target in the config.sub file. 2018-05-01 16:35:04 +01:00
config.rpath
config.sub Bring in support for the NFP target in the config.sub file. 2018-05-01 16:35:04 +01:00
configure Add the Netronome Flow Processor as a build target to the top-level configure.ac file. 2018-05-01 16:23:21 +01:00
configure.ac Add the Netronome Flow Processor as a build target to the top-level configure.ac file. 2018-05-01 16:23:21 +01:00
depcomp
djunpack.bat
install-sh
libtool.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
setup.com
src-release.sh Improve junk file removal in source tarball creation script. 2018-01-30 17:48:24 +00:00
symlink-tree
ylwrap

README

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.