Commit Graph

87012 Commits

Author SHA1 Message Date
Pedro Alves 80dbc9fdc7 Add missing cleanups to defaulted_query and prompt_for_continue
Some of the error paths in these functions leak.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* utils.c (defaulted_query, prompt_for_continue): Free temporary
	strings with cleanups, instead of xfree.
2016-04-12 16:59:42 +01:00
Pedro Alves c5ac15402a Use target_terminal_ours_for_output in warning/internal_error
We're only doing output here, so leave raw/cooked mode alone, as well
as the SIGINT handler.

And restore terminal settings, while at it.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* utils.c (vwarning, internal_vproblem): Use
	make_cleanup_restore_target_terminal and
	target_terminal_ours_for_output.
2016-04-12 16:59:13 +01:00
Pedro Alves f8e3ef9dc4 Use target_terminal_ours_for_output in infcmd.c
We're only doing output here, so leave raw/cooked mode alone, as well
as the SIGINT handler.

No need to restore terminal settings, we'll set inferior modes on the
following resume.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* infcmd.c (post_create_inferior, prepare_one_step): Use
	target_terminal_ours_for_output instead of target_terminal_ours.
2016-04-12 16:58:55 +01:00
Pedro Alves 481ac8c9bb Use target_terminal_ours_for_output in exceptions.c
We're only doing output here, so leave raw/cooked mode alone, as well
as the SIGINT handler.

Restore terminal settings after output, while at it.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* exceptions.c (print_flush): Use target_terminal_ours_for_output
	instead of target_terminal_ours, and restore target terminal with
	a cleanup.
2016-04-12 16:58:35 +01:00
Pedro Alves c509f1e1e8 Use target_terminal_ours_for_output in cp-support.c
We're only doing output here, so leave raw/cooked mode alone, as well
as the SIGINT handler.

Restore terminal settings after output, while at it.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* cp-support.c (gdb_demangle): Use target_terminal_ours_for_output
	instead of target_terminal_ours, and restore target terminal with
	a cleanup.
2016-04-12 16:58:14 +01:00
Pedro Alves 99bbb428d4 ada-lang.c: Introduce type_as_string and use it
A couple wrong things here

  - We should not use target_terminal_ours when all we want is output.
    We should use target_terminal_ours_for_output instead, which
    preserves raw/cooked terminal modes, and SIGINT forwarding.

  - Most importantly, relying on stderr output immediately preceding
    the error/exception print isn't correct.  The exception could be
    caught and handled, for example; MI frontends won't display the
    stderr part in an error dialog box.  Etc.

This commit introduces a type_as_string helper that allows building a
full error string including type info.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* ada-lang.c (type_as_string, type_as_string_and_cleanup): New
	functions.
	(ada_lookup_struct_elt_type): Use type_as_string_and_cleanup.
2016-04-12 16:57:56 +01:00
Pedro Alves 75ee59252d Fix inconsistent handling of EINTR in ser-*.c backends
- If serial->write_prim returns EINTR, ser_bas_write returns it to the
  caller.  This just looks wrong to me -- part of the output may have
  already been sent, and there's no way for the caller to know that,
  and thus no way for a caller to handle a partial write correctly.

- While ser-unix.c:ser_unix_read_prim retries on EINTR,
  ser-tcp.c:net_read_prim does not.

This commit moves EINTR handling to the ser_base_write and
ser_base_readchar level, so all serial backends (at least those that
use it) end up handling EINTR consistently.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* ser-base.c (fd_event): Retry read_prim on EINTR.
	(do_ser_base_readchar): Retry read_prim on EINTR.
	(ser_base_write): Retry write_prim on EINTR.
	* ser-unix.c (ser_unix_read_prim): Don't retry on EINTR here.
	(ser_unix_write_prim): Remove comment.
2016-04-12 16:57:33 +01:00
Pedro Alves 93692b589d Pass Ctrl-C to the target in target_terminal_inferior
If the user presses Ctrl-C immediately before target_terminal_inferior
is called and the target is resumed, instead of after, the Ctrl-C ends
up pending in the quit flag until the target next stops.

remote.c has this bit to handle this:

      if (!target_is_async_p ())
	{
	  ofunc = signal (SIGINT, sync_remote_interrupt);
	  /* If the user hit C-c before this packet, or between packets,
	     pretend that it was hit right here.  */
	  if (check_quit_flag ())
	    sync_remote_interrupt (SIGINT);
	}

But that's only reachable if async is off, while async is on by
default nowadays.  It's also obviously not reacheable on native
targets.

This patch generalizes that to all targets.

We can't remove that remote.c bit yet, until we get rid of the sync
SIGINT handler though.  That'll be done later in the series.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* remote.c (remote_pass_ctrlc): New function.
	(init_remote_ops): Install it.
	* target.c (target_terminal_inferior): Pass pending Ctrl-C to the
	target.
	(target_pass_ctrlc, default_target_pass_ctrlc): New functions.
	* target.h (struct target_ops) <to_pass_ctrlc>: New method.
	(target_pass_ctrlc, default_target_pass_ctrlc): New declarations.
	* target-delegates.c: Regenerate.
2016-04-12 16:57:10 +01:00
Pedro Alves e42de8c7f8 Decouple target_interrupt from all-stop/non-stop modes
In non-stop mode, "interrupt" results in a "stop with no signal",
while in all-stop mode, it results in a remote interrupt request /
stop with SIGINT.  This is currently implemented in both the Linux and
remote target backends.  Move it to the core code instead, making
target_interrupt specifically always about "Interrupting as if with
Ctrl-C", just like it is documented.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* infcmd.c (interrupt_target_1): Call target_stop is in non-stop
	mode.
	* linux-nat.c (linux_nat_interrupt): Delete.
	(linux_nat_add_target): Don't install linux_nat_interrupt.
	* remote.c (remote_interrupt_ns): Change return type to void.
	Throw error if interrupting the target is not supported.
	(remote_interrupt): Don't call the remote_stop_ns/remote_stop_as.
2016-04-12 16:56:39 +01:00
Pedro Alves a149683b0c Eliminate clear_quit_flag
Nothing calls this anymore.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* defs.h (clear_quit_flag): Remove declaration.
	* extension-priv.h (struct extension_language_ops)
	<clear_quit_flag>: Remove field and update comments.
	* extension.c (clear_quit_flag): Delete.
	* guile/guile.c (guile_extension_ops): Adjust.
	* python/python.c (python_extension_ops): Adjust.
	(gdbpy_clear_quit_flag): Delete.
2016-04-12 16:56:15 +01:00
Pedro Alves da1e5f545c Don't call clear_quit_flag in captured_main
This call seems pointless.  For instance, a SIGINT handler is only
installed later on.  And if wasn't, I can't see why we'd want to lose
a Ctrl-C request.

Getting rid of this allows getting rid of clear_quit_flag.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* main.c (captured_main): Don't clear the quit flag.
2016-04-12 16:55:52 +01:00
Pedro Alves 0af679c6e0 Don't call clear_quit_flag in prepare_to_throw_exception
I think this is reminiscent of the time when a longjmp would always
jump to the top level.  Nowaways code that throw exceptions other than
a quit, which may even be caught and handled without reaching the top
level.  Certainly such exceptions shouldn't clear an interrupt
request...

(We also need to get rid of prepare_to_throw_exception in order to be
able to just do "throw ex;" in C++.)

One could argue that we should clear the quit flag when we throw a
quit from the SIGINT handler, when immediate_quit is in effect, to
handle a race, here:

 immediate_quit++;
 QUIT;

... that's the usual pattern code must use when enabling
immediate_quit.  The QUIT is there to catch the case of Ctrl-C having
already been pressed before immediate_quit was enabled.  However, this
can happen:

 immediate_quit++;
<< Ctrl-C pressed here too.
 QUIT;

And in that case, if the quit flag was already set, it'll stay set
even after throwing a quit from the SIGINT handler.  The end result is
a double quit.  But OTOH, the user did press Ctrl-C two times.  Since
I'm getting rid of immediate_quit, I'm not bothering with this.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* exceptions.c (prepare_to_throw_exception): Don't clear the quit
	flag.
2016-04-12 16:55:35 +01:00
Pedro Alves 4a81fd47b3 Don't call clear_quit_flag in command_handler
This just looks totally wrong to me, for completetly discarding a
user-requested Ctrl-C.  I can't think of why we'd want do this here.

Actually, I digged the history, and found out that this has been here
since at least 7b4ac7e1ed (gdb-2.4, the initial revision, 1988), at
a time were we had a top level setjmp/longjmp, long before that got
wrapped in throw_exception and friends, and this code was in an
explicit loop, with the quit_flag cleared on every iteration, before
executing a command...

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* event-top.c (command_handler): Don't call clear_quit_flag.
2016-04-12 16:55:16 +01:00
Pedro Alves abf009ef94 Don't call clear_quit_flag after check_quit_flag
Obviously not necessary since check_quit_flag clears the flag as side
effect.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* remote-sim.c (gdb_os_poll_quit): Don't call clear_quit_flag.
	* remote.c (remote_wait_as): Don't call clear_quit_flag.
2016-04-12 16:54:49 +01:00
Pedro Alves 6eddd09a12 Make Python use a struct serial event
Now that we have an abstract for wakeable events, use it instead of a
(heavier) serial pipe.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* python/python.c: Include "ser-event.h".
	(gdbpy_event_fds): Delete.
	(gdbpy_serial_event): New.
	(gdbpy_run_events): Change prototype.  Use serial_event_clear
	instead of serial_readchar.
	(gdbpy_post_event): Use serial_event_set instead of serial_write.
	(gdbpy_initialize_events): Use make_serial_event instead of
	serial_pipe.
2016-04-12 16:54:25 +01:00
Pedro Alves f0881b37b6 Introduce interruptible_select
We have places where we call a blocking gdb_select expecting that a
Ctrl-C will unblock it.  However, if the Ctrl-C is pressed just before
gdb_select, the SIGINT handler runs before gdb_select, and thus
gdb_select won't return.

For example gdb_readline_no_editing:

       QUIT;

       /* Wait until at least one byte of data is available.  Control-C
          can interrupt gdb_select, but not fgetc.  */
       FD_ZERO (&readfds);
       FD_SET (fd, &readfds);
       if (gdb_select (fd + 1, &readfds, NULL, NULL, NULL) == -1)

and stdio_file_read:

     /* For the benefit of Windows, call gdb_select before reading from
	the file.  Wait until at least one byte of data is available.
	Control-C can interrupt gdb_select, but not read.  */
     {
       fd_set readfds;
       FD_ZERO (&readfds);
       FD_SET (stdio->fd, &readfds);
       if (gdb_select (stdio->fd + 1, &readfds, NULL, NULL, NULL) == -1)
	 return -1;
     }
     return read (stdio->fd, buf, length_buf);


This is a race classically fixed with either the self-pipe trick, or
by blocking SIGINT and then using pselect instead of select.

Blocking SIGINT most of the time would mean that check_quit_flag (and
thus QUIT) would need to do a syscall every time it is called, which
sounds best avoided, since QUIT is called in many loops.  Thus we take
the self-pipe trick route (wrapped in a serial event).

Instead of having all places that need this manually add an extra file
descriptor to the set of gdb_select's watched file descriptors, we
introduce a wrapper, interruptible_select, that does that.

The Windows version of gdb_select actually does not suffer from this,
because mingw-hdep.c:gdb_call_async_signal_handler sets a Windows
event that gdb_select always waits on.  So this patch can be seen as
generalization of that technique.  We can't remove that extra event
from mingw-hdep.c until we get rid of immediate_quit though.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* defs.h: Extend QUIT-related comments to mention
	interruptible_select.
	(quit_serial_event_set, quit_serial_event_clear): Declare.
	* event-top.c: Include "ser-event.h" and "gdb_select.h".
	(quit_serial_event): New global.
	(async_init_signals): Make quit_serial_event.
	(quit_serial_event_set, quit_serial_event_clear)
	(quit_serial_event_fd, interruptible_select): New functions.
	* extension.c (set_quit_flag): Set the quit serial event.
	(check_quit_flag): Clear the quit serial event.
	* gdb_select.h (interruptible_select): New declaration.
	* guile/scm-ports.c (ioscm_input_waiting): Use
	interruptible_select instead of gdb_select.
	* top.c (gdb_readline_no_editing): Likewise.
	* ui-file.c (stdio_file_read): Likewise.
2016-04-12 16:54:03 +01:00
Pedro Alves 5cc3ce8b5f Fix signal handler/event-loop races
GDB's core signal handling suffers from a classical signal handler /
mainline code race:

  int
  gdb_do_one_event (void)
  {
  ...
  /* First let's see if there are any asynchronous signal handlers
       that are ready.  These would be the result of invoking any of the
       signal handlers.  */
    if (invoke_async_signal_handlers ())
      return 1;
  ...
    /* Block waiting for a new event.  (...).  */

    if (gdb_wait_for_event (1) < 0)
      return -1;
  ...
  }

If a signal is delivered while gdb is blocked in the poll/select
inside gdb_wait_for_event, then the select/poll breaks with EINTR,
we'll loop back around and call invoke_async_signal_handlers.

However, if the signal handler runs between
invoke_async_signal_handlers and gdb_wait_for_event,
gdb_wait_for_event will block, until the next unrelated event...

The fix is to a struct serial_event, and register it in the set of
files that select/poll in gdb_wait_for_event waits on.  The signal
handlers that defer work to invoke_async_signal_handlers call
mark_async_signal_handler, which is adjusted to also set the new
serial event in addition to setting a flag, and is thus now is
garanteed to immediately unblock the next gdb_select/poll call, up
until invoke_async_signal_handlers is called and the event is cleared.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* event-loop.c: Include "ser-event.h".
	(async_signal_handlers_serial_event): New global.
	(async_signals_handler, initialize_async_signal_handlers): New
	functions.
	(mark_async_signal_handler): Set
	async_signal_handlers_serial_event.
	(invoke_async_signal_handlers): Clear
	async_signal_handlers_serial_event.
	* event-top.c (async_init_signals): Call
	initialize_async_signal_handlers.
2016-04-12 16:53:40 +01:00
Pedro Alves 00340e1b91 Introduce a serial interface for select'able events
This patch adds a new "event" struct serial type, that is an
abstraction specifically for waking up blocking waits/selects,
implemented on top of a pipe on POSIX, and on top of a native Windows
event (CreateEvent, etc.) on Windows.

This will be used to plug signal handler / mainline code races.

For example, GDB can indefinitely delay handling a quit request if the
user presses Ctrl-C between the last QUIT call and the next (blocking)
gdb_select call in the event loop:

      QUIT;
                  <<< press ctrl-c here and end up blocked in gdb_select
		      indefinitely.

      gdb_select (...); // whoops, SIGINT was already handled, no EINTR.

A global alone (either the quit flag, or the "ready" flag of the async
signal handlers in the event loop) is not sufficient.

To plug races such as these on POSIX systems, we have to register some
waitable file descriptor in the set of files gdb_select waits on, and
write to it from the signal handler.  This is classically a pipe, and
the pattern called the self-pipe trick.  On Linux, it could be a more
efficient eventfd instead, but I'm sticking with a pipe for
simplifity, as we need it for portability anyway.

(Alternatively, we could use pselect/ppoll, and block signals until
the pselect.  The latter is not a design I think GDB could use,
because we want the QUIT macro to be super cheap, as it is used in
loops.  Plus, Windows.)

This is a "struct serial" because Windows's gdb_select relies on that.
Windows's gdb_select, our "select" replacement, knows how to wait on
all kinds of handles (regular files, pipes, sockets, console, etc.)
unlike the native Windows "select" function, which can only wait on
sockets.  Each file descriptor for a "serial" type that is not
normally waitable with WaitForMultipleObjects must have a
corresponding struct serial instance.  gdb_select then internally
looks up the struct serial instance that wraps each file descriptor,
and asks it for the corresponding Windows waitable handle.

We could use serial_pipe() to create a "struct serial"-wrapped pipe
that is usable everywhere, including Windows.  That's what currently
python/python.c uses for cross-thread posting of events.

However, serial_write and serial_readchar are not designed to be
async-signal-safe on POSIX hosts.  It's easier to bypass those when
setting/clearing the event source.

And writing and a serial pipe is a bit heavy weight on Windows.
gdb_select requires an extra thread to wait on the pipe and several
Windows events, when a single manual-reset Windows event, with no
extra thread is sufficient.

The intended usage is simply:

- Call make_serial_event to create a serial event object.

- From the signal handler call serial_event_set to set the event.

- From mainline code, have select/poll wait for serial_event_fd(), in
  addition to whatever other files you're about to wait for.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* Makefile.in (SFILES): Add ser-event.c.
	(HFILES_NO_SRCDIR): Add ser-event.h.
	(COMMON_OBS): Add ser-event.o.
	* ser-event.c, ser-event.h: New files.
	* serial.c (new_serial): New function, factored out from
	(serial_fdopen_ops): ... this.
	(serial_open_ops_1): New function, factored out from
	(serial_open): ... this.
	(serial_open_ops): New function.
	* serial.h (struct serial): Forware declare.
	(serial_open_ops): New declaration.
2016-04-12 16:53:21 +01:00
Pedro Alves 5f5219fc34 Remove unused struct serial::name field
Not used by anything.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* serial.c (serial_open, serial_fdopen_ops, do_serial_close):
	Remove references to name.
	* serial.h (struct serial) <name>: Delete.
2016-04-12 16:53:01 +01:00
Pedro Alves acd5494dd8 Stop remote-fileio.c from throwing from SIGINT handler
This code installs a custom signal handler that throws a quit
exception if remote_fio_no_longjmp is not set.

AFAICS, the only real reason for this might have been to unblock the
ui_file_read call, in remote_fileio_func_read.  But ever since:

  2009-11-13  Daniel Jacobowitz  <dan@codesourcery.com>

	* ui-file.c (stdio_file_read): Call gdb_select before read.

at:

  https://sourceware.org/ml/gdb-patches/2009-11/msg00321.html

that call is interruptible.

This is not only useful for switching to native C++ exceptions, but
AFAICS, also fixes a potential mess up of the remote protocol
connection, since there are target_read_memory calls done while
remote_fio_no_longjmp is clear.  If the user presses ctrl-c while GDB
is sending or receiving a packet, we'll stop the communication
immediately, at a point where it isn't safe.

gdbserver doesn't support the File I/O remote protocol extension so I
can't test this.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* remote-fileio.c (sigint_fileio_token, remote_fio_no_longjmp):
	Delete.
	(async_remote_fileio_interrupt): Delete.
	(remote_fileio_ctrl_c_signal_handler): Don't call the async signal
	handler.  Instead just always set the ctrl_c flag.
	(remote_fileio_reply): Clear remote_fio_ctrl_c_flag before
	re-enabling the SIGINT handler.
	(remote_fileio_func_open, remote_fileio_func_close)
	(remote_fileio_func_read, remote_fileio_func_write)
	(remote_fileio_func_lseek, remote_fileio_func_rename)
	(remote_fileio_func_unlink, remote_fileio_func_stat)
	(remote_fileio_func_fstat, remote_fileio_func_gettimeofday)
	(remote_fileio_func_isatty, remote_fileio_func_system)
	(remote_fileio_request): Remove references to
	remote_fio_no_longjmp.
	(initialize_remote_fileio): Don't create an async signal handler.
2016-04-12 16:52:36 +01:00
Pedro Alves d2acc30bb6 Don't set immediate_quit in prompt_for_continue
immediate_quit used to be necessary back when prompt_for_continue used
blocking fread, but nowadays it uses gdb_readline_wrapper, which is
implemented in terms of a nested event loop, which already knows how
to react to SIGINT:

 #0  throw_it (reason=RETURN_QUIT, error=GDB_NO_ERROR, fmt=0x9d6d7e "Quit", ap=0x7fffffffcb88)
     at .../src/gdb/common/common-exceptions.c:324
 #1  0x00000000007bab5d in throw_vquit (fmt=0x9d6d7e "Quit", ap=0x7fffffffcb88) at .../src/gdb/common/common-exceptions.c:366
 #2  0x00000000007bac9f in throw_quit (fmt=0x9d6d7e "Quit") at .../src/gdb/common/common-exceptions.c:385
 #3  0x0000000000773a2d in quit () at .../src/gdb/utils.c:1039
 #4  0x000000000065d81b in async_request_quit (arg=0x0) at .../src/gdb/event-top.c:893
 #5  0x000000000065c27b in invoke_async_signal_handlers () at .../src/gdb/event-loop.c:949
 #6  0x000000000065aeef in gdb_do_one_event () at .../src/gdb/event-loop.c:280
 #7  0x0000000000770838 in gdb_readline_wrapper (prompt=0x7fffffffcd40 "---Type <return> to continue, or q <return> to quit---")
     at .../src/gdb/top.c:873

The need for the QUIT in stdin_event_handler is then exposed by the
gdb.base/double-prompt-target-event-error.exp test, which has:

	# We're now stopped in a pagination query while handling a
	# target event (printing where the program stopped).  Quitting
	# the pagination should result in only one prompt being
	# output.
	send_gdb "\003p 1\n"

Without that change we'd get:

 Continuing.
 ---Type <return> to continue, or q <return> to quit---PASS: gdb.base/double-prompt-target-event-error.exp: ctrlc target event: continue: continue to pagination
 ^CpQuit
 (gdb)  1
 Undefined command: "1".  Try "help".
 (gdb) PASS: gdb.base/double-prompt-target-event-error.exp: ctrlc target event: continue: first prompt
 ERROR: Undefined command "".
 UNRESOLVED: gdb.base/double-prompt-target-event-error.exp: ctrlc target event: continue: no double prompt

Vs:

 Continuing.
 ---Type <return> to continue, or q <return> to quit---PASS: gdb.base/double-prompt-target-event-error.exp: ctrlc target event: continue: continue to pagination
 ^CQuit
 (gdb) p 1
 $1 = 1
 (gdb) PASS: gdb.base/double-prompt-target-event-error.exp: ctrlc target event: continue: first prompt
 PASS: gdb.base/double-prompt-target-event-error.exp: ctrlc target event: continue: no double prompt

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* event-top.c (stdin_event_handler): Call QUIT;
	(prompt_for_continue): Don't run with immediate_quit set.
2016-04-12 16:51:18 +01:00
Pedro Alves ab33ab13aa TUI: check whether in secondary prompt instead of immediate_quit
As can be seen in the tui_redisplay_readline comment:

 "The command could call prompt_for_continue and we must not restore
 SingleKey so that the prompt and normal keymap are used."

immediate_quit is being used as proxy for "secondary prompt".

We have a better predicate nowadays, so use it.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* tui/tui-io.c (tui_redisplay_readline): Check
	gdb_in_secondary_prompt_p instead of immediate_quit.
	* tui/tui.c: Include top.h.
	(tui_rl_startup_hook): Check gdb_in_secondary_prompt_p instead of
	immediate_quit.
2016-04-12 16:50:59 +01:00
Pedro Alves faa4ebe148 Inline command_loop in read_command_line
read_command_line is the only caller, and here we can assume we're
reading a regular file, not stdin.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* top.c (read_command_file): Inline command_loop here.
	(command_loop): Delete.
2016-04-12 16:50:41 +01:00
Pedro Alves 3212b85845 Don't rely on immediate_quit in command_line_input
AFAICS, immediate_quit was only needed here nowdays to be able to
interrupt gdb_readline_no_editing.

command_line_input can also take the gdb_readline_wrapper path, but
since that is built on top of the event loop (gdb_select / poll and
asynchronous signal handlers), it can be interrupted.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

	* top.c: Include "gdb_select.h".
	(gdb_readline_no_editing): Wait for input with gdb_select instead
	of blocking in fgetc.
	(command_line_input): Don't set immediate_quit.
2016-04-12 16:49:29 +01:00
Claudiu Zissulescu f36e33dac1 Add support for .extCondCode, .extCoreRegister and .extAuxRegister.
gas/
2016-04-05  Claudiu Zissulescu  <claziss@synopsys.com>

	* testsuite/gas/arc/textauxregister.d: New file.
	* testsuite/gas/arc/textauxregister.s: Likewise.
	* testsuite/gas/arc/textcondcode.d: Likewise.
	* testsuite/gas/arc/textcondcode.s: Likewise.
	* testsuite/gas/arc/textcoreregister.d: Likewise.
	* testsuite/gas/arc/textcoreregister.s: Likewise.
	* testsuite/gas/arc/textpseudoop.d: Likewise.
	* testsuite/gas/arc/textpseudoop.s: Likewise.
	* testsuite/gas/arc/ld2.d: Update test.
	* testsuite/gas/arc/st.d: Likewise.
	* testsuite/gas/arc/taux.d: Likewise.
	* doc/c-arc.texi (ARC Directives): Add .extCondCode,
	.extCoreRegister and .extAuxRegister documentation.
	* config/tc-arc.c (arc_extcorereg): New function.
	(md_pseudo_table): Add .extCondCode, .extCoreRegister and
	.extAuxRegister pseudo-ops.
	(extRegister_t): New type.
	(ext_condcode, arc_aux_hash): New global variable.
	(find_opcode_match): Check for extensions.
	(preprocess_operands): Likewise.
	(md_begin): Add aux registers in a hash.
	(assemble_insn): Update use arc_flags member.
	(tokenize_extregister): New function.
	(create_extcore_section): Likewise.
	* config/tc-arc.h (MAX_FLAG_NAME_LENGHT): Increase to 10.
	(arc_flags): Delete code, add flgp.

include/
2016-04-05  Claudiu Zissulescu  <claziss@synopsys.com>

	* opcode/arc.h (flag_class_t): Update.
	(ARC_OPCODE_NONE): Define.
	(ARC_OPCODE_ARCALL): Likewise.
	(ARC_OPCODE_ARCFPX): Likewise.
	(ARC_REGISTER_READONLY): Likewise.
	(ARC_REGISTER_WRITEONLY): Likewise.
	(ARC_REGISTER_NOSHORT_CUT): Likewise.
	(arc_aux_reg): Add cpu.

opcodes/
2016-04-05  Claudiu Zissulescu  <claziss@synopsys.com>

	* arc-dis.c (find_format): Check for extension flags.
	(print_flags): New function.
	(print_insn_arc): Update for .extCondCode, .extCoreRegister and
	.extAuxRegister.
	* arc-ext.c (arcExtMap_coreRegName): Use
	LAST_EXTENSION_CORE_REGISTER.
	(arcExtMap_coreReadWrite): Likewise.
	(dump_ARC_extmap): Update printing.
	* arc-opc.c (arc_flag_classes): Add F_CLASS_EXTEND flag.
	(arc_aux_regs): Add cpu field.
	* arc-regs.h: Add cpu field, lower case name aux registers.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12 10:21:06 +02:00
Claudiu Zissulescu 1c2e355e48 Update ARC instruction data-base.
gas/
2016-04-05  Claudiu Zissulescu  <claziss@synopsys.com>

	* testsuite/gas/arc/noargs_a7.d: New file.
	* testsuite/gas/arc/noargs_a7.s: Likewise.
	* testsuite/gas/arc/noargs_hs.d: Likewise.
	* testsuite/gas/arc/noargs_hs.s: Likewise.

opcode/
2016-04-05  Claudiu Zissulescu  <claziss@synopsys.com>

	* arc-tbl.h: Add rtsc, sleep with no arguments.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12 10:08:37 +02:00
Claudiu Zissulescu b99747aeed Add support for .extInstruction pseudo-op.
gas/
2016-04-04  Claudiu Zissulescu  <claziss@synopsys.com>

	* testsuite/gas/arc/textinsn-errors.d: New File.
	* testsuite/gas/arc/textinsn-errors.err: Likewise.
	* testsuite/gas/arc/textinsn-errors.s: Likewise.
	* testsuite/gas/arc/textinsn2op.d: Likewise.
	* testsuite/gas/arc/textinsn2op.s: Likewise.
	* testsuite/gas/arc/textinsn2op01.d: Likewise.
	* testsuite/gas/arc/textinsn2op01.s: Likewise.
	* testsuite/gas/arc/textinsn3op.d: Likewise.
	* testsuite/gas/arc/textinsn3op.s: Likewise.
	* doc/c-arc.texi (ARC Directives): Add .extInstruction
	documentation.
	* config/tc-arc.c (arcext_section): New variable.
	(arc_extinsn): New function.
	(md_pseudo_table): Add .extInstruction pseudo op.
	(attributes_t): New type.
	(suffixclass, syntaxclass, syntaxclassmod): New constant
	structures.
	(find_opcode_match): Remove arc_num_opcodes.
	(md_begin): Likewise.
	(tokenize_extinsn): New function.
	(arc_set_ext_seg): Likewise.
	(create_extinst_section): Likewise.

include/
2016-04-04  Claudiu Zissulescu  <claziss@synopsys.com>

	* opcode/arc.h (arc_num_opcodes): Remove.
	(ARC_SYNTAX_3OP, ARC_SYNTAX_2OP, ARC_OP1_MUST_BE_IMM)
	(ARC_OP1_IMM_IMPLIED, ARC_SUFFIX_NONE, ARC_SUFFIX_COND)
	(ARC_SUFFIX_FLAG): Define.
	(flags_none, flags_f, flags_cc, flags_ccf): Declare.
	(arg_none, arg_32bit_rarbrc, arg_32bit_zarbrc, arg_32bit_rbrbrc)
	(arg_32bit_rarbu6, arg_32bit_zarbu6, arg_32bit_rbrbu6)
	(arg_32bit_rbrbs12, arg_32bit_ralimmrc, arg_32bit_rarblimm)
	(arg_32bit_zalimmrc, arg_32bit_zarblimm, arg_32bit_rbrblimm)
	(arg_32bit_ralimmu6, arg_32bit_zalimmu6, arg_32bit_zalimms12)
	(arg_32bit_ralimmlimm, arg_32bit_zalimmlimm, arg_32bit_rbrc)
	(arg_32bit_zarc, arg_32bit_rbu6, arg_32bit_zau6, arg_32bit_rblimm)
	(arg_32bit_zalimm, arg_32bit_limmrc, arg_32bit_limmu6)
	(arg_32bit_limms12, arg_32bit_limmlimm): Likewise.

opcodes/
2016-04-04  Claudiu Zissulescu  <claziss@synopsys.com>

	* arc-opc.c (flags_none, flags_f, flags_cc, flags_ccf):
	Initialize.
	(arg_none, arg_32bit_rarbrc, arg_32bit_zarbrc, arg_32bit_rbrbrc)
	(arg_32bit_rarbu6, arg_32bit_zarbu6, arg_32bit_rbrbu6)
	(arg_32bit_rbrbs12, arg_32bit_ralimmrc, arg_32bit_rarblimm)
	(arg_32bit_zalimmrc, arg_32bit_zarblimm, arg_32bit_rbrblimm)
	(arg_32bit_ralimmu6, arg_32bit_zalimmu6, arg_32bit_zalimms12)
	(arg_32bit_ralimmlimm, arg_32bit_zalimmlimm, arg_32bit_rbrc)
	(arg_32bit_zarc, arg_32bit_rbu6, arg_32bit_zau6, arg_32bit_rblimm)
	(arg_32bit_zalimm, arg_32bit_limmrc, arg_32bit_limmu6)
	(arg_32bit_limms12, arg_32bit_limmlimm): Likewise.
	(arc_opcode arc_opcodes): Null terminate the array.
	(arc_num_opcodes): Remove.
	* arc-ext.h (INSERT_XOP): Define.
	(extInstruction_t): Likewise.
	(arcExtMap_instName): Delete.
	(arcExtMap_insn): New function.
	(arcExtMap_genOpcode): Likewise.
	* arc-ext.c (ExtInstruction): Remove.
	(create_map): Zero initialize instruction fields.
	(arcExtMap_instName): Remove.
	(arcExtMap_insn): New function.
	(dump_ARC_extmap): More info while debuging.
	(arcExtMap_genOpcode): New function.
	* arc-dis.c (find_format): New function.
	(print_insn_arc): Use find_format.
	(arc_get_disassembler): Enable dump_ARC_extmap only when
	debugging.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12 10:06:07 +02:00
Claudiu Zissulescu 37ab977937 Remove unneeded AUX register symbols.
gas/
2016-03-31  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/tc-arc.c (preprocess_operands): Mark AUX symbol.
	(arc_adjust_symtab): New function.
	* config/tc-arc.h (ARC_FLAG_AUX): Define.
	(obj_adjust_symtab): Likewise.
	* testsuite/gas/arc/taux.d: New file.
	* testsuite/gas/arc/taux.s: Likewise.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12 09:57:03 +02:00
H.J. Lu 2df3368d85 Properly handle dynamic reloc against normal symbol
We shouldn't issue an error for read-only segment with dynamic IFUNC
relocations when dynamic relocations are against normal symbols.

bfd/

	PR ld/19939
	* elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): Add a pointer
	to bfd_boolean.
	* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
	Set *readonly_dynrelocs_against_ifunc_p to TRUE if dynamic reloc
	applies to read-only section.
	* elf32-i386.c (elf_i386_link_hash_table): Add
	readonly_dynrelocs_against_ifunc.
	(elf_i386_allocate_dynrelocs): Updated.
	(elf_i386_size_dynamic_sections): Issue an error for read-only
	segment with dynamic IFUNC relocations only if
	readonly_dynrelocs_against_ifunc is TRUE.
	* elf64-x86-64.c (elf_x86_64_link_hash_table): Add
	readonly_dynrelocs_against_ifunc.
	(elf_x86_64_allocate_dynrelocs): Updated.
	(elf_x86_64_size_dynamic_sections): Issue an error for read-only
	segment with dynamic IFUNC relocations only if
	readonly_dynrelocs_against_ifunc is TRUE.
	* elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
	Updated.

ld/

	PR ld/19939
	* testsuite/ld-i386/i386.exp: Run PR ld/19939 tests.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-i386/pr19939.s: New file.
	* testsuite/ld-i386/pr19939a.d: Likewise.
	* testsuite/ld-i386/pr19939b.d: Likewise.
	* testsuite/ld-x86-64/pr19939.s: Likewise.
	* testsuite/ld-x86-64/pr19939a.d: Likewise.
	* testsuite/ld-x86-64/pr19939b.d: Likewise.
2016-04-11 19:41:52 -07:00
GDB Administrator b545ef977b Automatic date update in version.in 2016-04-12 00:00:09 +00:00
Maciej W. Rozycki 92708ceca5 MIPS/opcodes: Fix undecoded MIPS16 extended instruction bit disassembly
Correct the disassembly of hardware don't cares in MIPS16 extended
instructions.  Rather than e.g.:

   0:	f008 0231 	addiu	v0,sp,16433
   4:	f520 3260 	sll	v0,v1,-12

print:

   0:	f008 0231 	addiu	v0,sp,16401
   4:	f520 3260 	sll	v0,v1,20

respectively instead.

	opcodes/
	* mips-dis.c (print_mips16_insn_arg): Mask unused extended
	instruction bits out.

	binutils/
	* testsuite/binutils-all/mips/mips16-undecoded.d: New test.
	* testsuite/binutils-all/mips/mips16-undecoded.s: New test
	source.
	* testsuite/binutils-all/mips/mips.exp: Run the new test.
2016-04-11 18:01:18 +01:00
GDB Administrator 994aad6437 Automatic date update in version.in 2016-04-11 00:00:17 +00:00
Oleg Endo 93e6fe04cc Fix primary reason why the SH simulation hasn't been working on 64 bit hosts.
sim/sh/
	* interp.c (dmul): Split into dmul_s and dmul_u.  Use explicit integer
	width types and simplify implementation.
	* gencode.c (dmuls.l, dmulu.l): Use new functions dmul_s and dmul_u.
2016-04-10 11:02:47 +09:00
Oleg Endo ba442f0f41 Move ChangeLog entries from sim/ChangeLog to sim/sh/ChangeLog. 2016-04-10 10:53:20 +09:00
GDB Administrator 454540b959 Automatic date update in version.in 2016-04-10 00:00:25 +00:00
Maciej W. Rozycki 41a1578ed1 MIPS/GAS: Sanitize `.option picX' pseudo-op
gas/
	* config/tc-mips.c (s_option): Sanitize `.option picX'
	pseudo-op.
	* testsuite/gas/mips/option-pic-1.d: New test.
	* testsuite/gas/mips/option-pic-2.l: New list test.
	* testsuite/gas/mips/option-pic-1.s: New test source.
	* testsuite/gas/mips/option-pic-2.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.
2016-04-09 21:35:50 +01:00
Maciej W. Rozycki 668c5ebc09 MIPS/GAS: Disallow `.option picX' with VxWorks PIC
gas/
	* config/tc-mips.c (s_option): Reject `.option picX' if VxWorks
	PIC.
	* testsuite/gas/mips/option-pic-vxworks-1.l: New list test.
	* testsuite/gas/mips/option-pic-vxworks-2.l: New list test.
	* testsuite/gas/mips/option-pic-vxworks-1.s: New test source.
	* testsuite/gas/mips/option-pic-vxworks-2.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.
2016-04-09 21:23:40 +01:00
Simon Marchi 2e88a1ea30 gdb.python/py-mi-events-gdb.py: Add parentheses to print
Required for Python 3

gdb/testsuite/ChangeLog:

	* gdb.python/py-mi-events-gdb.py (signal_stop_handler): Add
	parentheses to print.
	(continue_handler): Likewise.
2016-04-09 08:41:41 -04:00
Maciej W. Rozycki 41065f5e08 MIPS/GAS: Correct call formatting in `can_swap_branch_p'
gas/
	* config/tc-mips.c (can_swap_branch_p): Correct call formatting.
2016-04-09 13:27:30 +01:00
Maciej W. Rozycki 08918cc8c5 GAS: Fix a typo in `as_bad' description
gas/
	* messages.c (as_bad): Fix a typo in description.
2016-04-09 13:22:54 +01:00
Maciej W. Rozycki 1357373c1d MIPS/GAS: Unify messages in `mips_check_options'
gas/
	* config/tc-mips.c (mips_check_options): Unify messages.
2016-04-09 13:19:00 +01:00
Maciej W. Rozycki 5f4678bb69 MIPS/GAS: Use `opts->isa' consistently in `mips_check_options'
gas/
	* config/tc-mips.c (mips_check_options): Use `opts->isa'
	consistently.
2016-04-09 12:55:09 +01:00
Oleg Endo 417a667c4a Adjust default memory size and stack base address for SH simulator.
ld/ChangeLog:
	* sh/interp.c (sim_memory_size): Default init to 30.
	(parse_and_set_memory_size): Adjust upper bound to 31.

sim/ChangeLog:
	* sh/interp.c (sim_memory_size): Default init to 30.
	(parse_and_set_memory_size): Adjust upper bound to 31.
2016-04-09 10:24:00 +09:00
GDB Administrator 9f5a6a60d9 Automatic date update in version.in 2016-04-09 00:00:22 +00:00
Simon Marchi f48e22e3f2 Make gdb.server/solib-list.exp work for remote targets
There are a few small changes needed to make it work with a real remote
target.

 - Remove the [is_remote target] check.
 - Remove soname setting when building the lib, it's done by default now
   anyway.
 - In the compilation of the executable, pass the shared lib using the
   shlib option, so that RPATH is set.
 - Download the program to the target using gdb_remote_download, and
   record the remote path.  Remove loading of the program using
   gdb_load_shlibs, which was not really appropriate anyway.
 - Run the remote path through readlink (see comment in the code).
 - Start gdbserver with the remote path.

Also, don't set executable and objfile variables, as they are unused.

Tested with native, native-gdbserver, native-extended-gdbserver, and a
remote gdbserver.

gdb/testsuite/ChangeLog:

	* gdb.server/solib-list.exp: Remove is_remote check.
	Pass shlib= to gdb_compile.  Don't link shared library with
	-soname.  Call gdb_remote_download instead of gdb_load_shlibs.
	Run binary filename through "readlink -f" on the target.
2016-04-08 18:45:29 -04:00
Pedro Alves 096be756aa Fix gdb.server/solib-list.exp regression
Commit 7817ea4614 (Improve gdb_remote_download, remove gdb_download)
caused:

 FAIL: gdb.server/solib-list.exp: non-stop 0: target extended-remote (timeout)
 FAIL: gdb.server/solib-list.exp: non-stop 0: continue (the program is no longer running)
 FAIL: gdb.server/solib-list.exp: non-stop 0: p libvar
 FAIL: gdb.server/solib-list.exp: non-stop 1: target extended-remote (timeout)
 FAIL: gdb.server/solib-list.exp: non-stop 1: continue (the program is no longer running)
 FAIL: gdb.server/solib-list.exp: non-stop 1: p libvar

gdb.log shows:

 system interpreter is: /lib64/ld-linux-x86-64.so.2
 ...
 spawn ../gdbserver/gdbserver --once :2347 /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/ld-linux-x86-64.so.2 /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/solib-list
 Process /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/ld-linux-x86-64.so.2 created; pid = 18637
 Cannot exec /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/ld-linux-x86-64.so.2: No such file or directory.
 ...

The test copied the interpreter to the outputs directory, however
ld-linux-x86-64.so.2 is a relative symlink that when copied points
nowhere:

 $ ls -l testsuite/outputs/gdb.server/solib-list/
 total 52
 -rwxrwxr-x. 1 pedro pedro 13450 Apr  7 10:52 gdb.log
 -rw-rw-r--. 1 pedro pedro  1512 Apr  7 10:52 gdb.sum
 lrwxrwxrwx. 1 pedro pedro    10 Apr  7 11:39 ld-linux-x86-64.so.2 -> ld-2.22.so
 -rwxrwxr-x. 1 pedro pedro  9464 Apr  7 11:39 solib-list
 -rw-rw-r--. 1 pedro pedro  3472 Apr  7 11:39 solib-list-lib.c.o
 -rw-rw-r--. 1 pedro pedro  2760 Apr  7 11:39 solib-list.o
 -rwxrwxr-x. 1 pedro pedro  9232 Apr  7 11:39 solib-list.so

The copying comes from gdbserver_spawn ->
gdbserver_download_current_prog -> gdb_remote_download.

There's actually no need to download the interpreter to the target -
it's part of the target system/environment.  So fix this by making the
test just not use gdb_load (and gdb_file_cmd as consequence) at all,
and instead pass the interpreter filename to gdbserver as an argument.

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

	* gdb.server/solib-list.exp: Don't use gdb_load.  Instead pass the
	interpreter filename as argument to gdbserver_spawn.
	* lib/gdbserver-support.exp (gdbserver_download_current_prog):
	Return empty if $last_loaded_file does not exist.
2016-04-08 19:40:01 +01:00
Martin Galvan 4bf7b526be value: Make accessor methods' parameters const-correct
I did a quick pass over value.c and value.h and made some of the accessor methods'
pass-by-reference parameters const-correct. Besides the obvious benefits, this is
required if we want to use them on values that are already declared as const
(such as the parameters to lval_funcs).

There's probably a lot more stuff that can be made const, here and elsewhere.

gdb/ChangeLog:
2016-04-08  Martin Galvan  <martin.galvan@tallertechnologies.com>

    * value.c (value_next): Make pass-by-reference parameters const-correct.
    (value_parent): Likewise.
    (value_enclosing_type): Likewise.
    (value_lazy): Likewise.
    (value_stack): Likewise.
    (value_embedded_offset): Likewise.
    (value_pointed_to_offset): Likewise.
    (value_raw_address): Likewise.
    (deprecated_value_modifiable): Likewise.
    (value_free_to_mark): Likewise.
    (value_release_to_mark): Likewise.
    (internalvar_name): Likewise.
    (readjust_indirect_value_type): Likewise.
    (value_initialized): Likewise.
    * value.h (value_next): Likewise.
    (value_parent): Likewise.
    (value_enclosing_type): Likewise.
    (value_lazy): Likewise.
    (value_stack): Likewise.
    (value_embedded_offset): Likewise.
    (value_pointed_to_offset): Likewise.
    (value_raw_address): Likewise.
    (deprecated_value_modifiable): Likewise.
    (value_free_to_mark): Likewise.
    (value_release_to_mark): Likewise.
    (internalvar_name): Likewise.
    (readjust_indirect_value_type): Likewise.
    (value_initialized): Likewise.
2016-04-08 15:06:56 -03:00
Alan Modra 136a43b762 PR18452, ld allows overlapping sections
PR 18452
	* ldlang.c (maybe_overlays): Delete.
	(lang_size_sections_1): Remove code setting maybe_overlays.
	(lang_check_section_addresses): Instead detect overlays by
	exact match of section VMAs here.  Fix memory leak.
2016-04-08 23:41:44 +09:30
Jan Kratochvil 0650053364 testsuite: Fix for gcc-4.8: gdb.base/jit.exp gdb.base/jit-so.exp
on CentOS-7.2 I get

Running /home/jkratoch/redhat/gdb-test-reg/gdb/testsuite/gdb.base/jit.exp ...
FAIL: gdb.base/jit.exp: one_jit_test-1: continue to breakpoint: break here 2 (the program exited)
FAIL: gdb.base/jit.exp: one_jit_test-2: continue to breakpoint: break here 2 (the program exited)
FAIL: gdb.base/jit.exp: attach: one_jit_test-2: continue to breakpoint: break here 2 (the program exited)
FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: set var wait_for_gdb = 1
FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: detach (the program is no longer running)
FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: attach
FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: set var wait_for_gdb = 0
FAIL: gdb.base/jit.exp: PIE: one_jit_test-1: continue to breakpoint: break here 2 (the program exited)
Running /home/jkratoch/redhat/gdb-test-reg/gdb/testsuite/gdb.base/jit-so.exp ...
FAIL: gdb.base/jit-so.exp: one_jit_test-1: continue to breakpoint: break here 2 (the program exited)
FAIL: gdb.base/jit-so.exp: one_jit_test-2: continue to breakpoint: break here 2 (the program exited)

since:

85af34ee0211eedf8d30a5c44dfc59dddf8b512a is the first bad commit
commit 85af34ee0211eedf8d30a5c44dfc59dddf8b512a
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Mar 31 19:28:47 2016 +0100
    Add regression test for PR gdb/19858 (JIT code registration on attach)

The compiled code's .debug_line is wrong (for the simplistic approach of GDB
to put a breakpoint on the first address belonging to that source line) and so
GDB misses the breakpoint at the last line:
          WAIT_FOR_GDB; return 0;  /* gdb break here 2  */

Most of the patch is just about reindentation, no changes there.

gdb/testsuite/ChangeLog
2016-04-08  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix compatibility with gcc-4.8.5-4.el7.x86_64.
	* gdb.base/jit-main.c: Use exit after usage.
2016-04-08 15:38:53 +02:00
Nick Clifton 992dc2c470 Fix regexps in PR19910 test to cope with COFF and AOUT sparc targets.
PR target/19910
	* testsuite/gas/sparc/pr19910-1.d: Adjust regexps to work with
	COFF and AOUT sparc targets.
2016-04-08 10:36:49 +01:00