Commit Graph

9 Commits

Author SHA1 Message Date
Jan Kratochvil c780cc2f50 Fix "save breakpoints" for "catch" command
gdb/ChangeLog
2014-10-13  Miroslav Franc  <mfranc@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix "save breakpoints" for "catch" command.
	* break-catch-sig.c (signal_catchpoint_print_recreate): Add trailing
	newline.

gdb/testsuite/ChangeLog
2014-10-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Yao Qi  <yao@codesourcery.com>

	Fix "save breakpoints" for "catch" command.
	* gdb.base/catch-signal.exp: Add gdb_breakpoint "main".
	Remove -nonewline.  Match also the added "main" line.
2014-10-13 13:39:48 +02:00
Pedro Alves 45741a9c32 Add new infrun.h header.
Move infrun.c declarations out of inferior.h to a new infrun.h file.

Tested by building on:

 i686-w64-mingw32, enable-targets=all
 x86_64-linux, enable-targets=all
 i586-pc-msdosdjgpp

And also grepped the whole tree for each symbol moved to find where
infrun.h might be necessary.

gdb/
2014-05-22  Pedro Alves  <palves@redhat.com>

	* inferior.h (debug_infrun, debug_displaced, stop_on_solib_events)
	(sync_execution, sched_multi, step_stop_if_no_debug, non_stop)
	(disable_randomization, enum exec_direction_kind)
	(execution_direction, stop_registers, start_remote)
	(clear_proceed_status, proceed, resume, user_visible_resume_ptid)
	(wait_for_inferior, normal_stop, get_last_target_status)
	(prepare_for_detach, fetch_inferior_event, init_wait_for_inferior)
	(insert_step_resume_breakpoint_at_sal)
	(follow_inferior_reset_breakpoints, stepping_past_instruction_at)
	(set_step_info, print_stop_event, signal_stop_state)
	(signal_print_state, signal_pass_state, signal_stop_update)
	(signal_print_update, signal_pass_update)
	(update_signals_program_target, clear_exit_convenience_vars)
	(displaced_step_dump_bytes, update_observer_mode)
	(signal_catch_update, gdb_signal_from_command): Move
	declarations ...
	* infrun.h: ... to this new file.
	* amd64-tdep.c: Include infrun.h.
	* annotate.c: Include infrun.h.
	* arch-utils.c: Include infrun.h.
	* arm-linux-tdep.c: Include infrun.h.
	* arm-tdep.c: Include infrun.h.
	* break-catch-sig.c: Include infrun.h.
	* breakpoint.c: Include infrun.h.
	* common/agent.c: Include infrun.h instead of inferior.h.
	* corelow.c: Include infrun.h.
	* event-top.c: Include infrun.h.
	* go32-nat.c: Include infrun.h.
	* i386-tdep.c: Include infrun.h.
	* inf-loop.c: Include infrun.h.
	* infcall.c: Include infrun.h.
	* infcmd.c: Include infrun.h.
	* infrun.c: Include infrun.h.
	* linux-fork.c: Include infrun.h.
	* linux-nat.c: Include infrun.h.
	* linux-thread-db.c: Include infrun.h.
	* monitor.c: Include infrun.h.
	* nto-tdep.c: Include infrun.h.
	* procfs.c: Include infrun.h.
	* record-btrace.c: Include infrun.h.
	* record-full.c: Include infrun.h.
	* remote-m32r-sdi.c: Include infrun.h.
	* remote-mips.c: Include infrun.h.
	* remote-notif.c: Include infrun.h.
	* remote-sim.c: Include infrun.h.
	* remote.c: Include infrun.h.
	* reverse.c: Include infrun.h.
	* rs6000-tdep.c: Include infrun.h.
	* s390-linux-tdep.c: Include infrun.h.
	* solib-irix.c: Include infrun.h.
	* solib-osf.c: Include infrun.h.
	* solib-svr4.c: Include infrun.h.
	* target.c: Include infrun.h.
	* top.c: Include infrun.h.
	* windows-nat.c: Include infrun.h.
	* mi/mi-interp.c: Include infrun.h.
	* mi/mi-main.c: Include infrun.h.
	* python/py-threadevent.c: Include infrun.h.
2014-05-22 12:29:11 +01:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Pedro Alves 47591c29ad Eliminate enum bpstat_signal_value, simplify random signal checks further.
After the previous patch, there's actually no breakpoint type that
returns BPSTAT_SIGNAL_HIDE, so we can go back to having
bpstat_explains_signal return a boolean.  The signal hiding actually
disappears.

gdb/
2013-11-14  Pedro Alves  <palves@redhat.com>

	* break-catch-sig.c (signal_catchpoint_explains_signal): Adjust to
	return a boolean.
	* breakpoint.c (bpstat_explains_signal): Adjust to return a
	boolean.
	(explains_signal_watchpoint, base_breakpoint_explains_signal):
	Adjust to return a boolean.
	* breakpoint.h (enum bpstat_signal_value): Delete.
	(struct breakpoint_ops) <explains_signal>: New returns a boolean.
	(bpstat_explains_signal): Likewise.
	* infrun.c (handle_inferior_event) <random signal checks>:
	bpstat_explains_signal now returns a boolean - adjust.  No longer
	consider hiding signals.
2013-11-14 19:51:15 +00:00
Tom Tromey 427cd150ee Fix PR cli/15603
This fixes PR cli/15603.

The bug here is that when a software watchpoint is being used, gdb
will stop responding to C-c.  This is a regression caused by the
"catch signal" patch.

The problem is that software watchpoints always end up on the bpstat
list.  However, this makes bpstat_explains_signal return
BPSTAT_SIGNAL_HIDE, causing infrun to think that the signal is not a
"random signal".

The fix is to change bpstat_explains_signal to handle this better.  I
chose to do it in a "clean API" way, by passing the signal value to
bpstat_explains_signal and then adding an explains_signal method for
watchpoints, which handles the specifics.

Built and regtested on x86-64 Fedora 18.
New test case included.

	* break-catch-sig.c (signal_catchpoint_explains_signal): Add 'sig'
	argument.
	* breakpoint.c (bpstat_explains_signal): Add 'sig' argument.
	Special case signals other than GDB_SIGNAL_TRAP.
	(explains_signal_watchpoint): New function.
	(base_breakpoint_explains_signal): Add 'sig' argument.
	(initialize_breakpoint_ops): Set 'explains_signal' method for
	watchpoints.
	* breakpoint.h (struct breakpoint_ops) <explains_signal>: Add
	signal argument.
	(bpstat_explains_signal): Likewise.
	* infrun.c (handle_syscall_event, handle_inferior_event): Update.

	* gdb.base/random-signal.c: New file.
	* gdb.base/random-signal.exp: New file.
2013-06-18 19:57:49 +00:00
Philippe Waroquiers 96f7d3f166 Fix to handle properly 'catch signal SIGINT' and SIGTRAP 2013-05-03 19:16:56 +00:00
Pedro Alves 6c01dd947c Update some copyright years.
Some files managed to get in the tree with outdated copyright years.
This fixes it.  Applied.

gdb/
2013-02-12  Pedro Alves  <palves@redhat.com>

	* break-catch-sig.c: Update copyright years.

gdb/testsuite/
2013-02-12  Pedro Alves  <palves@redhat.com>

	* gdb.base/catch-signal.c: Update copyright years.
	* gdb.base/catch-signal.exp: Update copyright years.
	* gdb.dwarf2/dw2-dir-file-name.c: Update copyright years.
	* gdb.dwarf2/dw2-dir-file-name.exp: Update copyright years.
	* gdb.dwarf2/dw2-empty-pc-range.S: Update copyright years.
	* gdb.dwarf2/dw2-error.S: Update copyright years.
	* gdb.dwarf2/dw2-error.c: Update copyright years.
	* gdb.dwarf2/dw2-restrict.S: Update copyright years.
	* gdb.dwarf2/dw2-restrict.c: Update copyright years.
	* gdb.dwarf2/dw2-restrict.exp: Update copyright years.
2013-02-12 18:27:29 +00:00
Aleksandar Ristovski 0e43993ae8 2013-01-31 Aleksandar Ristovski <aristovski@qnx.com>
* auto-load.c (auto_load_expand_dir_vars): Remove unused dir_vec.
        * ax-gdb.c (gen_printf): Remove unused expr, i, bot, fr, flen, fmt.
        * ax-general.c (ax_print): Remove unused is_float.
        * blockframe.c (block_innermost_frame): Remove unused start, end.
        * break-catch-sig.c (catch_signal_command): Remove unused gdbarch.

Reference: http://sourceware.org/ml/gdb-patches/2013-01/msg00752.html
2013-01-31 16:27:50 +00:00
Tom Tromey ab04a2af2b 2013-01-03 Pedro Alves <palves@redhat.com>
Tom Tromey  <tromey@redhat.com>
	PR cli/7221:
	* NEWS: Add "catch signal".
	* breakpoint.c (base_breakpoint_ops): No longer static.
	(bpstat_explains_signal): New function.
	(init_catchpoint): No longer static.
	(base_breakpoint_explains_signal): New function.
	(base_breakpoint_ops): Initialize new field.
	* breakpoint.h (enum bpstat_signal_value): New.
	(struct breakpoint_ops) <explains_signal>: New field.
	(bpstat_explains_signal): Remove macro, declare as function.
	(base_breakpoint_ops, init_catchpoint): Declare.
	* break-catch-sig.c: New file.
	* inferior.h (signal_catch_update): Declare.
	* infrun.c (signal_catch): New global.
	(handle_syscall_event): Update for change to
	bpstat_explains_signal.
	(handle_inferior_event): Likewise.  Always handle random signals
	via bpstats.
	(signal_cache_update): Check signal_catch.
	(signal_catch_update): New function.
	(_initialize_infrun): Initialize signal_catch.
	* Makefile.in (SFILES): Add break-catch-sig.c.
	(COMMON_OBS): Add break-catch-sig.o.
gdb/doc
	* gdb.texinfo (Set Catchpoints): Document "catch signal".
	(Signals): Likewise.
gdb/testsuite
	* gdb.base/catch-signal.c: New file.
	* gdb.base/catch-signal.exp: New file.
2013-01-16 17:31:40 +00:00