From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id 1298C398641A for ; Fri, 4 Sep 2020 00:30:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1298C398641A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gmx.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=n54@gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599179385; bh=UJK/GAOZT677oJsw5nrapVDulSllBBAxWDTJmxvQsmY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=YZsaQzbBBzi+ho9HpuvIt+ivPZmFgJA4n9cjB1vebYT2yyayuzUfWn5yPS8yEH49e rNMVdbD6YO1d9Y0qJoFi/Ixyy+6cDupnuRfUaK1QlGAys7zzJxkgUyrfLiFrKr0LZc IUzchAZYN7dcU2TuRxcRLdGMC3Pl24rwqcxDlyuE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([89.79.191.25]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MGyxN-1kIiYk2OG3-00E7Pe; Fri, 04 Sep 2020 02:29:45 +0200 From: Kamil Rytarowski To: gdb-patches@sourceware.org Cc: tom@tromey.com, tankut.baris.aktemur@intel.com, Kamil Rytarowski Subject: [PATCH v2 00/10] Add minimal NetBSD/amd64 gdbserver support Date: Fri, 4 Sep 2020 02:28:55 +0200 Message-Id: <20200904002905.13616-1-n54@gmx.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:+tSZuvuzmkB4tup3eB4lXy2+Lw4VSwmG9l8T2qPUQmnqRHYtLih d4ZFWkypYwmsy3qARaZfPdOKQMoBz/D3I6cVxt3NmM3T+LiSsiLfRKVc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9B0FIr2xZ6wfIBvWrRtOV+3L9hfvdoe6YXJKF5/CU07vOWafT xuM6/JG9J+ASAJVQht4O+4SMM+Q6Yv+R0IHpwuHa4onXNQgO3PkRrHTTZzTQjdlvoB2W3yKNd YJl+WL8+IvX9qseFZgJC72j18jWe03/X5dMs14EOgteZDFUQ7dJF/T++pRw4XttYOm8Mx5uhK aqq1nY1Q/q6+ZqY+ybPefn4SHnTQUkfadZpNkoOnDSAnqYINdy/uhpZj6VvcWdjZxFS2FxctT rMBANceoSdBd7z32aypS5AxH9huQ1bzFtd62qfxB5XG57hJK3upqiPhgI1p2+Wp5dCarqGGld rzGA2B+A/CSgIzCLK X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 00:30:08 -0000 Extract reusable functionality from gdb/nbsd-nat.c into gdb/nat/netbsd-nat.c and switch the gdb/nbsd-nat.c functions (nbsd_nat_target::pid_to_exec_file, nbsd_nat_target::thread_alive, nbsd_nat_target::thread_name, nbsd_nat_target::post_startup_inferior, nbsd_nat_target::post_attach, nbsd_nat_target::xfer_partial, nbsd_add_threads) to gdb/nat. Add handle_eintr in gdbsupport to wrap syscalls and EINTR handling. Add NetBSD/amd64 gdbserver support Implement the following functionality: create_inferior, post_create_inferior, attach, kill, detach, mourn, join, thread_alive, resume, wait, fetch_registers, store_registers, read_memory, write_memory, request_interrupt, supports_read_auxv, read_auxv, supports_hardware_single_step, sw_breakpoint_from_kind, supports_z_point_type, insert_point, remove_point, stopped_by_sw_breakpoint, supports_qxfer_siginfo, qxfer_siginfo, supports_stopped_by_sw_breakpoint, supports_non_stop, supports_multi_process, supports_fork_events, supports_vfork_events, supports_exec_events, supports_disable_randomization, supports_qxfer_libraries_svr4, qxfer_libraries_svr4, supports_pid_to_exec_file, pid_to_exec_file, thread_name, supports_catch_syscall. The only CPU architecture supported: x86_64. Implement only support for hardware assisted single step and software breakpoint. Implement support only for regular X86 registers, thus no FPU. Changes in v2: * handle_eintr downgraded from C++14 to C++11 and allow predefining the value of failure. * Enhance ChangeLog entries. * Remove srv_netbsd from /gdbserver/configure.srv. * Enhance wording and code style. * Remove function return type from netbsd_add_process(). * Rename netbsd_nat::list_threads to netbsd_nat::for_each_thread. * Return error on failure in netbsd_process_target::kill. * Use core_addr_to_string() when printing CORE_ADDR. * Switch from (*target). to target->. * Simplify netbsd_process_target::sw_breakpoint_from_kind. * Remove netbsd_target_ops::process_qsupported() and x86_64_netbsd_update_xmltarget(). Kamil Rytarowski (10): Add handle_eintr to wrap EINTR handling in syscalls Register a placeholder for NetBSD shared functions in gdb/nat Build nat/netbsd-nat.o for the NetBSD native target Add netbsd_nat::pid_to_exec_file Add gdb/nat common functions for listing threads Add netbsd_nat::enable_proc_events in gdb/nat Add a common utility function to read and write siginfo_t in inferior Avoid double free in startup_inferior Switch local native code to gdb/nat shared functions Add minimal and functional NetBSD/amd64 gdbserver gdb/ChangeLog | 53 ++ gdb/configure.nat | 2 +- gdb/nat/fork-inferior.c | 5 +- gdb/nat/netbsd-nat.c | 213 +++++ gdb/nat/netbsd-nat.h | 46 ++ gdb/nbsd-nat.c | 147 +--- gdbserver/ChangeLog | 9 + gdbserver/Makefile.in | 3 + gdbserver/configure.srv | 6 + gdbserver/netbsd-low.cc | 1348 ++++++++++++++++++++++++++++++++ gdbserver/netbsd-low.h | 154 ++++ gdbserver/netbsd-x86_64-low.cc | 187 +++++ gdbsupport/ChangeLog | 4 + gdbsupport/eintr.h | 41 + 14 files changed, 2082 insertions(+), 136 deletions(-) create mode 100644 gdb/nat/netbsd-nat.c create mode 100644 gdb/nat/netbsd-nat.h create mode 100644 gdbserver/netbsd-low.cc create mode 100644 gdbserver/netbsd-low.h create mode 100644 gdbserver/netbsd-x86_64-low.cc create mode 100644 gdbsupport/eintr.h =2D- 2.28.0