From patchwork Sat Dec 23 18:41:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Svante Signell X-Patchwork-Id: 25094 Received: (qmail 94083 invoked by alias); 23 Dec 2017 18:39:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 94074 invoked by uid 89); 23 Dec 2017 18:39:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*debian.org, 15747, fwd, HCc:D*debian.org X-HELO: mail-lf0-f44.google.com Received: from mail-lf0-f44.google.com (HELO mail-lf0-f44.google.com) (209.85.215.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Dec 2017 18:39:52 +0000 Received: by mail-lf0-f44.google.com with SMTP id j124so34619780lfg.2 for ; Sat, 23 Dec 2017 10:39:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc:date :references:mime-version; bh=LzzzXkRe5VomsYR3hb0OzazCmoTMn0zykVpwtL7HaXY=; b=tQ2dnkOGK/2dBzmsP79owlN0lBXmTvCpMY1PXac5izMiCBpnAq/dHM9yQjs6QyNeld aDrMn2DkypFy2XaEYDH1QGwQ8xEpJHH4A8pMGzLmdA9IZylmyCiKuZiCBV8cvT3m5H10 fU8MAwfGAmZjTEtcDoqfAdRIK8ka9eWUkvCiSv4qNCoEqewtDYESM1M/bLLIN4oiF+9C 2mTrERbTAXnApw70xfzfZ/zrwLPA23LqdpQS3os09wjQ1B/jMzIUmmET9Gm0F3hPNFaK qfl5VU4jukuZySWicwNckqbsRknnWB0WQ49yFeMiM0vo6tFSuRaDMQOS/eomjDmfBZEr dyrg== X-Gm-Message-State: AKGB3mLe9pq1CiUt/bsG8hD2qMK+8P0EjKqBaLWyKI5OwrJeJuH3kb5n v6rSefKjZKFtZhiyZkgOgwg= X-Google-Smtp-Source: ACJfBovPVgiRtafByOy8T7lQtmZ+UXHa/HvxLFJCqpbvzkNxCId8j7uFF45wR967oxr+pTdWbFANEQ== X-Received: by 10.25.29.205 with SMTP id d196mr952405lfd.130.1514054389978; Sat, 23 Dec 2017 10:39:49 -0800 (PST) Received: from z97-4790k.lan (90-224-46-241-no549.tbcn.telia.com. [90.224.46.241]) by smtp.googlemail.com with ESMTPSA id j73sm723966lfi.86.2017.12.23.10.39.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Dec 2017 10:39:49 -0800 (PST) Message-ID: <1514054469.7063.134.camel@gmail.com> Subject: [Fwd: gdb: FTBFS on hurd-i386] From: Svante Signell Reply-To: svante.signell@gmail.com To: bug-hurd@gnu.org, gdb-patches@sourceware.org, thomas@codesourcery.com Cc: 881569@bugs.debian.org, =?ISO-8859-1?Q?H=E9ctor_Or=F3n_Mart=EDnez?= Date: Sat, 23 Dec 2017 19:41:09 +0100 References: <1510543894.5221.5.camel@gmail.com> Mime-Version: 1.0 Hello, These patches was submitted to Debian November 13 2017. Nothing has happened so far, so maybe upstream would be interested to consider the patches for next release. Thanks! Source: gdb Version: 8.0-1 Severity: important Tags: patch User: debian-hurd@lists.debian.org Usertags: hurd, experimental Hi, gdb FTBFS on GNU/Hurd due to three reasons: - Usage of PATH_MAX in gdb/remote.c - Recent changes in Hurd failing the build of gdb/gnu-nat.c - A name clash of struct thread_info and the kernel function thread_info() included in gdb/thread.c and gdb/python/py-record-btrace.c. Include paths: 1) defs.h: #include "gdbarch.h": struct thread_info 2) defs.h: #include "nm.h":#include :#include where the function thread_info() is defined: extern kern_return_t thread_info (  mach_port_t target_thread,  int flavor,  thread_info_t thread_info_out,  mach_msg_type_number_t *thread_info_outCnt ); The attached patches fixes these issues: gdb-PATH_MAX.patch gnu-nat.c.patch struct-thread_info.patch Thanks :) Index: gdb-8.0/gdb/thread.c =================================================================== --- gdb-8.0.orig/gdb/thread.c +++ gdb-8.0/gdb/thread.c @@ -76,21 +76,21 @@ static void restore_current_thread (ptid class scoped_inc_dec_ref { public: - explicit scoped_inc_dec_ref (const std::vector &thrds) + explicit scoped_inc_dec_ref (const std::vector &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 &m_thrds; + const std::vector &m_thrds; }; @@ -207,7 +207,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) @@ -254,7 +254,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; @@ -1574,7 +1574,7 @@ restore_selected_frame (struct frame_id struct current_thread_cleanup { - thread_info *thread; + struct thread_info *thread; struct frame_id selected_frame_id; int selected_frame_level; int was_stopped; @@ -1716,7 +1716,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) { @@ -1774,11 +1774,11 @@ thread_apply_all_command (char *cmd, int 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 thr_list_cpy; + std::vector thr_list_cpy; thr_list_cpy.reserve (tc); { - thread_info *tp; + struct thread_info *tp; ALL_NON_EXITED_THREADS (tp) { @@ -1794,7 +1794,7 @@ thread_apply_all_command (char *cmd, int std::sort (thr_list_cpy.begin (), thr_list_cpy.end (), tp_array_compar); - for (thread_info *thr : thr_list_cpy) + for (struct thread_info *thr : thr_list_cpy) if (thread_alive (thr)) { switch_to_thread (thr->ptid); Index: gdb-8.0/gdb/python/py-record-btrace.c =================================================================== --- gdb-8.0.orig/gdb/python/py-record-btrace.c +++ gdb-8.0/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;