Fix PR19388: Can't access $_siginfo in breakpoint (catch signal) condition
This commit merges both the registers and $_siginfo "thread
running/executing" checks into a single function.
Accessing $_siginfo from a "catch signal" breakpoint condition doesn't
work. The condition always fails with "Selected thread is running":
(gdb) catch signal
Catchpoint 3 (standard signals)
(gdb)
condition $bpnum $_siginfo.si_signo == 5
(gdb) continue
Continuing.
Error in testing breakpoint condition:
Selected thread is running.
Catchpoint 3 (signal SIGUSR1), 0x0000003615e35877 in __GI_raise (sig=10) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb)
When accessing the $_siginfo object, we check whether the thread is
marked running (external/public) state and refuse the access if so.
This is so "print $_siginfo" at the prompt fails nicelly when the
current thread is running. While evaluating breakpoint conditionals,
we haven't decided yet whether the thread is going to stop, so
is_running still returns true, and we thus always error out.
Evaluating an expression that requires registers access is really
conceptually the same -- we could think of $_siginfo as a pseudo
register. However, in that case we check whether the thread is marked
executing (internal/private state), not running (external/public
state). Changing the $_siginfo validation to check is_executing as
well fixes the bug in question.
Note that checking is_executing is not fully correct, not even for
registers. See PR 19389. However, I think this is the lesser of two
evils and ends up as an improvement. We at least now have a single
place to fix.
Tested on x86_64 GNU/Linux.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
PR breakpoints/19388
* frame.c (get_current_frame): Use validate_registers_access.
* gdbthread.h (validate_registers_access): Declare.
* infrun.c (validate_siginfo_access): Delete.
(siginfo_value_read, siginfo_value_write): Use
validate_registers_access.
* thread.c (validate_registers_access): New function.
gdb/testsuite/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
PR breakpoints/19388
* gdb.base/catch-signal-siginfo-cond.c: New file.
* gdb.base/catch-signal-siginfo-cond.exp: New file.
2016-01-13 11:40:33 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/19388
|
|
|
|
|
* frame.c (get_current_frame): Use validate_registers_access.
|
|
|
|
|
* gdbthread.h (validate_registers_access): Declare.
|
|
|
|
|
* infrun.c (validate_siginfo_access): Delete.
|
|
|
|
|
(siginfo_value_read, siginfo_value_write): Use
|
|
|
|
|
validate_registers_access.
|
|
|
|
|
* thread.c (validate_registers_access): New function.
|
|
|
|
|
|
2016-01-12 21:27:27 +01:00
|
|
|
|
2016-01-12 Josh Stone <jistone@redhat.com>
|
|
|
|
|
Philippe Waroquiers <philippe.waroquiers@skynet.be>
|
|
|
|
|
|
|
|
|
|
* NEWS (Changes since GDB 7.10): Mention QCatchSyscalls and the
|
|
|
|
|
syscall_entry and syscall_return stop reasons. Mention GDB
|
|
|
|
|
support for remote catch syscall.
|
|
|
|
|
* remote.c (PACKET_QCatchSyscalls): New enum.
|
|
|
|
|
(remote_set_syscall_catchpoint): New function.
|
|
|
|
|
(remote_protocol_features): New element for QCatchSyscalls.
|
|
|
|
|
(remote_parse_stop_reply): Parse syscall_entry/return stops.
|
|
|
|
|
(init_remote_ops): Install remote_set_syscall_catchpoint.
|
|
|
|
|
(_initialize_remote): Config QCatchSyscalls.
|
|
|
|
|
* linux-nat.h (struct lwp_info) <syscall_state>: Comment typo.
|
|
|
|
|
|
2016-01-12 17:29:30 +01:00
|
|
|
|
2016-01-12 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* nat/linux-ptrace.c (linux_child_function): Cast child_stack
|
|
|
|
|
to gdb_byte * and pass to linux_fork_to_function.
|
|
|
|
|
|
Change function signature passed to clone
I see the following compile error with an old bfin-uclinux gcc to
build GDBserver,
cc1: warnings being treated as errors
gdb/gdbserver/../nat/linux-ptrace.c: In function 'linux_fork_to_function':
gdb/gdbserver/../nat/linux-ptrace.c:283: error: passing argument 1 of 'clone' from incompatible pointer type
in glibc, clone's prototype is like this, and in uClibc, it is the same,
int clone(int (*fn)(void *), void *child_stack,
int flags, void *arg, ...
/* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ );
so this patch changes function signature from 'void (*function) (gdb_byte *)'
to 'int (*function) (void *)'.
Note that I find Pedro advised to change argument type from 'void *'
to 'gdb_byte *' during the patch review
https://sourceware.org/ml/gdb-patches/2013-08/msg00611.html however,
I think fix compile error can justify the change back to 'void *'.
gdb:
2016-01-12 Yao Qi <yao.qi@linaro.org>
* nat/linux-ptrace.c (linux_fork_to_function): Change type
of argument 'function'.
(linux_grandchild_function): Change return type to 'int'.
Change child_stack's type to 'void *'.
(linux_child_function): Likewise.
2016-01-12 16:18:09 +01:00
|
|
|
|
2016-01-12 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* nat/linux-ptrace.c (linux_fork_to_function): Change type
|
|
|
|
|
of argument 'function'.
|
|
|
|
|
(linux_grandchild_function): Change return type to 'int'.
|
|
|
|
|
Change child_stack's type to 'void *'.
|
|
|
|
|
(linux_child_function): Likewise.
|
|
|
|
|
|
2016-01-12 16:03:11 +01:00
|
|
|
|
2016-01-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Remove use of the registered trademark symbol throughout.
|
|
|
|
|
|
2016-01-12 12:53:09 +01:00
|
|
|
|
2016-01-12 Thomas Schwinge <thomas@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* reply_mig_hack.awk: Rewrite one regular expression.
|
|
|
|
|
|
2016-01-07 12:06:04 +01:00
|
|
|
|
2016-01-11 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* acinclude.m4: Include new warning.m4 file.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
* configure.ac: Move all warning logic ...
|
|
|
|
|
* warning.m4: ... here.
|
|
|
|
|
|
Change SIGINT handler for extension languages only when target terminal is ours
I see a timeout in gdb.base/random-signal.exp,
Continuing.^M
PASS: gdb.base/random-signal.exp: continue
^CPython Exception <type 'exceptions.KeyboardInterrupt'> <type
exceptions.KeyboardInterrupt'>: ^M
FAIL: gdb.base/random-signal.exp: stop with control-c (timeout)
it can be reproduced by running random-signal.exp with native-gdbserver
in a loop, like this, and the fail will be shown in about 20 runs,
$ (set -e; while true; do make check RUNTESTFLAGS="--target_board=native-gdbserver random-signal.exp"; done)
In the test, the program is being single-stepped for software watchpoint,
and in each internal stop, python unwinder sniffer is used,
#0 pyuw_sniffer (self=<optimised out>, this_frame=<optimised out>, cache_ptr=0xd554f8) at /home/yao/SourceCode/gnu/gdb/git/gdb/python/py-unwind.c:608
#1 0x00000000006a10ae in frame_unwind_try_unwinder (this_frame=this_frame@entry=0xd554e0, this_cache=this_cache@entry=0xd554f8, unwinder=0xecd540)
at /home/yao/SourceCode/gnu/gdb/git/gdb/frame-unwind.c:107
#2 0x00000000006a143f in frame_unwind_find_by_frame (this_frame=this_frame@entry=0xd554e0, this_cache=this_cache@entry=0xd554f8)
at /home/yao/SourceCode/gnu/gdb/git/gdb/frame-unwind.c:163
#3 0x000000000069dc6b in compute_frame_id (fi=0xd554e0) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:454
#4 get_prev_frame_if_no_cycle (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1781
#5 0x000000000069fdb9 in get_prev_frame_always_1 (this_frame=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1955
#6 get_prev_frame_always (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1971
#7 0x00000000006a04b1 in get_prev_frame (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:2213
when GDB goes to python extension, or other language extension, the
SIGINT handler is changed, and is restored when GDB leaves extension
language. GDB only stays in extension language for a very short period
in this case, but if ctrl-c is pressed at that moment, python extension
will handle the SIGINT, and exceptions.KeyboardInterrupt is shown.
Language extension is used in GDB side rather than inferior side,
so GDB should only change SIGINT handler for extension language when
the terminal is ours (not inferior's). This is what this patch does.
With this patch applied, I run random-signal.exp in a loop for 18
hours, and no fail is shown.
gdb:
2016-01-08 Yao Qi <yao.qi@linaro.org>
* extension.c: Include target.h.
(set_active_ext_lang): Only call install_gdb_sigint_handler,
check_quit_flag, and set_quit_flag if target_terminal_is_ours
returns false.
(restore_active_ext_lang): Likewise.
* target.c (target_terminal_is_ours): New function.
* target.h (target_terminal_is_ours): Declare.
2016-01-08 12:06:00 +01:00
|
|
|
|
2016-01-08 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* extension.c: Include target.h.
|
|
|
|
|
(set_active_ext_lang): Only call install_gdb_sigint_handler,
|
|
|
|
|
check_quit_flag, and set_quit_flag if target_terminal_is_ours
|
|
|
|
|
returns false.
|
|
|
|
|
(restore_active_ext_lang): Likewise.
|
|
|
|
|
* target.c (target_terminal_is_ours): New function.
|
|
|
|
|
* target.h (target_terminal_is_ours): Declare.
|
|
|
|
|
|
2016-01-07 20:12:44 +01:00
|
|
|
|
2016-01-07 Maciej W. Rozycki <macro@imgtec.com>
|
|
|
|
|
|
|
|
|
|
* mips-tdep.c (mips_breakpoint_from_pc): Rename local `status'
|
|
|
|
|
to `err' in the little-endian leg.
|
|
|
|
|
|
2016-01-06 16:03:41 +01:00
|
|
|
|
2016-01-06 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arch/arm-get-next-pcs.c (arm_get_next_pcs): Move it to some
|
|
|
|
|
lines below.
|
|
|
|
|
(thumb_get_next_pcs_raw): Make it static.
|
|
|
|
|
(arm_get_next_pcs_raw): Likewise.
|
|
|
|
|
* arch/arm-get-next-pcs.h (thumb_get_next_pcs_raw): Remove the
|
|
|
|
|
declaration.
|
|
|
|
|
(arm_get_next_pcs_raw): Likewise.
|
|
|
|
|
|
2016-01-06 05:23:52 +01:00
|
|
|
|
2016-01-05 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* version.in: Change cvs to git.
|
|
|
|
|
|
2016-01-02 09:11:44 +01:00
|
|
|
|
2016-01-05 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* configure.tgt (score-*-*): Delete gdb_sim assignment.
|
|
|
|
|
|
2016-01-05 12:03:40 +01:00
|
|
|
|
2016-01-05 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR sim/13418
|
|
|
|
|
* configure.ac: Define WITH_PPC_SIM when linking in the sim and
|
|
|
|
|
the target is powerpc*.
|
2016-01-05 12:12:31 +01:00
|
|
|
|
* rs6000-tdep.c (init_sim_regno_table): Check WITH_PPC_SIM instead
|
|
|
|
|
of WITH_SIM.
|
2016-01-05 12:03:40 +01:00
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
|
2015-12-23 13:53:53 +01:00
|
|
|
|
2016-01-04 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* btrace.c (btrace_pt_readmem_callback): Do not return in TRY/CATCH.
|
|
|
|
|
|
2016-01-02 09:10:57 +01:00
|
|
|
|
2016-01-02 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* configure.tgt (powerpc*-*-*): Delete test call and
|
|
|
|
|
always assign gdb_sim.
|
|
|
|
|
|
2016-01-01 05:33:14 +01:00
|
|
|
|
2016-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
Update year range in copyright notice of all files.
|
|
|
|
|
|
2016-01-01 05:22:36 +01:00
|
|
|
|
2016-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* top.c (print_gdb_version): Change copyright year in version
|
|
|
|
|
message.
|
|
|
|
|
|
2016-01-01 05:19:16 +01:00
|
|
|
|
2016-01-01 Joel Brobecker <brobecker@adacore.com>
|
[win32] cannot automatically find executable file [...] warning at GDB startup
The following change...
commit 43499ea30db2a866412c86952c7e1d7b158d806f
Date: Tue Nov 17 15:17:44 2015 +0000
Subject: [C++/mingw] windows-nat.c casts
... causes a small regression in GDB, where we get the following
warning at startup:
% gdb
C:\[...]\gdb.exe: warning: cannot automatically find executable file or library to read symbols.
Use "file" or "dll" command to load executable/libraries directly.
GNU gdb (GDB) 7.10.50.20151218-cvs (with AdaCore local changes)
[...]
(gdb)
The warning comes from _initialize_loadable which tries to dynamically
load some symbols from kernel32.dll and psapi.dll, and in particular:
hm = LoadLibrary ("psapi.dll");
if (hm)
{
GPA (hm, EnumProcessModules);
GPA (hm, GetModuleInformation);
GPA (hm, GetModuleFileNameEx);
}
The problem is that the new GPA macro assumes that the name of
the variable we use to point to the function, and the name of
its associated symbol are the same. This is mostly the case,
except for GetModuleFileNameEx, where the name is provided by
the GetModuleFileNameEx_name macro (defined differently depending
on whether we are on cygwin or not). As a result, the dynamic
resolution for GetModuleFileNameEx returns NULL, and we trip
the following check which leads to the warning:
if (!EnumProcessModules || !GetModuleInformation || !GetModuleFileNameEx)
{
[...]
warning(_("[...]"));
}
This patch fixes the problem by calling GetProcAddress directly,
rather than through the GPA macro, but in a way which hopefully
avoids the C++ compilation warning that the previous patch was
trying to get rid of.
gdb/ChangeLog:
* windows-nat.c (_initialize_loadable): Fix computing of
GetModuleFileNameEx.
2015-12-19 15:21:01 +01:00
|
|
|
|
|
2016-01-01 05:19:16 +01:00
|
|
|
|
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2015.
|
[win32] cannot automatically find executable file [...] warning at GDB startup
The following change...
commit 43499ea30db2a866412c86952c7e1d7b158d806f
Date: Tue Nov 17 15:17:44 2015 +0000
Subject: [C++/mingw] windows-nat.c casts
... causes a small regression in GDB, where we get the following
warning at startup:
% gdb
C:\[...]\gdb.exe: warning: cannot automatically find executable file or library to read symbols.
Use "file" or "dll" command to load executable/libraries directly.
GNU gdb (GDB) 7.10.50.20151218-cvs (with AdaCore local changes)
[...]
(gdb)
The warning comes from _initialize_loadable which tries to dynamically
load some symbols from kernel32.dll and psapi.dll, and in particular:
hm = LoadLibrary ("psapi.dll");
if (hm)
{
GPA (hm, EnumProcessModules);
GPA (hm, GetModuleInformation);
GPA (hm, GetModuleFileNameEx);
}
The problem is that the new GPA macro assumes that the name of
the variable we use to point to the function, and the name of
its associated symbol are the same. This is mostly the case,
except for GetModuleFileNameEx, where the name is provided by
the GetModuleFileNameEx_name macro (defined differently depending
on whether we are on cygwin or not). As a result, the dynamic
resolution for GetModuleFileNameEx returns NULL, and we trip
the following check which leads to the warning:
if (!EnumProcessModules || !GetModuleInformation || !GetModuleFileNameEx)
{
[...]
warning(_("[...]"));
}
This patch fixes the problem by calling GetProcAddress directly,
rather than through the GPA macro, but in a way which hopefully
avoids the C++ compilation warning that the previous patch was
trying to get rid of.
gdb/ChangeLog:
* windows-nat.c (_initialize_loadable): Fix computing of
GetModuleFileNameEx.
2015-12-19 15:21:01 +01:00
|
|
|
|
|
2016-01-01 05:19:16 +01:00
|
|
|
|
For older changes see ChangeLog-2015.
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: change-log
|
|
|
|
|
left-margin: 8
|
|
|
|
|
fill-column: 74
|
|
|
|
|
version-control: never
|
2007-08-10 00:44:38 +02:00
|
|
|
|
coding: utf-8
|
1999-04-16 03:35:26 +02:00
|
|
|
|
End:
|