From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16227 invoked by alias); 15 Jan 2014 16:43:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16215 invoked by uid 89); 15 Jan 2014 16:43:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Jan 2014 16:43:21 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0FGhKj8006702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Jan 2014 11:43:20 -0500 Received: from barimba (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0FGhGD3018378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 15 Jan 2014 11:43:18 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFC 28/32] convert to_get_section_table References: <1389640367-5571-1-git-send-email-tromey@redhat.com> <1389640367-5571-29-git-send-email-tromey@redhat.com> <52D58EB9.1030504@redhat.com> <87ha96uzus.fsf@fleche.redhat.com> <52D5904D.5030702@redhat.com> Date: Wed, 15 Jan 2014 16:43:00 -0000 In-Reply-To: <52D5904D.5030702@redhat.com> (Pedro Alves's message of "Tue, 14 Jan 2014 19:30:21 +0000") Message-ID: <87k3e1ryaj.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-01/txt/msg00519.txt.bz2 Tom> Yeah. Unfortunately I didn't think of this early enough. I can fix Tom> this if you like, but unlike other rewrites, I'd prefer to do it as a Tom> cleanup patch on top. I found the hard way that modifications to these Tom> lines cause conflicts to bubble up through the entire patch series. Pedro> Yeah, please leave it as is. We can always clean up afterwards. I applied this patch to my branch to clean this up. Tom commit 9ca52ccf3084a6e25a93de7e1974997491404d95 Author: Tom Tromey Date: Wed Jan 15 09:30:05 2014 -0700 pass NULL to TARGET_DEFAULT_RETURN when appropriate This changes instances of TARGET_DEFAULT_RETURN(0) to TARGET_DEFAULT_RETURN(NULL) when appropriate. The use of "0" was a relic from an earlier implementation of make-target-delegates; and I didn't want to go back through the long patch series, fixing up conflicts, just to change this small detail. 2014-01-15 Tom Tromey * target-delegates.c: Rebuild. * target.h (struct target_ops) : Use NULL, not 0, in TARGET_DEFAULT_RETURN. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1e638db..ca5b145 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2014-01-15 Tom Tromey + + * target-delegates.c: Rebuild. + * target.h (struct target_ops) : Use NULL, + not 0, in TARGET_DEFAULT_RETURN. + 2014-01-13 Tom Tromey * target.c (complete_target_initialization): Remove casts. Use diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 474fe80..6e59588 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -609,7 +609,7 @@ delegate_extra_thread_info (struct target_ops *self, struct thread_info *arg1) static char * tdefault_extra_thread_info (struct target_ops *self, struct thread_info *arg1) { - return 0; + return NULL; } static char * @@ -622,7 +622,7 @@ delegate_thread_name (struct target_ops *self, struct thread_info *arg1) static char * tdefault_thread_name (struct target_ops *self, struct thread_info *arg1) { - return 0; + return NULL; } static void @@ -654,7 +654,7 @@ delegate_pid_to_exec_file (struct target_ops *self, int arg1) static char * tdefault_pid_to_exec_file (struct target_ops *self, int arg1) { - return 0; + return NULL; } static void @@ -679,7 +679,7 @@ delegate_get_section_table (struct target_ops *self) static struct target_section_table * tdefault_get_section_table (struct target_ops *self) { - return 0; + return NULL; } static int @@ -772,7 +772,7 @@ delegate_memory_map (struct target_ops *self) static VEC(mem_region_s) * tdefault_memory_map (struct target_ops *self) { - return 0; + return NULL; } static void @@ -811,7 +811,7 @@ delegate_read_description (struct target_ops *self) static const struct target_desc * tdefault_read_description (struct target_ops *self) { - return 0; + return NULL; } static ptid_t @@ -1297,7 +1297,7 @@ delegate_traceframe_info (struct target_ops *self) static struct traceframe_info * tdefault_traceframe_info (struct target_ops *self) { - return 0; + return NULL; } static int diff --git a/gdb/target.h b/gdb/target.h index 2d1c2d6..d2651b6 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -554,20 +554,20 @@ struct target_ops char *(*to_pid_to_str) (struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC (default_pid_to_str); char *(*to_extra_thread_info) (struct target_ops *, struct thread_info *) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); char *(*to_thread_name) (struct target_ops *, struct thread_info *) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); void (*to_stop) (struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE (); void (*to_rcmd) (struct target_ops *, char *command, struct ui_file *output) TARGET_DEFAULT_FUNC (default_rcmd); char *(*to_pid_to_exec_file) (struct target_ops *, int pid) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); void (*to_log_command) (struct target_ops *, const char *) TARGET_DEFAULT_IGNORE (); struct target_section_table *(*to_get_section_table) (struct target_ops *) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); enum strata to_stratum; int (*to_has_all_memory) (struct target_ops *); int (*to_has_memory) (struct target_ops *); @@ -655,7 +655,7 @@ struct target_ops change unexpectedly, it should be invalidated, and higher layers will re-fetch it. */ VEC(mem_region_s) *(*to_memory_map) (struct target_ops *) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); /* Erases the region of flash memory starting at ADDRESS, of length LENGTH. @@ -678,7 +678,7 @@ struct target_ops "beneath" target. Returns the description found, or NULL if no description was available. */ const struct target_desc *(*to_read_description) (struct target_ops *ops) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); /* Build the PTID of the thread on which a given task is running, based on LWP and THREAD. These values are extracted from the @@ -970,7 +970,7 @@ struct target_ops cache data; higher layers take care of caching, invalidating, and re-fetching when necessary. */ struct traceframe_info *(*to_traceframe_info) (struct target_ops *) - TARGET_DEFAULT_RETURN (0); + TARGET_DEFAULT_RETURN (NULL); /* Ask the target to use or not to use agent according to USE. Return 1 successful, 0 otherwise. */