From patchwork Sun Jun 30 00:21:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 33491 Received: (qmail 56022 invoked by alias); 30 Jun 2019 00:21:11 -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 56014 invoked by uid 89); 30 Jun 2019 00:21:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=wish, HContent-Transfer-Encoding:8bit X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 30 Jun 2019 00:21:10 +0000 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id OgX6Yr2xVHE4wEKZ (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Jun 2019 20:21:08 -0400 (EDT) Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id E2AFB441B21; Sat, 29 Jun 2019 20:21:07 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] Move generic_load declaration to symfile.h Date: Sat, 29 Jun 2019 20:21:07 -0400 Message-Id: <20190630002107.12982-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-IsSubscribed: yes ... since the implementation is in symfile.c. At the same time, add some documentation and make sure the first parameter's name in the declaration matches the definition. gdb/ChangeLog: * defs.h (generic_load): Move from here... * symfile.h (generic_load): ... to here. Rename name parameter to args. * symfile.c (generic_load): Add comment. --- gdb/defs.h | 3 --- gdb/symfile.c | 2 ++ gdb/symfile.h | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/defs.h b/gdb/defs.h index 3d878c84e3f1..81ab74c27f5d 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -300,9 +300,6 @@ EXTERN_C char *re_comp (const char *); extern void symbol_file_command (const char *, int); -/* * Remote targets may wish to use this as their load function. */ -extern void generic_load (const char *name, int from_tty); - /* From top.c */ typedef void initialize_file_ftype (void); diff --git a/gdb/symfile.c b/gdb/symfile.c index 6f9c81c8b948..59647bfe9d80 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2023,6 +2023,8 @@ static void print_transfer_performance (struct ui_file *stream, unsigned long write_count, std::chrono::steady_clock::duration d); +/* See symfile.h. */ + void generic_load (const char *args, int from_tty) { diff --git a/gdb/symfile.h b/gdb/symfile.h index daddd2e21abe..403dd165264e 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -532,6 +532,12 @@ void expand_symtabs_matching void map_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname); +/* Target-agnostic function to load the sections of an executable into memory. + + ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an + optional offset to apply to each section. */ +extern void generic_load (const char *args, int from_tty); + /* From dwarf2read.c */ /* Names for a dwarf2 debugging section. The field NORMAL is the normal