found 881569 8.1-2
thanks
On Mon, 2018-07-16 at 11:17 +0200, Hector Oron wrote:
> Hello,
>
> 2018-07-16 9:10 GMT+02:00 Svante Signell <svante.sign...@gmail.com>:
> > I found out too that gdb 8.1 still FTBFS on GNU/Hurd. Why did you
> > close
> > that bug without applying any of the patches supplied? The bug
> > report
> > was submitted in November last year for gdb version 8.0-1.
>
> I closed the bug, as your patchset was for old 8.0-1 version, which I
> _wrongly_ understood, it was backported from upstream 8.1, so 8.1
> would have compiled fine on GNU/Hurd and bug would have been closed.
>
> > I'm working on an updated patch-set hoping that you can apply when
> > submitted (and forward upstream).
>
> Probably, I am able to do releases more frequently now. Please
> checkout `debian/experimental` branch which is based on 8.1.90
> snapshot release and send MR in gitlab. Also, please let me know
> references when you submit patches upstream.
>
> Hopefully, we can get the build fixed sooner now, and apologies for
> any inconvenience.
Attached are the four patches needed to build gdb-8.1-2 on GNU/Hurd.
Since the patch struct_thread_info.patch clarifies the definition of
thread_info to struct thread_info, a test build was made on GNU/linux-
amd64. No problems :)
Submitting patches upstream and to 8.1.90 will follow shortly.
Thanks!
Index: gdb-8.1/gdb/configure.nat
===================================================================
--- gdb-8.1.orig/gdb/configure.nat
+++ gdb-8.1/gdb/configure.nat
@@ -209,7 +209,7 @@ case ${gdb_host} in
i386)
# Host: Intel 386 running the GNU Hurd
NATDEPFILES='i386-gnu-nat.o gnu-nat.o \
- x86-nat.o x86-dregs.o fork-child.o \
+ x86-nat.o x86-dregs.o fork-child.o fork-inferior.o \
notify_S.o process_reply_S.o msg_reply_S.o \
msg_U.o exc_request_U.o exc_request_S.o'
HAVE_NATIVE_GCORE_HOST=1
Index: gdb-8.1/gdb/remote.c
===================================================================
--- gdb-8.1.orig/gdb/remote.c
+++ gdb-8.1/gdb/remote.c
@@ -6884,7 +6884,7 @@ Packet: '%s'\n"),
else if (strprefix (p, p1, "exec"))
{
ULONGEST ignored;
- char pathname[PATH_MAX];
+ char *pathname = NULL;
int pathlen;
/* Determine the length of the execd pathname. */
@@ -6893,12 +6893,14 @@ Packet: '%s'\n"),
/* Save the pathname for event reporting and for
the next run command. */
+ pathname = (char *) xmalloc(pathlen + 1);
hex2bin (p1, (gdb_byte *) pathname, pathlen);
pathname[pathlen] = '\0';
/* This is freed during event handling. */
event->ws.value.execd_pathname = xstrdup (pathname);
event->ws.kind = TARGET_WAITKIND_EXECD;
+ xfree (pathname);
/* Skip the registers included in this packet, since
they may be for an architecture different from the
Index: gdb-8.1/gdb/gnu-nat.c
===================================================================
--- gdb-8.1.orig/gdb/gnu-nat.c
+++ gdb-8.1/gdb/gnu-nat.c
@@ -67,6 +67,7 @@ extern "C"
#include "gdb_obstack.h"
#include "tid-parse.h"
+#include "nat/fork-inferior.h"
#include "gnu-nat.h"
#include "inf-child.h"
@@ -1871,22 +1872,28 @@ S_proc_wait_reply (mach_port_t reply, ke
return 0;
}
+/* Note: The third argument to S_proc_getmsgport_reply, S_proc_task2proc_reply and
+ S_proc_pid2proc_reply is of type mach_port_poly_t. Look at gdb/process_reply_S.h
+ derived from process_reply.defs to find out the fourth argument */
+
ILL_RPC (S_proc_setmsgport_reply,
mach_port_t reply_port, kern_return_t return_code,
mach_port_t oldmsgport)
ILL_RPC (S_proc_getmsgport_reply,
mach_port_t reply_port, kern_return_t return_code,
- mach_port_t msgports)
+ mach_port_t msgports, mach_msg_type_name_t msgportsPoly)
ILL_RPC (S_proc_pid2task_reply,
mach_port_t reply_port, kern_return_t return_code, mach_port_t task)
ILL_RPC (S_proc_task2pid_reply,
mach_port_t reply_port, kern_return_t return_code, pid_t pid)
ILL_RPC (S_proc_task2proc_reply,
- mach_port_t reply_port, kern_return_t return_code, mach_port_t proc)
+ mach_port_t reply_port, kern_return_t return_code, mach_port_t proc,
+ mach_msg_type_name_t procPoly)
ILL_RPC (S_proc_proc2task_reply,
mach_port_t reply_port, kern_return_t return_code, mach_port_t task)
ILL_RPC (S_proc_pid2proc_reply,
- mach_port_t reply_port, kern_return_t return_code, mach_port_t proc)
+ mach_port_t reply_port, kern_return_t return_code, mach_port_t proc,
+ mach_msg_type_name_t procPoly)
ILL_RPC (S_proc_getprocinfo_reply,
mach_port_t reply_port, kern_return_t return_code,
int flags, procinfo_t procinfo, mach_msg_type_number_t procinfoCnt,
@@ -2358,7 +2365,7 @@ gnu_write_inferior (task_t task, CORE_AD
mach_msg_type_number_t copy_count;
int deallocate = 0;
- char *errstr = "Bug in gnu_write_inferior";
+ const char *errstr = "Bug in gnu_write_inferior";
struct vm_region_list *region_element;
struct vm_region_list *region_head = NULL;
@@ -2800,7 +2807,7 @@ show_thread_default_cmd (const char *arg
}
static int
-parse_int_arg (const char *args, char *cmd_prefix)
+parse_int_arg (const char *args, const char *cmd_prefix)
{
if (args)
{
@@ -2815,7 +2822,7 @@ parse_int_arg (const char *args, char *c
}
static int
-_parse_bool_arg (const char *args, char *t_val, char *f_val, char *cmd_prefix)
+_parse_bool_arg (const char *args, const char *t_val, const char *f_val, const char *cmd_prefix)
{
if (!args || strcmp (args, t_val) == 0)
return 1;
@@ -2831,7 +2838,7 @@ _parse_bool_arg (const char *args, char
_parse_bool_arg (args, "on", "off", cmd_prefix)
static void
-check_empty (const char *args, char *cmd_prefix)
+check_empty (const char *args, const char *cmd_prefix)
{
if (args)
error (_("Garbage after \"%s\" command: `%s'"), cmd_prefix, args);
Index: gdb-8.1/gdb/thread.c
===================================================================
--- gdb-8.1.orig/gdb/thread.c
+++ gdb-8.1/gdb/thread.c
@@ -68,21 +68,21 @@ static int thread_alive (struct thread_i
class scoped_inc_dec_ref
{
public:
- explicit scoped_inc_dec_ref (const std::vector<thread_info *> &thrds)
+ explicit scoped_inc_dec_ref (const std::vector<struct thread_info *> &thrds)
: m_thrds (thrds)
{
- for (thread_info *thr : m_thrds)
+ for (struct thread_info *thr : m_thrds)
thr->incref ();
}
~scoped_inc_dec_ref ()
{
- for (thread_info *thr : m_thrds)
+ for (struct thread_info *thr : m_thrds)
thr->decref ();
}
private:
- const std::vector<thread_info *> &m_thrds;
+ const std::vector<struct thread_info *> &m_thrds;
};
@@ -199,7 +199,7 @@ clear_thread_inferior_resources (struct
/* Set the TP's state as exited. */
static void
-set_thread_exited (thread_info *tp, int silent)
+set_thread_exited (struct thread_info *tp, int silent)
{
/* Dead threads don't need to step-over. Remove from queue. */
if (tp->step_over_next != NULL)
@@ -246,7 +246,7 @@ init_thread_list (void)
static struct thread_info *
new_thread (struct inferior *inf, ptid_t ptid)
{
- thread_info *tp = new thread_info (inf, ptid);
+ struct thread_info *tp = new struct thread_info (inf, ptid);
if (thread_list == NULL)
thread_list = tp;
@@ -1420,7 +1420,7 @@ switch_to_no_thread ()
/* Switch from one thread to another. */
static void
-switch_to_thread (thread_info *thr)
+switch_to_thread (struct thread_info *thr)
{
gdb_assert (thr != NULL);
@@ -1549,7 +1549,7 @@ scoped_restore_current_thread::scoped_re
if (inferior_ptid != null_ptid)
{
- thread_info *tp = find_thread_ptid (inferior_ptid);
+ struct thread_info *tp = find_thread_ptid (inferior_ptid);
struct frame_info *frame;
gdb_assert (tp != NULL);
@@ -1620,7 +1620,7 @@ static bool tp_array_compar_ascending;
order is determined by TP_ARRAY_COMPAR_ASCENDING. */
static bool
-tp_array_compar (const thread_info *a, const thread_info *b)
+tp_array_compar (const struct thread_info *a, const struct thread_info *b)
{
if (a->inf->num != b->inf->num)
{
@@ -1668,11 +1668,11 @@ thread_apply_all_command (const char *cm
thread, in case the command is one that wipes threads. E.g.,
detach, kill, disconnect, etc., or even normally continuing
over an inferior or thread exit. */
- std::vector<thread_info *> thr_list_cpy;
+ std::vector<struct thread_info *> thr_list_cpy;
thr_list_cpy.reserve (tc);
{
- thread_info *tp;
+ struct thread_info *tp;
ALL_NON_EXITED_THREADS (tp)
{
@@ -1690,7 +1690,7 @@ thread_apply_all_command (const char *cm
scoped_restore_current_thread restore_thread;
- for (thread_info *thr : thr_list_cpy)
+ for (struct thread_info *thr : thr_list_cpy)
if (thread_alive (thr))
{
switch_to_thread (thr->ptid);
@@ -1922,7 +1922,7 @@ show_print_thread_events (struct ui_file
/* See gdbthread.h. */
void
-thread_select (const char *tidstr, thread_info *tp)
+thread_select (const char *tidstr, struct thread_info *tp)
{
if (!thread_alive (tp))
error (_("Thread ID %s has terminated."), tidstr);
Index: gdb-8.1/gdb/breakpoint.c
===================================================================
--- gdb-8.1.orig/gdb/breakpoint.c
+++ gdb-8.1/gdb/breakpoint.c
@@ -12844,7 +12844,7 @@ momentary_bkpt_print_mention (struct bre
longjmp_breakpoint::~longjmp_breakpoint ()
{
- thread_info *tp = find_thread_global_id (this->thread);
+ struct thread_info *tp = find_thread_global_id (this->thread);
if (tp != NULL)
tp->initiating_frame = null_frame_id;
Index: gdb-8.1/gdb/infcmd.c
===================================================================
--- gdb-8.1.orig/gdb/infcmd.c
+++ gdb-8.1/gdb/infcmd.c
@@ -667,7 +667,7 @@ run_command_1 (const char *args, int fro
/* Queue a pending event so that the program stops immediately. */
if (run_how == RUN_STOP_AT_FIRST_INSN)
{
- thread_info *thr = inferior_thread ();
+ struct thread_info *thr = inferior_thread ();
thr->suspend.waitstatus_pending_p = 1;
thr->suspend.waitstatus.kind = TARGET_WAITKIND_STOPPED;
thr->suspend.waitstatus.value.sig = GDB_SIGNAL_0;
@@ -917,7 +917,7 @@ set_step_frame (void)
set_step_info (frame, sal);
CORE_ADDR pc = get_frame_pc (frame);
- thread_info *tp = inferior_thread ();
+ struct thread_info *tp = inferior_thread ();
tp->control.step_start_function = find_pc_function (pc);
}
Index: gdb-8.1/gdb/progspace-and-thread.c
===================================================================
--- gdb-8.1.orig/gdb/progspace-and-thread.c
+++ gdb-8.1/gdb/progspace-and-thread.c
@@ -27,7 +27,7 @@ switch_to_program_space_and_thread (prog
if (inf != NULL && inf->pid != 0)
{
- thread_info *tp = any_live_thread_of_process (inf->pid);
+ struct thread_info *tp = any_live_thread_of_process (inf->pid);
if (tp != NULL)
{
Index: gdb-8.1/gdb/remote.c
===================================================================
--- gdb-8.1.orig/gdb/remote.c
+++ gdb-8.1/gdb/remote.c
@@ -1817,7 +1817,7 @@ remote_add_inferior (int fake_pid_p, int
return inf;
}
-static remote_thread_info *get_remote_thread_info (thread_info *thread);
+static remote_thread_info *get_remote_thread_info (struct thread_info *thread);
/* Add thread PTID to GDB's thread list. Tag it as executing/running
according to RUNNING. */
@@ -1937,7 +1937,7 @@ remote_notice_new_inferior (ptid_t currt
/* Return THREAD's private thread data, creating it if necessary. */
static remote_thread_info *
-get_remote_thread_info (thread_info *thread)
+get_remote_thread_info (struct thread_info *thread)
{
gdb_assert (thread != NULL);
@@ -3800,7 +3800,7 @@ add_current_inferior_and_thread (char *w
/* Add the main thread and switch to it. Don't try reading
registers yet, since we haven't fetched the target description
yet. */
- thread_info *tp = add_thread_silent (curr_ptid);
+ struct thread_info *tp = add_thread_silent (curr_ptid);
switch_to_thread_no_regs (tp);
}
Index: gdb-8.1/gdb/linux-tdep.c
===================================================================
--- gdb-8.1.orig/gdb/linux-tdep.c
+++ gdb-8.1/gdb/linux-tdep.c
@@ -1646,7 +1646,7 @@ linux_collect_thread_registers (const st
buffer. */
static gdb::byte_vector
-linux_get_siginfo_data (thread_info *thread, struct gdbarch *gdbarch)
+linux_get_siginfo_data (struct thread_info *thread, struct gdbarch *gdbarch)
{
struct type *siginfo_type;
LONGEST bytes_read;
Index: gdb-8.1/gdb/mi/mi-main.c
===================================================================
--- gdb-8.1.orig/gdb/mi/mi-main.c
+++ gdb-8.1/gdb/mi/mi-main.c
@@ -559,7 +559,7 @@ mi_cmd_thread_select (const char *comman
error (_("-thread-select: USAGE: threadnum."));
int num = value_as_long (parse_and_eval (argv[0]));
- thread_info *thr = find_thread_global_id (num);
+ struct thread_info *thr = find_thread_global_id (num);
if (thr == NULL)
error (_("Thread ID %d not known."), num);
Index: gdb-8.1/gdb/python/py-record-btrace.c
===================================================================
--- gdb-8.1.orig/gdb/python/py-record-btrace.c
+++ gdb-8.1/gdb/python/py-record-btrace.c
@@ -71,7 +71,7 @@ btrace_insn_from_recpy_insn (const PyObj
{
const btrace_insn *insn;
const recpy_element_object *obj;
- thread_info *tinfo;
+ struct thread_info *tinfo;
btrace_insn_iterator iter;
if (Py_TYPE (pyobject) != &recpy_insn_type)
@@ -114,7 +114,7 @@ btrace_func_from_recpy_func (const PyObj
{
const btrace_function *func;
const recpy_element_object *obj;
- thread_info *tinfo;
+ struct thread_info *tinfo;
btrace_call_iterator iter;
if (Py_TYPE (pyobject) != &recpy_func_type)
@@ -152,7 +152,7 @@ btrace_func_from_recpy_func (const PyObj
gdb.RecordInstruction or gdb.RecordGap object for it accordingly. */
static PyObject *
-btpy_insn_or_gap_new (const thread_info *tinfo, Py_ssize_t number)
+btpy_insn_or_gap_new (const struct thread_info *tinfo, Py_ssize_t number)
{
btrace_insn_iterator iter;
int err_code;
@@ -338,7 +338,7 @@ PyObject *
recpy_bt_func_level (PyObject *self, void *closure)
{
const btrace_function * const func = btrace_func_from_recpy_func (self);
- thread_info *tinfo;
+ struct thread_info *tinfo;
if (func == NULL)
return NULL;