From patchwork Thu May 8 17:57:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 840 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id A73B9360098 for ; Thu, 8 May 2014 10:57:44 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 69E6C41927A80; Thu, 8 May 2014 10:57:44 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id 3656A41927A87 for ; Thu, 8 May 2014 10:57:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; q=dns; s=default; b=V76a+Om+YBXDnyXB443ihLtHHbZYN LDrdW/DFNQeRAMzb95gnK4Nr+QgVNE4fPib+28KhrXexlc0xYC2xU7feZIkMmi2Y VhViscJDZ+mXQSUNzt8oQuaJdlA78d3xQbcGLzx0wsekSScTGRj/JmWAY+eTYE4B M09S6ys7X1EZ0U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; s=default; bh=Ni7ddyFhOvHOfUZRosZD+tlAgIk=; b=Ijm C0rzAO+is/WrbUv9QA3d67z4x1CtCanv6vCiC6YHoVvKiEqVqIFQ2ExIWQpBSlqg Kh96uJpoxv6v0vaScPm6kMM0PhZCKpyE3AmCaTxLXA0WTNDSxK3lTFPLvrr4FKk2 wHnsBcp8UwuwuD0pjXEHBhX1y+0GO0eZdcMAR1Ro= Received: (qmail 9785 invoked by alias); 8 May 2014 17:57:42 -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 9765 invoked by uid 89); 8 May 2014 17:57:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 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; Thu, 08 May 2014 17:57:40 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s48HvdJT004534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 May 2014 13:57:39 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s48HvcqJ003243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 8 May 2014 13:57:38 -0400 Message-ID: <536BC592.8070102@redhat.com> Date: Thu, 08 May 2014 10:57:38 -0700 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org ml" Subject: [RFA 1/9] Explicit locations v2 - Mass rename X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi, This first patch doesn't really do anything but get some administrivia done in the breakpoint API functions. A lot of these functions were called "something_by_address", "something_from_address", "something_addr_string", or "something_linespec". Since "linespec" now really means linespec (and linespec only), I am renaming all of these functions to use the more generic/proper term, "location", as in "create_sals_from_location", where the argument will eventually be a struct instead of the current char *. [This change happens in patch #3.] Keith ChangeLog 2014-05-08 Keith Seitz * breakpoint.h (struct breakpoint_ops) : Renamed to create_sals_from_location. : Renamed to decode_location. Update all callers. * breakpoint.c (create_sals_from_address_default): Renamed to ... (create_sals_from_location_default): ... this. (decode_linespec_default): Renamed to ... (decode_location_default): ... this. (base_breakpoint_create_sals_from_address): Renamed to ... (base_breakpoint_create_sals_from_location): ... this. (bkpt_create_sals_from_address): Renamed to ... (bkpt_create_sals_from_location): ... this. (bkpt_decode_linespec): Renamed to ... (bkpt_decode_location): ... this. (bkpt_probe_create_sals_from_address): Renamed to ... (bkpt_probe_create_sals_from_location): ... this. (tracepoint_create_sals_from_address): Renamed to ... (tracepoint_create_sals_from_location): ... this. (tracepoint_decode_linespec): Renamed to ... (tracepoint_decode_location): ... this. (tracepoint_probe_create_sals_from_address): Renamed to ... (tracepoint_probe_create_sals_from_location): ... this. (tracepoint_probe_decode_linespec): Renamed to ... (tracepoint_probe_decode_location): ... this. (strace_marker_create_sals_from_address): Renamed to ... (strace_marker_create_sals_from_location): ... this. (decode_linespec_default): Renamed to ... (decode_location_default): ... this. diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index d8e88fc..b23d2eb 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -555,14 +555,14 @@ struct breakpoint_ops /* Print to FP the CLI command that recreates this breakpoint. */ void (*print_recreate) (struct breakpoint *, struct ui_file *fp); - /* Create SALs from address string, storing the result in linespec_result. + /* Create SALs from location, storing the result in linespec_result. For an explanation about the arguments, see the function - `create_sals_from_address_default'. + `create_sals_from_location_default'. This function is called inside `create_breakpoint'. */ - void (*create_sals_from_address) (char **, struct linespec_result *, - enum bptype, char *, char **); + void (*create_sals_from_location) (char **, struct linespec_result *, + enum bptype, char *, char **); /* This method will be responsible for creating a breakpoint given its SALs. Usually, it just calls `create_breakpoints_sal' (for ordinary @@ -578,12 +578,12 @@ struct breakpoint_ops int, const struct breakpoint_ops *, int, int, int, unsigned); - /* Given the address string (second parameter), this method decodes it + /* Given the location (second parameter), this method decodes it and provides the SAL locations related to it. For ordinary breakpoints, it calls `decode_line_full'. - This function is called inside `addr_string_to_sals'. */ - void (*decode_linespec) (struct breakpoint *, char **, + This function is called inside `location_to_sals'. */ + void (*decode_location) (struct breakpoint *, char **, struct symtabs_and_lines *); /* Return true if this breakpoint explains a signal. See diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 9831d96..d0dacae 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -226,7 +226,7 @@ re_set_exception_catchpoint (struct breakpoint *self) { char *spec = ASTRDUP (exception_functions[kind].function); - self->ops->decode_linespec (self, &spec, &sals); + self->ops->decode_location (self, &spec, &sals); } /* NOT_FOUND_ERROR just means the breakpoint will be pending, so diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f422998..3f089de 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -111,10 +111,10 @@ static int breakpoint_re_set_one (void *); static void breakpoint_re_set_default (struct breakpoint *); -static void create_sals_from_address_default (char **, - struct linespec_result *, - enum bptype, char *, - char **); +static void create_sals_from_location_default (char **, + struct linespec_result *, + enum bptype, char *, + char **); static void create_breakpoints_sal_default (struct gdbarch *, struct linespec_result *, @@ -124,7 +124,7 @@ static void create_breakpoints_sal_default (struct gdbarch *, const struct breakpoint_ops *, int, int, int, unsigned); -static void decode_linespec_default (struct breakpoint *, char **, +static void decode_location_default (struct breakpoint *, char **, struct symtabs_and_lines *); static void clear_command (char *, int); @@ -9814,8 +9814,8 @@ create_breakpoint (struct gdbarch *gdbarch, TRY_CATCH (e, RETURN_MASK_ALL) { - ops->create_sals_from_address (&arg, &canonical, type_wanted, - addr_start, ©_arg); + ops->create_sals_from_location (&arg, &canonical, type_wanted, + addr_start, ©_arg); } /* If caller is interested in rc value from parse, set value. */ @@ -13012,11 +13012,11 @@ base_breakpoint_print_recreate (struct breakpoint *b, struct ui_file *fp) } static void -base_breakpoint_create_sals_from_address (char **arg, - struct linespec_result *canonical, - enum bptype type_wanted, - char *addr_start, - char **copy_arg) +base_breakpoint_create_sals_from_location (char **arg, + struct linespec_result *canonical, + enum bptype type_wanted, + char *addr_start, + char **copy_arg) { internal_error_pure_virtual_called (); } @@ -13038,7 +13038,7 @@ base_breakpoint_create_breakpoints_sal (struct gdbarch *gdbarch, } static void -base_breakpoint_decode_linespec (struct breakpoint *b, char **s, +base_breakpoint_decode_location (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { internal_error_pure_virtual_called (); @@ -13076,9 +13076,9 @@ struct breakpoint_ops base_breakpoint_ops = base_breakpoint_print_one_detail, base_breakpoint_print_mention, base_breakpoint_print_recreate, - base_breakpoint_create_sals_from_address, + base_breakpoint_create_sals_from_location, base_breakpoint_create_breakpoints_sal, - base_breakpoint_decode_linespec, + base_breakpoint_decode_location, base_breakpoint_explains_signal, base_breakpoint_after_condition_true, }; @@ -13233,12 +13233,12 @@ bkpt_print_recreate (struct breakpoint *tp, struct ui_file *fp) } static void -bkpt_create_sals_from_address (char **arg, +bkpt_create_sals_from_location (char **arg, struct linespec_result *canonical, enum bptype type_wanted, char *addr_start, char **copy_arg) { - create_sals_from_address_default (arg, canonical, type_wanted, + create_sals_from_location_default (arg, canonical, type_wanted, addr_start, copy_arg); } @@ -13264,10 +13264,10 @@ bkpt_create_breakpoints_sal (struct gdbarch *gdbarch, } static void -bkpt_decode_linespec (struct breakpoint *b, char **s, +bkpt_decode_location (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { - decode_linespec_default (b, s, sals); + decode_location_default (b, s, sals); } /* Virtual table for internal breakpoints. */ @@ -13465,10 +13465,10 @@ bkpt_probe_remove_location (struct bp_location *bl) } static void -bkpt_probe_create_sals_from_address (char **arg, - struct linespec_result *canonical, - enum bptype type_wanted, - char *addr_start, char **copy_arg) +bkpt_probe_create_sals_from_location (char **arg, + struct linespec_result *canonical, + enum bptype type_wanted, + char *addr_start, char **copy_arg) { struct linespec_sals lsal; @@ -13481,7 +13481,7 @@ bkpt_probe_create_sals_from_address (char **arg, } static void -bkpt_probe_decode_linespec (struct breakpoint *b, char **s, +bkpt_probe_decode_location (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { *sals = parse_probes (s, NULL); @@ -13574,12 +13574,12 @@ tracepoint_print_recreate (struct breakpoint *self, struct ui_file *fp) } static void -tracepoint_create_sals_from_address (char **arg, +tracepoint_create_sals_from_location (char **arg, struct linespec_result *canonical, enum bptype type_wanted, char *addr_start, char **copy_arg) { - create_sals_from_address_default (arg, canonical, type_wanted, + create_sals_from_location_default (arg, canonical, type_wanted, addr_start, copy_arg); } @@ -13605,10 +13605,10 @@ tracepoint_create_breakpoints_sal (struct gdbarch *gdbarch, } static void -tracepoint_decode_linespec (struct breakpoint *b, char **s, +tracepoint_decode_location (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { - decode_linespec_default (b, s, sals); + decode_location_default (b, s, sals); } struct breakpoint_ops tracepoint_breakpoint_ops; @@ -13617,22 +13617,22 @@ struct breakpoint_ops tracepoint_breakpoint_ops; static probe. */ static void -tracepoint_probe_create_sals_from_address (char **arg, - struct linespec_result *canonical, - enum bptype type_wanted, - char *addr_start, char **copy_arg) +tracepoint_probe_create_sals_from_location (char **arg, + struct linespec_result *canonical, + enum bptype type_wanted, + char *addr_start, char **copy_arg) { /* We use the same method for breakpoint on probes. */ - bkpt_probe_create_sals_from_address (arg, canonical, type_wanted, - addr_start, copy_arg); + bkpt_probe_create_sals_from_location (arg, canonical, type_wanted, + addr_start, copy_arg); } static void -tracepoint_probe_decode_linespec (struct breakpoint *b, char **s, +tracepoint_probe_decode_location (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { /* We use the same method for breakpoint on probes. */ - bkpt_probe_decode_linespec (b, s, sals); + bkpt_probe_decode_location (b, s, sals); } static struct breakpoint_ops tracepoint_probe_breakpoint_ops; @@ -13718,10 +13718,10 @@ dprintf_after_condition_true (struct bpstats *bs) markers (`-m'). */ static void -strace_marker_create_sals_from_address (char **arg, - struct linespec_result *canonical, - enum bptype type_wanted, - char *addr_start, char **copy_arg) +strace_marker_create_sals_from_location (char **arg, + struct linespec_result *canonical, + enum bptype type_wanted, + char *addr_start, char **copy_arg) { struct linespec_sals lsal; @@ -13794,7 +13794,7 @@ strace_marker_create_breakpoints_sal (struct gdbarch *gdbarch, } static void -strace_marker_decode_linespec (struct breakpoint *b, char **s, +strace_marker_decode_location (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { struct tracepoint *tp = (struct tracepoint *) b; @@ -14354,7 +14354,7 @@ addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found) TRY_CATCH (e, RETURN_MASK_ERROR) { - b->ops->decode_linespec (b, &s, &sals); + b->ops->decode_location (b, &s, &sals); } if (e.reason < 0) { @@ -14456,7 +14456,7 @@ breakpoint_re_set_default (struct breakpoint *b) calls parse_breakpoint_sals. Return 1 for success, zero for failure. */ static void -create_sals_from_address_default (char **arg, +create_sals_from_location_default (char **arg, struct linespec_result *canonical, enum bptype type_wanted, char *addr_start, char **copy_arg) @@ -14489,10 +14489,10 @@ create_breakpoints_sal_default (struct gdbarch *gdbarch, } /* Decode the line represented by S by calling decode_line_full. This is the - default function for the `decode_linespec' method of breakpoint_ops. */ + default function for the `decode_location' method of breakpoint_ops. */ static void -decode_linespec_default (struct breakpoint *b, char **s, +decode_location_default (struct breakpoint *b, char **s, struct symtabs_and_lines *sals) { struct linespec_result canonical; @@ -16046,9 +16046,9 @@ initialize_breakpoint_ops (void) ops->insert_location = bkpt_insert_location; ops->remove_location = bkpt_remove_location; ops->breakpoint_hit = bkpt_breakpoint_hit; - ops->create_sals_from_address = bkpt_create_sals_from_address; + ops->create_sals_from_location = bkpt_create_sals_from_location; ops->create_breakpoints_sal = bkpt_create_breakpoints_sal; - ops->decode_linespec = bkpt_decode_linespec; + ops->decode_location = bkpt_decode_location; /* The breakpoint_ops structure to be used in regular breakpoints. */ ops = &bkpt_breakpoint_ops; @@ -16096,8 +16096,8 @@ initialize_breakpoint_ops (void) *ops = bkpt_breakpoint_ops; ops->insert_location = bkpt_probe_insert_location; ops->remove_location = bkpt_probe_remove_location; - ops->create_sals_from_address = bkpt_probe_create_sals_from_address; - ops->decode_linespec = bkpt_probe_decode_linespec; + ops->create_sals_from_location = bkpt_probe_create_sals_from_location; + ops->decode_location = bkpt_probe_decode_location; /* Watchpoints. */ ops = &watchpoint_breakpoint_ops; @@ -16135,22 +16135,22 @@ initialize_breakpoint_ops (void) ops->print_one_detail = tracepoint_print_one_detail; ops->print_mention = tracepoint_print_mention; ops->print_recreate = tracepoint_print_recreate; - ops->create_sals_from_address = tracepoint_create_sals_from_address; + ops->create_sals_from_location = tracepoint_create_sals_from_location; ops->create_breakpoints_sal = tracepoint_create_breakpoints_sal; - ops->decode_linespec = tracepoint_decode_linespec; + ops->decode_location = tracepoint_decode_location; /* Probe tracepoints. */ ops = &tracepoint_probe_breakpoint_ops; *ops = tracepoint_breakpoint_ops; - ops->create_sals_from_address = tracepoint_probe_create_sals_from_address; - ops->decode_linespec = tracepoint_probe_decode_linespec; + ops->create_sals_from_location = tracepoint_probe_create_sals_from_location; + ops->decode_location = tracepoint_probe_decode_location; /* Static tracepoints with marker (`-m'). */ ops = &strace_marker_breakpoint_ops; *ops = tracepoint_breakpoint_ops; - ops->create_sals_from_address = strace_marker_create_sals_from_address; + ops->create_sals_from_location = strace_marker_create_sals_from_location; ops->create_breakpoints_sal = strace_marker_create_breakpoints_sal; - ops->decode_linespec = strace_marker_decode_linespec; + ops->decode_location = strace_marker_decode_location; /* Fork catchpoints. */ ops = &catch_fork_breakpoint_ops;