Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Jan Kratochvil | bd25032818 | |
Jan Kratochvil | c9f15e7e6f | |
Jan Kratochvil | cb41b4a7cb |
|
@ -0,0 +1,344 @@
|
|||
Regression: gdb --pid $(pidof qemu-system-x86_64) stopped working with gdb 7.11.1
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1375553
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2016-09/msg00387.html
|
||||
Subject: [patch+7.12] PR gdb/20609 - attach of JIT-debug-enabled inf 7.11.1 regression
|
||||
|
||||
|
||||
--cNdxnHkX5QqsyA0e
|
||||
Content-Type: text/plain; charset=us-ascii
|
||||
Content-Disposition: inline
|
||||
|
||||
Hi,
|
||||
|
||||
Regression: gdb --pid $(pidof qemu-system-x86_64) stopped working with gdb 7.11.1
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=20609
|
||||
|
||||
It was reported for qemu-system-x86_64 but it happens for any multithreaded
|
||||
inferior with a JIT debugging hook.
|
||||
|
||||
136613ef0c6850427317e57be1b644080ff6decb is the first bad commit
|
||||
Author: Pedro Alves <palves@redhat.com>
|
||||
Fix PR gdb/19828: gdb -p <process from a container>: internal error
|
||||
Message-ID: <cbdf2e04-4fa8-872a-2a23-08c9c1b26e00@redhat.com>
|
||||
https://sourceware.org/ml/gdb-patches/2016-05/msg00450.html
|
||||
|
||||
jit_breakpoint_re_set() is specific by trying to insert a breakpoint into the
|
||||
main executable, not into a shared library. During attachment GDB thinks it
|
||||
needs to use 'breakpoint always-inserted' from
|
||||
breakpoints_should_be_inserted_now() as a newly attached thread is
|
||||
'thread_info->executing' due to 'lwp_info->must_set_ptrace_flags' enabled and
|
||||
the task not yet stopped. This did not happen before the 'bad commit' above
|
||||
which adds tracking of such thread.
|
||||
|
||||
GDB then fails to insert the breakpoints to invalid address as PIE executable
|
||||
gets properly relocated during later phase of attachment. One can see in the
|
||||
backtraces below:
|
||||
#11 in setup_inferior (from_tty=0) at infcmd.c:2663
|
||||
-> jit_breakpoint_re_set_internal()
|
||||
later:
|
||||
#5 in setup_inferior (from_tty=0) at infcmd.c:2673
|
||||
-> svr4_exec_displacement()
|
||||
|
||||
One can suppress the initial breakpoint_re_set() call as there will be another
|
||||
breakpoint_re_set() done from the final post_create_inferior() call in
|
||||
setup_inferior().
|
||||
|
||||
BTW additionally 'threads_executing' cache bool is somehow stale (somewhere is
|
||||
missing update_threads_executing()). I was trying to deal with that in my
|
||||
first/second attempt below but in my final third attempt (attached) I have
|
||||
left it as it is.
|
||||
|
||||
First attempt trying not to falsely require 'breakpoint always-inserted':
|
||||
https://people.redhat.com/jkratoch/rhbz1375553-fix1.patch
|
||||
Reduced first attempt:
|
||||
https://people.redhat.com/jkratoch/rhbz1375553-fix2.patch
|
||||
|
||||
The third attempt suppresses breakpoint insertion until PIE executable gets
|
||||
relocated by svr4_exec_displacement(). Attached.
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora26pre-linux-gnu.
|
||||
|
||||
OK for check-in for trunk + 7.12?
|
||||
|
||||
|
||||
Jan
|
||||
|
||||
|
||||
#0 jit_breakpoint_re_set_internal (gdbarch=0x25befe0, ps_data=0x23b37e0) at jit.c:1045
|
||||
#1 in jit_breakpoint_re_set () at jit.c:1408
|
||||
#2 in breakpoint_re_set () at breakpoint.c:14665
|
||||
#3 in clear_symtab_users (add_flags=4) at symfile.c:2970
|
||||
#4 in finish_new_objfile (objfile=0x25b6d10, add_flags=4) at symfile.c:1109
|
||||
#5 in symbol_file_add_with_addrs (abfd=0x25b4bd0, name=0x25b3970 "/tmp/a.out", add_flags=4, addrs=0x0, flags=0, parent=0x0) at symfile.c:1233
|
||||
#6 in symbol_file_add_from_bfd (abfd=0x25b4bd0, name=0x25b3970 "/tmp/a.out", add_flags=4, addrs=0x0, flags=0, parent=0x0) at symfile.c:1276
|
||||
#7 in symbol_file_add (name=0x25b3970 "/tmp/a.out", add_flags=4, addrs=0x0, flags=0) at symfile.c:1290
|
||||
#8 in symbol_file_add_main_1 (args=0x25b3970 "/tmp/a.out", from_tty=0, flags=0) at symfile.c:1315
|
||||
#9 in symbol_file_add_main (args=0x25b3970 "/tmp/a.out", from_tty=0) at symfile.c:1306
|
||||
#10 in exec_file_locate_attach (pid=2502, from_tty=0) at exec.c:235
|
||||
#11 in setup_inferior (from_tty=0) at infcmd.c:2663
|
||||
#12 in stop_all_threads () at infrun.c:4630
|
||||
#13 in stop_waiting (ecs=0x7fffffffd400) at infrun.c:7710
|
||||
#14 in handle_signal_stop (ecs=0x7fffffffd400) at infrun.c:5765
|
||||
#15 in handle_inferior_event_1 (ecs=0x7fffffffd400) at infrun.c:5395
|
||||
#16 in handle_inferior_event (ecs=0x7fffffffd400) at infrun.c:5426
|
||||
#17 in fetch_inferior_event (client_data=0x0) at infrun.c:3972
|
||||
#18 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at inf-loop.c:44
|
||||
#19 in handle_target_event (error=0, client_data=0x0) at linux-nat.c:4523
|
||||
#20 in handle_file_event (file_ptr=0x25ad330, ready_mask=1) at event-loop.c:733
|
||||
#21 in gdb_wait_for_event (block=0) at event-loop.c:859
|
||||
#22 in gdb_do_one_event () at event-loop.c:322
|
||||
#23 in wait_sync_command_done () at top.c:568
|
||||
#24 in maybe_wait_sync_command_done (was_sync=0) at top.c:587
|
||||
#25 in catch_command_errors (command=0x745e0c <attach_command(char*, int)>, arg=0x7fffffffdd08 "2502", from_tty=1) at main.c:377
|
||||
#26 in captured_main (data=0x7fffffffd800) at main.c:1065
|
||||
#27 in gdb_main (args=0x7fffffffd800) at main.c:1159
|
||||
#28 in main (argc=10, argv=0x7fffffffd908) at gdb.c:32
|
||||
|
||||
#0 svr4_exec_displacement (displacementp=0x7fffffffced0) at solib-svr4.c:2634
|
||||
#1 in svr4_relocate_main_executable () at solib-svr4.c:3031
|
||||
#2 in svr4_solib_create_inferior_hook (from_tty=0) at solib-svr4.c:3092
|
||||
#3 in solib_create_inferior_hook (from_tty=0) at solib.c:1276
|
||||
#4 in post_create_inferior (target=0x21ee980 <current_target>, from_tty=0) at infcmd.c:445
|
||||
#5 in setup_inferior (from_tty=0) at infcmd.c:2673
|
||||
#6 in stop_all_threads () at infrun.c:4630
|
||||
#7 in stop_waiting (ecs=0x7fffffffd400) at infrun.c:7710
|
||||
#8 in handle_signal_stop (ecs=0x7fffffffd400) at infrun.c:5765
|
||||
#9 in handle_inferior_event_1 (ecs=0x7fffffffd400) at infrun.c:5395
|
||||
#10 in handle_inferior_event (ecs=0x7fffffffd400) at infrun.c:5426
|
||||
#11 in fetch_inferior_event (client_data=0x0) at infrun.c:3972
|
||||
#12 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at inf-loop.c:44
|
||||
#13 in handle_target_event (error=0, client_data=0x0) at linux-nat.c:4523
|
||||
#14 in handle_file_event (file_ptr=0x25ad330, ready_mask=1) at event-loop.c:733
|
||||
#15 in gdb_wait_for_event (block=0) at event-loop.c:859
|
||||
#16 in gdb_do_one_event () at event-loop.c:322
|
||||
#17 in wait_sync_command_done () at top.c:568
|
||||
#18 in maybe_wait_sync_command_done (was_sync=0) at top.c:587
|
||||
#19 in catch_command_errors (command=0x745e0c <attach_command(char*, int)>, arg=0x7fffffffdd08 "2502", from_tty=1) at main.c:377
|
||||
#20 in captured_main (data=0x7fffffffd800) at main.c:1065
|
||||
#21 in gdb_main (args=0x7fffffffd800) at main.c:1159
|
||||
#22 in main (argc=10, argv=0x7fffffffd908) at gdb.c:32
|
||||
|
||||
--cNdxnHkX5QqsyA0e
|
||||
Content-Type: text/plain; charset=us-ascii
|
||||
Content-Disposition: inline; filename="jitbp.patch"
|
||||
|
||||
gdb/ChangeLog
|
||||
2016-09-27 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
PR gdb/20609 - attach of JIT-debug-enabled inf 7.11.1 regression
|
||||
* exec.c (exec_file_locate_attach): Add parameter defer_bp_reset.
|
||||
Use it.
|
||||
* gdbcore.h (exec_file_locate_attach): Add parameter defer_bp_reset.
|
||||
* infcmd.c (setup_inferior): Update caller.
|
||||
* remote.c (remote_add_inferior): Likewise.
|
||||
|
||||
gdb/testsuite/ChangeLog
|
||||
2016-09-27 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
PR gdb/20609 - attach of JIT-debug-enabled inf 7.11.1 regression
|
||||
* gdb.base/jit-attach-pie.c: New file.
|
||||
* gdb.base/jit-attach-pie.exp: New file.
|
||||
|
||||
--- gdb-7.11.1/gdb/exec.c.orig 2016-09-28 17:39:52.643188481 +0200
|
||||
+++ gdb-7.11.1/gdb/exec.c 2016-09-28 17:41:43.507148039 +0200
|
||||
@@ -139,7 +139,7 @@ exec_file_clear (int from_tty)
|
||||
/* See gdbcore.h. */
|
||||
|
||||
void
|
||||
-exec_file_locate_attach (int pid, int from_tty)
|
||||
+exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty)
|
||||
{
|
||||
char *exec_file, *full_exec_path = NULL;
|
||||
|
||||
@@ -172,7 +172,22 @@ exec_file_locate_attach (int pid, int fr
|
||||
}
|
||||
|
||||
exec_file_attach (full_exec_path, from_tty);
|
||||
- symbol_file_add_main (full_exec_path, from_tty);
|
||||
+
|
||||
+ TRY
|
||||
+ {
|
||||
+ if (defer_bp_reset)
|
||||
+ current_inferior ()->symfile_flags |= SYMFILE_DEFER_BP_RESET;
|
||||
+ symbol_file_add_main (full_exec_path, from_tty);
|
||||
+ }
|
||||
+ CATCH (e, RETURN_MASK_ALL)
|
||||
+ {
|
||||
+ if (defer_bp_reset)
|
||||
+ current_inferior ()->symfile_flags &= ~SYMFILE_DEFER_BP_RESET;
|
||||
+ throw_exception (e);
|
||||
+ }
|
||||
+ END_CATCH
|
||||
+ if (defer_bp_reset)
|
||||
+ current_inferior ()->symfile_flags &= ~SYMFILE_DEFER_BP_RESET;
|
||||
}
|
||||
|
||||
/* Set FILENAME as the new exec file.
|
||||
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
|
||||
index 8b101bc..6aa9afa 100644
|
||||
--- a/gdb/gdbcore.h
|
||||
+++ b/gdb/gdbcore.h
|
||||
@@ -154,9 +154,10 @@ extern void exec_file_attach (const char *filename, int from_tty);
|
||||
/* If the filename of the main executable is unknown, attempt to
|
||||
determine it. If a filename is determined, proceed as though
|
||||
it was just specified with the "file" command. Do nothing if
|
||||
- the filename of the main executable is already known. */
|
||||
+ the filename of the main executable is already known.
|
||||
+ DEFER_BP_RESET uses SYMFILE_DEFER_BP_RESET for the main symbol file. */
|
||||
|
||||
-extern void exec_file_locate_attach (int pid, int from_tty);
|
||||
+extern void exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty);
|
||||
|
||||
extern void exec_file_clear (int from_tty);
|
||||
|
||||
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
|
||||
index 44a1fd1..8e34b7e 100644
|
||||
--- a/gdb/infcmd.c
|
||||
+++ b/gdb/infcmd.c
|
||||
@@ -2660,7 +2660,7 @@ setup_inferior (int from_tty)
|
||||
/* If no exec file is yet known, try to determine it from the
|
||||
process itself. */
|
||||
if (get_exec_file (0) == NULL)
|
||||
- exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
|
||||
+ exec_file_locate_attach (ptid_get_pid (inferior_ptid), 1, from_tty);
|
||||
else
|
||||
{
|
||||
reopen_exec_file ();
|
||||
diff --git a/gdb/remote.c b/gdb/remote.c
|
||||
index 910ac81..b460bb1 100644
|
||||
--- a/gdb/remote.c
|
||||
+++ b/gdb/remote.c
|
||||
@@ -1799,7 +1799,7 @@ remote_add_inferior (int fake_pid_p, int pid, int attached,
|
||||
/* If no main executable is currently open then attempt to
|
||||
open the file that was executed to create this inferior. */
|
||||
if (try_open_exec && get_exec_file (0) == NULL)
|
||||
- exec_file_locate_attach (pid, 1);
|
||||
+ exec_file_locate_attach (pid, 0, 1);
|
||||
|
||||
return inf;
|
||||
}
|
||||
diff --git a/gdb/testsuite/gdb.base/jit-attach-pie.c b/gdb/testsuite/gdb.base/jit-attach-pie.c
|
||||
new file mode 100644
|
||||
index 0000000..5080bde
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/jit-attach-pie.c
|
||||
@@ -0,0 +1,61 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2016 Free Software Foundation, Inc.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify
|
||||
+ it under the terms of the GNU General Public License as published by
|
||||
+ the Free Software Foundation; either version 3 of the License, or
|
||||
+ (at your option) any later version.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ GNU General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License
|
||||
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+#include <stdint.h>
|
||||
+#include <pthread.h>
|
||||
+
|
||||
+struct jit_code_entry
|
||||
+{
|
||||
+ struct jit_code_entry *next_entry;
|
||||
+ struct jit_code_entry *prev_entry;
|
||||
+ const char *symfile_addr;
|
||||
+ uint64_t symfile_size;
|
||||
+};
|
||||
+
|
||||
+struct jit_descriptor
|
||||
+{
|
||||
+ uint32_t version;
|
||||
+ /* This type should be jit_actions_t, but we use uint32_t
|
||||
+ to be explicit about the bitwidth. */
|
||||
+ uint32_t action_flag;
|
||||
+ struct jit_code_entry *relevant_entry;
|
||||
+ struct jit_code_entry *first_entry;
|
||||
+};
|
||||
+
|
||||
+struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
|
||||
+
|
||||
+void __jit_debug_register_code()
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static void *
|
||||
+thread_proc (void *arg)
|
||||
+{
|
||||
+ sleep (60);
|
||||
+ return arg;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+main (void)
|
||||
+{
|
||||
+ pthread_t thread;
|
||||
+
|
||||
+ pthread_create (&thread, NULL, thread_proc, 0);
|
||||
+ pthread_join (thread, NULL);
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/gdb/testsuite/gdb.base/jit-attach-pie.exp b/gdb/testsuite/gdb.base/jit-attach-pie.exp
|
||||
new file mode 100644
|
||||
index 0000000..2c25733
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/jit-attach-pie.exp
|
||||
@@ -0,0 +1,48 @@
|
||||
+# Copyright (C) 2016 Free Software Foundation, Inc.
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License
|
||||
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+if {![can_spawn_for_attach]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+standard_testfile .c
|
||||
+set executable ${testfile}
|
||||
+
|
||||
+if { [build_executable ${testfile}.exp $executable $srcfile \
|
||||
+ [list debug pthreads "additional_flags=-fPIE -pie"]] } {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+# Start the program running and then wait for a bit, to be sure
|
||||
+# that it can be attached to.
|
||||
+
|
||||
+set test_spawn_id [spawn_wait_for_attach $binfile]
|
||||
+set testpid [spawn_id_get_pid $test_spawn_id]
|
||||
+
|
||||
+# gdb_load ("file" command) must not be executed for the bug reproducibility.
|
||||
+# That includes prepare_for_testing or clean_restart.
|
||||
+gdb_start
|
||||
+
|
||||
+set test "attach"
|
||||
+gdb_test_multiple "attach $testpid" $test {
|
||||
+ -re "Attaching to process $testpid\r\n.*Cannot insert breakpoint .*\r\n$gdb_prompt $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+ -re "Attaching to process $testpid\r\n.*\r\n$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+kill_wait_spawned_process $test_spawn_id
|
||||
|
||||
--cNdxnHkX5QqsyA0e--
|
||||
|
|
@ -0,0 +1,317 @@
|
|||
commit 754653a7c0a43a668a38aa30c4063b9e292a19f9
|
||||
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
Date: Thu Aug 25 08:42:03 2016 +0100
|
||||
|
||||
Sync proc_service definition with GLIBC
|
||||
|
||||
GLIBC BZ#20311 [1] proc_service.h install patch also remove 'const'
|
||||
attributes from ps_get_thread_area and comment #15 discuss why to remove
|
||||
the const attribute (basically since it a callback with the struct
|
||||
ps_prochandle owned by the client it should be able to modify it if
|
||||
it the case).
|
||||
|
||||
On default build this is not the issue and current g++ does not trigger
|
||||
any issue with this mismatch declaration. However, on some bootstrap
|
||||
build configuration where gdbserver is build with gcc instead this
|
||||
triggers:
|
||||
|
||||
error: conflicting types for 'ps_get_thread_area'
|
||||
|
||||
This patch fixes it by syncing the declaration with GLIBC.
|
||||
|
||||
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=20311
|
||||
|
||||
gdb/ChangeLog:
|
||||
|
||||
2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
|
||||
* aarch64-linux-nat.c (ps_get_thread_area): Remove const from
|
||||
struct ps_prochandle.
|
||||
* amd64-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
* arm-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
* gdb_proc_service.h (ps_get_thread_area): Likewise.
|
||||
* i386-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
* m68klinux-nat.c (ps_get_thread_area): Likewise.
|
||||
* mips-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
* nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise.
|
||||
* nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise.
|
||||
* xtensa-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
|
||||
gdb/gdbserver/ChangeLog:
|
||||
|
||||
2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
|
||||
PR server/20491
|
||||
* gdb_proc_service.h (ps_get_thread_area): Remove const from struct
|
||||
ps_prochandle.
|
||||
* linux-aarch64-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-arm-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-crisv32-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-m68k-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-mips-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-nios2-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-tic6x-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-x86-low.c (ps_get_thread_area): Likewise.
|
||||
* linux-xtensa-low.c (ps_get_thread_area): Likewise.
|
||||
|
||||
### a/gdb/ChangeLog
|
||||
### b/gdb/ChangeLog
|
||||
## -1,3 +1,17 @@
|
||||
+2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
+
|
||||
+ * aarch64-linux-nat.c (ps_get_thread_area): Remove const from
|
||||
+ struct ps_prochandle.
|
||||
+ * amd64-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
+ * arm-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
+ * gdb_proc_service.h (ps_get_thread_area): Likewise.
|
||||
+ * i386-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
+ * m68klinux-nat.c (ps_get_thread_area): Likewise.
|
||||
+ * mips-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
+ * nat/aarch64-linux.c (aarch64_ps_get_thread_area): Likewise.
|
||||
+ * nat/aarch64-linux.h (aarch64_ps_get_thread_area): Likewise.
|
||||
+ * xtensa-linux-nat.c (ps_get_thread_area): Likewise.
|
||||
+
|
||||
2016-08-24 Simon Marchi <simon.marchi@ericsson.com>
|
||||
|
||||
* infcmd.c (set_inferior_io_terminal): Set inferior terminal to
|
||||
--- a/gdb/aarch64-linux-nat.c
|
||||
+++ b/gdb/aarch64-linux-nat.c
|
||||
@@ -457,7 +457,7 @@ aarch64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
|
||||
storage (or its descriptor). */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
int is_64bit_p
|
||||
--- a/gdb/amd64-linux-nat.c
|
||||
+++ b/gdb/amd64-linux-nat.c
|
||||
@@ -245,7 +245,7 @@ amd64_linux_store_inferior_registers (struct target_ops *ops,
|
||||
a request for a thread's local storage address. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (gdbarch_bfd_arch_info (target_gdbarch ())->bits_per_word == 32)
|
||||
--- a/gdb/arm-linux-nat.c
|
||||
+++ b/gdb/arm-linux-nat.c
|
||||
@@ -477,7 +477,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdb_proc_service.h
|
||||
+++ b/gdb/gdb_proc_service.h
|
||||
@@ -124,7 +124,7 @@ extern pid_t ps_getpid (struct ps_prochandle *);
|
||||
/* Fetch the special per-thread address associated with the given LWP.
|
||||
This call is only used on a few platforms (most use a normal register).
|
||||
The meaning of the `int' parameter is machine-dependent. */
|
||||
-extern ps_err_e ps_get_thread_area (const struct ps_prochandle *,
|
||||
+extern ps_err_e ps_get_thread_area (struct ps_prochandle *,
|
||||
lwpid_t, int, psaddr_t *);
|
||||
|
||||
|
||||
### a/gdb/gdbserver/ChangeLog
|
||||
### b/gdb/gdbserver/ChangeLog
|
||||
## -1,3 +1,18 @@
|
||||
+2016-08-25 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
+
|
||||
+ PR server/20491
|
||||
+ * gdb_proc_service.h (ps_get_thread_area): Remove const from struct
|
||||
+ ps_prochandle.
|
||||
+ * linux-aarch64-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-arm-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-crisv32-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-m68k-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-mips-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-nios2-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-tic6x-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-x86-low.c (ps_get_thread_area): Likewise.
|
||||
+ * linux-xtensa-low.c (ps_get_thread_area): Likewise.
|
||||
+
|
||||
2016-08-19 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* linux-x86-low.c (amd64_emit_call): Emit missing call opcode.
|
||||
--- a/gdb/gdbserver/gdb_proc_service.h
|
||||
+++ b/gdb/gdbserver/gdb_proc_service.h
|
||||
@@ -107,7 +107,7 @@ extern pid_t ps_getpid (struct ps_prochandle *);
|
||||
/* Fetch the special per-thread address associated with the given LWP.
|
||||
This call is only used on a few platforms (most use a normal register).
|
||||
The meaning of the `int' parameter is machine-dependent. */
|
||||
-extern ps_err_e ps_get_thread_area (const struct ps_prochandle *,
|
||||
+extern ps_err_e ps_get_thread_area (struct ps_prochandle *,
|
||||
lwpid_t, int, psaddr_t *);
|
||||
|
||||
|
||||
--- a/gdb/gdbserver/linux-aarch64-low.c
|
||||
+++ b/gdb/gdbserver/linux-aarch64-low.c
|
||||
@@ -401,7 +401,7 @@ aarch64_stopped_by_watchpoint (void)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
return aarch64_ps_get_thread_area (ph, lwpid, idx, base,
|
||||
--- a/gdb/gdbserver/linux-arm-low.c
|
||||
+++ b/gdb/gdbserver/linux-arm-low.c
|
||||
@@ -270,7 +270,7 @@ get_next_pcs_read_memory_unsigned_integer (CORE_ADDR memaddr,
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdbserver/linux-crisv32-low.c
|
||||
+++ b/gdb/gdbserver/linux-crisv32-low.c
|
||||
@@ -309,7 +309,7 @@ cris_stopped_data_address (void)
|
||||
}
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdbserver/linux-m68k-low.c
|
||||
+++ b/gdb/gdbserver/linux-m68k-low.c
|
||||
@@ -152,7 +152,7 @@ m68k_breakpoint_at (CORE_ADDR pc)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdbserver/linux-mips-low.c
|
||||
+++ b/gdb/gdbserver/linux-mips-low.c
|
||||
@@ -637,7 +637,7 @@ mips_stopped_data_address (void)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdbserver/linux-nios2-low.c
|
||||
+++ b/gdb/gdbserver/linux-nios2-low.c
|
||||
@@ -145,7 +145,7 @@ nios2_breakpoint_at (CORE_ADDR where)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdbserver/linux-tic6x-low.c
|
||||
+++ b/gdb/gdbserver/linux-tic6x-low.c
|
||||
@@ -274,7 +274,7 @@ tic6x_breakpoint_at (CORE_ADDR where)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/gdbserver/linux-x86-low.c
|
||||
+++ b/gdb/gdbserver/linux-x86-low.c
|
||||
@@ -186,7 +186,7 @@ is_64bit_tdesc (void)
|
||||
/* Called by libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
--- a/gdb/gdbserver/linux-xtensa-low.c
|
||||
+++ b/gdb/gdbserver/linux-xtensa-low.c
|
||||
@@ -177,7 +177,7 @@ xtensa_breakpoint_at (CORE_ADDR where)
|
||||
/* Called by libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
xtensa_elf_gregset_t regs;
|
||||
--- a/gdb/i386-linux-nat.c
|
||||
+++ b/gdb/i386-linux-nat.c
|
||||
@@ -603,7 +603,7 @@ i386_linux_store_inferior_registers (struct target_ops *ops,
|
||||
storage (or its descriptor). */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
unsigned int base_addr;
|
||||
--- a/gdb/m68klinux-nat.c
|
||||
+++ b/gdb/m68klinux-nat.c
|
||||
@@ -508,7 +508,7 @@ m68k_linux_store_inferior_registers (struct target_ops *ops,
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) < 0)
|
||||
--- a/gdb/mips-linux-nat.c
|
||||
+++ b/gdb/mips-linux-nat.c
|
||||
@@ -152,7 +152,7 @@ mips64_linux_register_addr (struct gdbarch *gdbarch, int regno, int store)
|
||||
/* Fetch the thread-local storage pointer for libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
--- a/gdb/nat/aarch64-linux.c
|
||||
+++ b/gdb/nat/aarch64-linux.c
|
||||
@@ -205,7 +205,7 @@ aarch64_siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
|
||||
storage (or its descriptor). */
|
||||
|
||||
ps_err_e
|
||||
-aarch64_ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+aarch64_ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base,
|
||||
int is_64bit_p)
|
||||
{
|
||||
--- a/gdb/nat/aarch64-linux.h
|
||||
+++ b/gdb/nat/aarch64-linux.h
|
||||
@@ -122,7 +122,7 @@ void aarch64_linux_prepare_to_resume (struct lwp_info *lwp);
|
||||
|
||||
void aarch64_linux_new_thread (struct lwp_info *lwp);
|
||||
|
||||
-ps_err_e aarch64_ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_err_e aarch64_ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base,
|
||||
int is_64bit_p);
|
||||
|
||||
--- a/gdb/xtensa-linux-nat.c
|
||||
+++ b/gdb/xtensa-linux-nat.c
|
||||
@@ -286,7 +286,7 @@ xtensa_linux_store_inferior_registers (struct target_ops *ops,
|
||||
/* Called by libthread_db. */
|
||||
|
||||
ps_err_e
|
||||
-ps_get_thread_area (const struct ps_prochandle *ph,
|
||||
+ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
xtensa_elf_gregset_t regs;
|
19
gdb.spec
19
gdb.spec
|
@ -27,7 +27,7 @@ Version: 7.11.1
|
|||
|
||||
# The release always contains a leading reserved number, start it at 1.
|
||||
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
|
||||
Release: 83%{?dist}
|
||||
Release: 86%{?dist}
|
||||
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
|
||||
Group: Development/Debuggers
|
||||
|
@ -246,7 +246,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
|||
|
||||
# Backported fixups post the source tarball.
|
||||
#Xdrop: Just backports.
|
||||
#Patch232: gdb-upstream.patch
|
||||
Patch232: gdb-upstream.patch
|
||||
|
||||
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
||||
#=fedoratest+ppc
|
||||
|
@ -586,6 +586,9 @@ Patch1141: gdb-rhbz1363635-aarch64-armv8182.patch
|
|||
# [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513).
|
||||
Patch1143: gdb-linux_perf-bundle.patch
|
||||
|
||||
# Fix attachment of JIT-debug-enabled inf. (7.11.1 regression, RH BZ 1375553).
|
||||
Patch1147: gdb-rhbz1375553-attach-jit-debug.patch
|
||||
|
||||
%if 0%{!?rhel:1} || 0%{?rhel} > 6
|
||||
# RL_STATE_FEDORA_GDB would not be found for:
|
||||
# Patch642: gdb-readline62-ask-more-rh.patch
|
||||
|
@ -787,7 +790,7 @@ find -name "*.info*"|xargs rm -f
|
|||
# Match the Fedora's version info.
|
||||
%patch2 -p1
|
||||
|
||||
#patch232 -p1
|
||||
%patch232 -p1
|
||||
%patch349 -p1
|
||||
%patch1058 -p1
|
||||
%patch1059 -p1
|
||||
|
@ -914,6 +917,7 @@ find -name "*.info*"|xargs rm -f
|
|||
%patch1129 -p1
|
||||
%patch1141 -p1
|
||||
%patch1143 -p1
|
||||
%patch1147 -p1
|
||||
|
||||
%patch1075 -p1
|
||||
%if 0%{?rhel:1} && 0%{?rhel} <= 7
|
||||
|
@ -1457,6 +1461,15 @@ then
|
|||
fi
|
||||
|
||||
%changelog
|
||||
* Wed Sep 28 2016 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.11.1-86.fc24
|
||||
- Fix#2 attachment of JIT-debug-enabled inf. (7.11.1 regression, RH BZ 1375553).
|
||||
|
||||
* Wed Sep 28 2016 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.11.1-85.fc24
|
||||
- Fix attachment of JIT-debug-enabled inf. (7.11.1 regression, RH BZ 1375553).
|
||||
|
||||
* Sun Aug 28 2016 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.11.1-84.fc24
|
||||
- Fix ps_get_thread_area compilation of gdb.f24 on Fedora 25+.
|
||||
|
||||
* Tue Aug 23 2016 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.11.1-83.fc24
|
||||
- [dts+el7] [x86*] Bundle libipt - fix#3 its initialization (RH BZ 1256513).
|
||||
|
||||
|
|
Loading…
Reference in New Issue