2016-01-14 14:54:24 +00:00
|
|
|
|
2016-01-14 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arm-linux-tdep.c (arm_linux_get_next_pcs_syscall_next_pc):
|
|
|
|
|
Declare.
|
|
|
|
|
(arm_linux_get_next_pcs_ops): Install
|
|
|
|
|
arm_linux_get_next_pcs_syscall_next_pc.
|
|
|
|
|
(arm_linux_syscall_next_pc): Change to ...
|
|
|
|
|
(arm_linux_get_next_pcs_syscall_next_pc): ... it.
|
|
|
|
|
(arm_linux_init_abi): Don't set tdep->syscall_next_pc.
|
|
|
|
|
* arm-tdep.c (arm_get_next_pcs_syscall_next_pc): Declare.
|
|
|
|
|
(arm_get_next_pcs_syscall_next_pc): Make it static. Don't
|
|
|
|
|
call tdep->syscall_next_pc.
|
|
|
|
|
* arm-tdep.h (struct gdbarch_tdep) <syscall_next_pc>: Remove.
|
|
|
|
|
(arm_get_next_pcs_syscall_next_pc): Remove.
|
|
|
|
|
|
2016-01-14 12:28:02 +00:00
|
|
|
|
2016-01-14 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_set_syscall_catchpoint): Cast to char *.
|
|
|
|
|
* thread.c (do_captured_thread_select): Cast to const char *.
|
|
|
|
|
|
[ARM] Make thumb2_breakpoint static again
This patch makes thumb2_breakpoint static. When writing this patch,
I find the only reason we keep thumb2_breakpoint extern is that it
is used as an argument passed to arm_gdbserver_get_next_pcs. However,
field arm_thumb2_breakpoint is only used in a null check in
thumb_get_next_pcs_raw, so I wonder why do need to pass thumb2_breakpoint
to arm_gdbserver_get_next_pcs.
thumb2_breakpoint was added by Daniel Jacobowitz in order to support
single-step IT block
https://sourceware.org/ml/gdb-patches/2010-01/msg00624.html the logic
there was if we have 32-bit thumb-2 breakpoint defined, we can safely
single-step IT block, otherwise, we can't. Daniel didn't want to use
16-bit thumb BKPT instruction, because it triggers even on instruction
which should be executed. Secondly, using 16-bit thumb illegal
instruction on top of 32-bit thumb instruction may break the meaning of
original IT blocks, because the other 16-bit can be regarded as an
instruction. See more explanations from Daniel's kernel patch
http://www.spinics.net/lists/arm-kernel/msg80476.html
Let us back to this patch, GDB/GDBserver can safely single step
IT block if thumb2_breakpoint is defined, but the single step logic
doesn't have to know the thumb-2 breakpoint instruction. Only
breakpoint insertion mechanism decides to use which breakpoint
instruction. In the software single step code, instead of pass
thumb2_breakpoint, we can pass a boolean variable
has_thumb2_breakpoint indicate whether the target has thumb-2
breakpoint defined, which is equivalent to the original code.
Regression tested on arm-linux. No regression.
gdb:
2016-01-14 Yao Qi <yao.qi@linaro.org>
* arch/arm-get-next-pcs.c (arm_get_next_pcs_ctor): Change
argument arm_thumb2_breakpoint to has_thumb2_breakpoint.
(thumb_get_next_pcs_raw): Check has_thumb2_breakpoint
instead.
* arch/arm-get-next-pcs.h (struct arm_get_next_pcs)
<arm_thumb2_breakpoint>: Remove.
<has_thumb2_breakpoint>: New field.
(arm_get_next_pcs_ctor): Update declaration.
* arm-linux-tdep.c (arm_linux_software_single_step): Pass
1 to arm_get_next_pcs_ctor.
* arm-tdep.c (arm_software_single_step): Pass 0 to
arm_get_next_pcs_ctor.
gdb/gdbserver:
2016-01-14 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (thumb2_breakpoint): Make it static.
* linux-aarch32-low.h (thumb2_breakpoint): Remove declaration.
* linux-arm-low.c (arm_gdbserver_get_next_pcs): Pass 1 to
arm_get_next_pcs_ctor.
2016-01-14 09:36:43 +00:00
|
|
|
|
2016-01-14 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arch/arm-get-next-pcs.c (arm_get_next_pcs_ctor): Change
|
|
|
|
|
argument arm_thumb2_breakpoint to has_thumb2_breakpoint.
|
|
|
|
|
(thumb_get_next_pcs_raw): Check has_thumb2_breakpoint
|
|
|
|
|
instead.
|
|
|
|
|
* arch/arm-get-next-pcs.h (struct arm_get_next_pcs)
|
|
|
|
|
<arm_thumb2_breakpoint>: Remove.
|
|
|
|
|
<has_thumb2_breakpoint>: New field.
|
|
|
|
|
(arm_get_next_pcs_ctor): Update declaration.
|
|
|
|
|
* arm-linux-tdep.c (arm_linux_software_single_step): Pass
|
|
|
|
|
1 to arm_get_next_pcs_ctor.
|
|
|
|
|
* arm-tdep.c (arm_software_single_step): Pass 0 to
|
|
|
|
|
arm_get_next_pcs_ctor.
|
|
|
|
|
|
2016-01-13 17:57:59 +00:00
|
|
|
|
2016-01-13 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS: Add Andreas Arnez as s390 target maintainer.
|
|
|
|
|
|
2016-01-13 16:15:31 +00:00
|
|
|
|
2016-01-13 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arch/arm-get-next-pcs.c (arm_get_next_pcs_raw): Use
|
|
|
|
|
byte_order_for_code to read instruction.
|
|
|
|
|
|
2016-01-13 10:56:10 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention $_gthread.
|
|
|
|
|
* gdbthread.h (struct thread_info) <global_num>: Mention
|
|
|
|
|
$_gthread.
|
|
|
|
|
* thread.c (thread_num_make_value_helper): New function.
|
|
|
|
|
(thread_id_make_value): Delete.
|
|
|
|
|
(thread_id_per_inf_num_make_value, global_thread_id_make_value):
|
|
|
|
|
New.
|
|
|
|
|
(thread_funcs): Adjust.
|
|
|
|
|
(gthread_funcs): New.
|
|
|
|
|
(_initialize_thread): Register $_gthread variable.
|
|
|
|
|
|
2016-01-13 10:56:09 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention "info threads -gid".
|
|
|
|
|
* gdbthread.h (struct thread_info) <global_num>: Mention "info
|
|
|
|
|
threads -gid".
|
|
|
|
|
* thread.c (info_threads_command): Handle "-gid".
|
|
|
|
|
(_initialize_thread): Adjust "info threads" help string to mention
|
|
|
|
|
-gid.
|
|
|
|
|
|
2016-01-13 10:56:08 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention InferiorThread.global_num.
|
|
|
|
|
* python/py-infthread.c (thpy_get_global_num): New function.
|
|
|
|
|
(thread_object_getset): Register "global_num".
|
|
|
|
|
|
Per-inferior/Inferior-qualified thread IDs
This commit changes GDB to track thread numbers per-inferior. Then,
if you're debugging multiple inferiors, GDB displays
"inferior-num.thread-num" instead of just "thread-num" whenever it
needs to display a thread:
(gdb) info inferiors
Num Description Executable
1 process 6022 /home/pedro/gdb/tests/threads
* 2 process 6037 /home/pedro/gdb/tests/threads
(gdb) info threads
Id Target Id Frame
1.1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running)
1.2 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running)
1.3 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running)
2.1 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running)
2.2 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running)
* 2.3 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running)
(gdb)
...
(gdb) thread 1.1
[Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))]
(gdb)
...
etc.
You can still use "thread NUM", in which case GDB infers you're
referring to thread NUM of the current inferior.
The $_thread convenience var and Python's InferiorThread.num attribute
are remapped to the new per-inferior thread number. It's a backward
compatibility break, but since it only matters when debugging multiple
inferiors, I think it's worth doing.
Because MI thread IDs need to be a single integer, we keep giving
threads a global identifier, _in addition_ to the per-inferior number,
and make MI always refer to the global thread IDs. IOW, nothing
changes from a MI frontend's perspective.
Similarly, since Python's Breakpoint.thread and Guile's
breakpoint-thread/set-breakpoint-thread breakpoint methods need to
work with integers, those are adjusted to work with global thread IDs
too. Follow up patches will provide convenient means to access
threads' global IDs.
To avoid potencially confusing users (which also avoids updating much
of the testsuite), if there's only one inferior and its ID is "1",
IOW, the user hasn't done anything multi-process/inferior related,
then the "INF." part of thread IDs is not shown. E.g,.:
(gdb) info inferiors
Num Description Executable
* 1 process 15275 /home/pedro/gdb/tests/threads
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7ffff7fc1740 (LWP 15275) "threads" main () at threads.c:40
(gdb) add-inferior
Added inferior 2
(gdb) info threads
Id Target Id Frame
* 1.1 Thread 0x7ffff7fc1740 (LWP 15275) "threads" main () at threads.c:40
(gdb)
No regressions on x86_64 Fedora 20.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* NEWS: Mention that thread IDs are now per inferior and global
thread IDs.
* Makefile.in (SFILES): Add tid-parse.c.
(COMMON_OBS): Add tid-parse.o.
(HFILES_NO_SRCDIR): Add tid-parse.h.
* ada-tasks.c: Adjust to use ptid_to_global_thread_id.
* breakpoint.c (insert_breakpoint_locations)
(remove_threaded_breakpoints, bpstat_check_breakpoint_conditions)
(print_one_breakpoint_location, set_longjmp_breakpoint)
(check_longjmp_breakpoint_for_call_dummy)
(set_momentary_breakpoint): Adjust to use global IDs.
(find_condition_and_thread, watch_command_1): Use parse_thread_id.
(until_break_command, longjmp_bkpt_dtor)
(breakpoint_re_set_thread, insert_single_step_breakpoint): Adjust
to use global IDs.
* dummy-frame.c (pop_dummy_frame_bpt): Adjust to use
ptid_to_global_thread_id.
* elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
* gdbthread.h (struct thread_info): Rename field 'num' to
'global_num. Add new fields 'per_inf_num' and 'inf'.
(thread_id_to_pid): Rename thread_id_to_pid to
global_thread_id_to_ptid.
(pid_to_thread_id): Rename to ...
(ptid_to_global_thread_id): ... this.
(valid_thread_id): Rename to ...
(valid_global_thread_id): ... this.
(find_thread_id): Rename to ...
(find_thread_global_id): ... this.
(ALL_THREADS, ALL_THREADS_BY_INFERIOR): Declare.
(print_thread_info): Add comment.
* tid-parse.h: New file.
* tid-parse.c: New file.
* infcmd.c (step_command_fsm_prepare)
(step_command_fsm_should_stop): Adjust to use the global thread
ID.
(until_next_command, until_next_command)
(finish_command_fsm_should_stop): Adjust to use the global thread
ID.
(attach_post_wait): Adjust to check the inferior number too.
* inferior.h (struct inferior) <highest_thread_num>: New field.
* infrun.c (handle_signal_stop)
(insert_exception_resume_breakpoint)
(insert_exception_resume_from_probe): Adjust to use the global
thread ID.
* record-btrace.c (record_btrace_open): Use global thread IDs.
* remote.c (process_initial_stop_replies): Also consider the
inferior number.
* target.c (target_pre_inferior): Clear the inferior's highest
thread num.
* thread.c (clear_thread_inferior_resources): Adjust to use the
global thread ID.
(new_thread): New inferior parameter. Adjust to use it. Set both
the thread's global ID and the thread's per-inferior ID.
(add_thread_silent): Adjust.
(find_thread_global_id): New.
(find_thread_id): Make static. Adjust to rename.
(valid_thread_id): Rename to ...
(valid_global_thread_id): ... this.
(pid_to_thread_id): Rename to ...
(ptid_to_global_thread_id): ... this.
(thread_id_to_pid): Rename to ...
(global_thread_id_to_ptid): ... this. Adjust.
(first_thread_of_process): Adjust.
(do_captured_list_thread_ids): Adjust to use global thread IDs.
(should_print_thread): New function.
(print_thread_info): Rename to ...
(print_thread_info_1): ... this, and add new show_global_ids
parameter. Handle it. Iterate over inferiors.
(print_thread_info): Reimplement as wrapper around
print_thread_info_1.
(show_inferior_qualified_tids): New function.
(print_thread_id): Use it.
(tp_array_compar): Compare inferior numbers too.
(thread_apply_command): Use tid_range_parser.
(do_captured_thread_select): Use parse_thread_id.
(thread_id_make_value): Adjust.
(_initialize_thread): Adjust "info threads" help string.
* varobj.c (struct varobj_root): Update comment.
(varobj_create): Adjust to use global thread IDs.
(value_of_root_1): Adjust to use global_thread_id_to_ptid.
* windows-tdep.c (display_tib): No longer accept an argument.
* cli/cli-utils.c (get_number_trailer): Make extern.
* cli/cli-utils.h (get_number_trailer): Declare.
(get_number_const): Adjust documentation.
* mi/mi-cmd-var.c (mi_cmd_var_update_iter): Adjust to use global
thread IDs.
* mi/mi-interp.c (mi_new_thread, mi_thread_exit)
(mi_on_normal_stop, mi_output_running_pid, mi_on_resume):
* mi/mi-main.c (mi_execute_command, mi_cmd_execute): Likewise.
* guile/scm-breakpoint.c (gdbscm_set_breakpoint_thread_x):
Likewise.
* python/py-breakpoint.c (bppy_set_thread): Likewise.
* python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
* python/py-infthread.c (thpy_get_num): Add comment and return the
per-inferior thread ID.
(thread_object_getset): Update comment of "num".
gdb/testsuite/ChangeLog:
2016-01-07 Pedro Alves <palves@redhat.com>
* gdb.base/break.exp: Adjust to output changes.
* gdb.base/hbreak2.exp: Likewise.
* gdb.base/sepdebug.exp: Likewise.
* gdb.base/watch_thread_num.exp: Likewise.
* gdb.linespec/keywords.exp: Likewise.
* gdb.multi/info-threads.exp: Likewise.
* gdb.threads/thread-find.exp: Likewise.
* gdb.multi/tids.c: New file.
* gdb.multi/tids.exp: New file.
gdb/doc/ChangeLog:
2016-01-07 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Threads): Document per-inferior thread IDs,
qualified thread IDs, global thread IDs and thread ID lists.
(Set Watchpoints, Thread-Specific Breakpoints): Adjust to refer to
thread IDs.
(Convenience Vars): Document the $_thread convenience variable.
(Ada Tasks): Adjust to refer to thread IDs.
(GDB/MI Async Records, GDB/MI Thread Commands, GDB/MI Ada Tasking
Commands, GDB/MI Variable Objects): Update to mention global
thread IDs.
* guile.texi (Breakpoints In Guile)
<breakpoint-thread/set-breakpoint-thread breakpoint>: Mention
global thread IDs instead of thread IDs.
* python.texi (Threads In Python): Adjust documentation of
InferiorThread.num.
(Breakpoint.thread): Mention global thread IDs instead of thread
IDs.
2016-01-13 10:56:07 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention that thread IDs are now per inferior and global
|
|
|
|
|
thread IDs.
|
|
|
|
|
* Makefile.in (SFILES): Add tid-parse.c.
|
|
|
|
|
(COMMON_OBS): Add tid-parse.o.
|
|
|
|
|
(HFILES_NO_SRCDIR): Add tid-parse.h.
|
|
|
|
|
* ada-tasks.c: Adjust to use ptid_to_global_thread_id.
|
|
|
|
|
* breakpoint.c (insert_breakpoint_locations)
|
|
|
|
|
(remove_threaded_breakpoints, bpstat_check_breakpoint_conditions)
|
|
|
|
|
(print_one_breakpoint_location, set_longjmp_breakpoint)
|
|
|
|
|
(check_longjmp_breakpoint_for_call_dummy)
|
|
|
|
|
(set_momentary_breakpoint): Adjust to use global IDs.
|
|
|
|
|
(find_condition_and_thread, watch_command_1): Use parse_thread_id.
|
|
|
|
|
(until_break_command, longjmp_bkpt_dtor)
|
|
|
|
|
(breakpoint_re_set_thread, insert_single_step_breakpoint): Adjust
|
|
|
|
|
to use global IDs.
|
|
|
|
|
* dummy-frame.c (pop_dummy_frame_bpt): Adjust to use
|
|
|
|
|
ptid_to_global_thread_id.
|
|
|
|
|
* elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
|
|
|
|
|
* gdbthread.h (struct thread_info): Rename field 'num' to
|
|
|
|
|
'global_num. Add new fields 'per_inf_num' and 'inf'.
|
|
|
|
|
(thread_id_to_pid): Rename thread_id_to_pid to
|
|
|
|
|
global_thread_id_to_ptid.
|
|
|
|
|
(pid_to_thread_id): Rename to ...
|
|
|
|
|
(ptid_to_global_thread_id): ... this.
|
|
|
|
|
(valid_thread_id): Rename to ...
|
|
|
|
|
(valid_global_thread_id): ... this.
|
|
|
|
|
(find_thread_id): Rename to ...
|
|
|
|
|
(find_thread_global_id): ... this.
|
|
|
|
|
(ALL_THREADS, ALL_THREADS_BY_INFERIOR): Declare.
|
|
|
|
|
(print_thread_info): Add comment.
|
|
|
|
|
* tid-parse.h: New file.
|
|
|
|
|
* tid-parse.c: New file.
|
|
|
|
|
* infcmd.c (step_command_fsm_prepare)
|
|
|
|
|
(step_command_fsm_should_stop): Adjust to use the global thread
|
|
|
|
|
ID.
|
|
|
|
|
(until_next_command, until_next_command)
|
|
|
|
|
(finish_command_fsm_should_stop): Adjust to use the global thread
|
|
|
|
|
ID.
|
|
|
|
|
(attach_post_wait): Adjust to check the inferior number too.
|
|
|
|
|
* inferior.h (struct inferior) <highest_thread_num>: New field.
|
|
|
|
|
* infrun.c (handle_signal_stop)
|
|
|
|
|
(insert_exception_resume_breakpoint)
|
|
|
|
|
(insert_exception_resume_from_probe): Adjust to use the global
|
|
|
|
|
thread ID.
|
|
|
|
|
* record-btrace.c (record_btrace_open): Use global thread IDs.
|
|
|
|
|
* remote.c (process_initial_stop_replies): Also consider the
|
|
|
|
|
inferior number.
|
|
|
|
|
* target.c (target_pre_inferior): Clear the inferior's highest
|
|
|
|
|
thread num.
|
|
|
|
|
* thread.c (clear_thread_inferior_resources): Adjust to use the
|
|
|
|
|
global thread ID.
|
|
|
|
|
(new_thread): New inferior parameter. Adjust to use it. Set both
|
|
|
|
|
the thread's global ID and the thread's per-inferior ID.
|
|
|
|
|
(add_thread_silent): Adjust.
|
|
|
|
|
(find_thread_global_id): New.
|
|
|
|
|
(find_thread_id): Make static. Adjust to rename.
|
|
|
|
|
(valid_thread_id): Rename to ...
|
|
|
|
|
(valid_global_thread_id): ... this.
|
|
|
|
|
(pid_to_thread_id): Rename to ...
|
|
|
|
|
(ptid_to_global_thread_id): ... this.
|
|
|
|
|
(thread_id_to_pid): Rename to ...
|
|
|
|
|
(global_thread_id_to_ptid): ... this. Adjust.
|
|
|
|
|
(first_thread_of_process): Adjust.
|
|
|
|
|
(do_captured_list_thread_ids): Adjust to use global thread IDs.
|
|
|
|
|
(should_print_thread): New function.
|
|
|
|
|
(print_thread_info): Rename to ...
|
|
|
|
|
(print_thread_info_1): ... this, and add new show_global_ids
|
|
|
|
|
parameter. Handle it. Iterate over inferiors.
|
|
|
|
|
(print_thread_info): Reimplement as wrapper around
|
|
|
|
|
print_thread_info_1.
|
|
|
|
|
(show_inferior_qualified_tids): New function.
|
|
|
|
|
(print_thread_id): Use it.
|
|
|
|
|
(tp_array_compar): Compare inferior numbers too.
|
|
|
|
|
(thread_apply_command): Use tid_range_parser.
|
|
|
|
|
(do_captured_thread_select): Use parse_thread_id.
|
|
|
|
|
(thread_id_make_value): Adjust.
|
|
|
|
|
(_initialize_thread): Adjust "info threads" help string.
|
|
|
|
|
* varobj.c (struct varobj_root): Update comment.
|
|
|
|
|
(varobj_create): Adjust to use global thread IDs.
|
|
|
|
|
(value_of_root_1): Adjust to use global_thread_id_to_ptid.
|
|
|
|
|
* windows-tdep.c (display_tib): No longer accept an argument.
|
|
|
|
|
* cli/cli-utils.c (get_number_trailer): Make extern.
|
|
|
|
|
* cli/cli-utils.h (get_number_trailer): Declare.
|
|
|
|
|
(get_number_const): Adjust documentation.
|
|
|
|
|
* mi/mi-cmd-var.c (mi_cmd_var_update_iter): Adjust to use global
|
|
|
|
|
thread IDs.
|
|
|
|
|
* mi/mi-interp.c (mi_new_thread, mi_thread_exit)
|
|
|
|
|
(mi_on_normal_stop, mi_output_running_pid, mi_on_resume):
|
|
|
|
|
* mi/mi-main.c (mi_execute_command, mi_cmd_execute): Likewise.
|
|
|
|
|
* guile/scm-breakpoint.c (gdbscm_set_breakpoint_thread_x):
|
|
|
|
|
Likewise.
|
|
|
|
|
* python/py-breakpoint.c (bppy_set_thread): Likewise.
|
|
|
|
|
* python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
|
|
|
|
|
* python/py-infthread.c (thpy_get_num): Add comment and return the
|
|
|
|
|
per-inferior thread ID.
|
|
|
|
|
(thread_object_getset): Update comment of "num".
|
|
|
|
|
|
Centralize thread ID printing
Add a new function to print a thread ID, in the style of paddress,
plongest, etc. and adjust all CLI-reachable paths to use it.
This gives us a single place to tweak to print inferior-qualified
thread IDs later:
- [Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 8155))]
+ [Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))]
etc., though for now, this has no user-visible change.
No regressions on x86_64 Fedora 20.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* breakpoint.c (remove_threaded_breakpoints)
(print_one_breakpoint_location): Use print_thread_id.
* btrace.c (btrace_enable, btrace_disable, btrace_teardown)
(btrace_fetch, btrace_clear): Use print_thread_id.
* common/print-utils.c (CELLSIZE): Delete.
(get_cell): Rename to ...
(get_print_cell): ... this and made extern. Adjust call callers.
Adjust to use PRINT_CELL_SIZE.
* common/print-utils.h (get_print_cell): Declare.
(PRINT_CELL_SIZE): New.
* gdbthread.h (print_thread_id): Declare.
* infcmd.c (signal_command): Use print_thread_id.
* inferior.c (print_inferior): Use print_thread_id.
* infrun.c (handle_signal_stop)
(insert_exception_resume_breakpoint)
(insert_exception_resume_from_probe)
(print_signal_received_reason): Use print_thread_id.
* record-btrace.c (record_btrace_info)
(record_btrace_resume_thread, record_btrace_cancel_resume)
(record_btrace_step_thread, record_btrace_wait): Use
print_thread_id.
* thread.c (thread_apply_all_command): Use print_thread_id.
(print_thread_id): New function.
(thread_apply_command): Use print_thread_id.
(thread_command, thread_find_command, do_captured_thread_select):
Use print_thread_id.
2016-01-13 10:56:06 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (remove_threaded_breakpoints)
|
|
|
|
|
(print_one_breakpoint_location): Use print_thread_id.
|
|
|
|
|
* btrace.c (btrace_enable, btrace_disable, btrace_teardown)
|
|
|
|
|
(btrace_fetch, btrace_clear): Use print_thread_id.
|
|
|
|
|
* common/print-utils.c (CELLSIZE): Delete.
|
|
|
|
|
(get_cell): Rename to ...
|
|
|
|
|
(get_print_cell): ... this and made extern. Adjust call callers.
|
|
|
|
|
Adjust to use PRINT_CELL_SIZE.
|
|
|
|
|
* common/print-utils.h (get_print_cell): Declare.
|
|
|
|
|
(PRINT_CELL_SIZE): New.
|
|
|
|
|
* gdbthread.h (print_thread_id): Declare.
|
|
|
|
|
* infcmd.c (signal_command): Use print_thread_id.
|
|
|
|
|
* inferior.c (print_inferior): Use print_thread_id.
|
|
|
|
|
* infrun.c (handle_signal_stop)
|
|
|
|
|
(insert_exception_resume_breakpoint)
|
|
|
|
|
(insert_exception_resume_from_probe)
|
|
|
|
|
(print_signal_received_reason): Use print_thread_id.
|
|
|
|
|
* record-btrace.c (record_btrace_info)
|
|
|
|
|
(record_btrace_resume_thread, record_btrace_cancel_resume)
|
|
|
|
|
(record_btrace_step_thread, record_btrace_wait): Use
|
|
|
|
|
print_thread_id.
|
|
|
|
|
* thread.c (thread_apply_all_command): Use print_thread_id.
|
|
|
|
|
(print_thread_id): New function.
|
|
|
|
|
(thread_apply_command): Use print_thread_id.
|
|
|
|
|
(thread_command, thread_find_command, do_captured_thread_select):
|
|
|
|
|
Use print_thread_id.
|
|
|
|
|
|
2016-01-13 10:56:06 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention InferiorThread.inferior.
|
|
|
|
|
* python/py-infthread.c (thpy_get_inferior): New.
|
|
|
|
|
(thread_object_getset): Register "inferior".
|
|
|
|
|
|
2016-01-13 10:56:05 +00:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention $_inferior.
|
|
|
|
|
* inferior.c (inferior_id_make_value): New.
|
|
|
|
|
(inferior_funcs): New.
|
|
|
|
|
(_initialize_inferior): Create $_inferior variable.
|
|
|
|
|
|
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 10:40:33 +00: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 20:27:27 +00: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 16:29:30 +00: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 15:18:09 +00: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 15:03:11 +00:00
|
|
|
|
2016-01-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Remove use of the registered trademark symbol throughout.
|
|
|
|
|
|
2016-01-12 11:53:09 +00:00
|
|
|
|
2016-01-12 Thomas Schwinge <thomas@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* reply_mig_hack.awk: Rewrite one regular expression.
|
|
|
|
|
|
2016-01-07 11:06:04 +00: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 11:06:00 +00: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 19:12:44 +00: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 15:03:41 +00: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 04:23:52 +00:00
|
|
|
|
2016-01-05 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* version.in: Change cvs to git.
|
|
|
|
|
|
2016-01-02 08:11:44 +00:00
|
|
|
|
2016-01-05 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* configure.tgt (score-*-*): Delete gdb_sim assignment.
|
|
|
|
|
|
2016-01-05 11:03:40 +00: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 11:12:31 +00:00
|
|
|
|
* rs6000-tdep.c (init_sim_regno_table): Check WITH_PPC_SIM instead
|
|
|
|
|
of WITH_SIM.
|
2016-01-05 11:03:40 +00:00
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
|
2015-12-23 12:53:53 +00: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 08:10:57 +00:00
|
|
|
|
2016-01-02 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* configure.tgt (powerpc*-*-*): Delete test call and
|
|
|
|
|
always assign gdb_sim.
|
|
|
|
|
|
2016-01-01 04:33:14 +00:00
|
|
|
|
2016-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
Update year range in copyright notice of all files.
|
|
|
|
|
|
2016-01-01 04:22:36 +00:00
|
|
|
|
2016-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* top.c (print_gdb_version): Change copyright year in version
|
|
|
|
|
message.
|
|
|
|
|
|
2016-01-01 04:19:16 +00: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 14:21:01 +00:00
|
|
|
|
|
2016-01-01 04:19:16 +00: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 14:21:01 +00:00
|
|
|
|
|
2016-01-01 04:19:16 +00:00
|
|
|
|
For older changes see ChangeLog-2015.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: change-log
|
|
|
|
|
left-margin: 8
|
|
|
|
|
fill-column: 74
|
|
|
|
|
version-control: never
|
2007-08-09 22:44:38 +00:00
|
|
|
|
coding: utf-8
|
1999-04-16 01:35:26 +00:00
|
|
|
|
End:
|