public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: Remove unneeded parameter from set_breakpoint_location_function
@ 2019-07-09  9:32 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2019-07-09  9:32 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0ba852ab4126a6eb4be88577d62dc25f2be7f725

commit 0ba852ab4126a6eb4be88577d62dc25f2be7f725
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Mon Jul 1 16:00:52 2019 +0100

    gdb: Remove unneeded parameter from set_breakpoint_location_function
    
    The explicit_loc parameter in set_breakpoint_location_function is not
    useful.  This parameter is set from two possible fields of the
    symtab_and_line used to create the breakpoint; the explicit_pc field,
    and the explicit_line field.
    
    First, the explicit_line field, this is not currently set for any
    breakpoint command, so will never be true.
    
    Next, the explicit_pc field.  This can be true but will never be true
    at the same time that the sal->msymbol field is also true - the
    sal->msymbol is only ever set in linespec.c:minsym_found, which
    doesn't allow for explicitly setting the pc.
    
    The result of this is that if we are setting a breakpoint on an
    msymbol that could turn out to be an ifunc, then we will not also have
    either an explicit_pc or an explicit_line, this check can therefore be
    removed.
    
    There should be no user visible changes after this commit.
    
    gdb/ChangeLog:
    
    	* breakpoint.c (set_breakpoint_location_function): Remove
    	explicit_loc parameter.
    	(momentary_breakpoint_from_master): Update call to
    	set_breakpoint_location_function.
    	(add_location_to_breakpoint): Likewise.

Diff:
---
 gdb/ChangeLog    |  8 ++++++++
 gdb/breakpoint.c | 14 +++++---------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 854eeb5..2fef7d2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
 2019-07-09  Andrew Burgess  <andrew.burgess@embecosm.com>
 
+	* breakpoint.c (set_breakpoint_location_function): Remove
+	explicit_loc parameter.
+	(momentary_breakpoint_from_master): Update call to
+	set_breakpoint_location_function.
+	(add_location_to_breakpoint): Likewise.
+
+2019-07-09  Andrew Burgess  <andrew.burgess@embecosm.com>
+
 	* riscv-tdep.c (riscv_features_from_gdbarch_info): Don't modify
 	required features based on default bfd type when no specific bfd
 	is present.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b49be76..9bae0a0 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7095,12 +7095,10 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch,
   return add_to_breakpoint_chain (std::move (b));
 }
 
-/* Initialize loc->function_name.  EXPLICIT_LOC says no indirect function
-   resolutions should be made as the user specified the location explicitly
-   enough.  */
+/* Initialize loc->function_name.  */
 
 static void
-set_breakpoint_location_function (struct bp_location *loc, int explicit_loc)
+set_breakpoint_location_function (struct bp_location *loc)
 {
   gdb_assert (loc->owner != NULL);
 
@@ -7112,8 +7110,7 @@ set_breakpoint_location_function (struct bp_location *loc, int explicit_loc)
 
       if (loc->msymbol != NULL
 	  && (MSYMBOL_TYPE (loc->msymbol) == mst_text_gnu_ifunc
-	      || MSYMBOL_TYPE (loc->msymbol) == mst_data_gnu_ifunc)
-	  && !explicit_loc)
+	      || MSYMBOL_TYPE (loc->msymbol) == mst_data_gnu_ifunc))
 	{
 	  struct breakpoint *b = loc->owner;
 
@@ -8481,7 +8478,7 @@ momentary_breakpoint_from_master (struct breakpoint *orig,
 
   copy = set_raw_breakpoint_without_location (orig->gdbarch, type, ops);
   copy->loc = allocate_bp_location (copy);
-  set_breakpoint_location_function (copy->loc, 1);
+  set_breakpoint_location_function (copy->loc);
 
   copy->loc->gdbarch = orig->loc->gdbarch;
   copy->loc->requested_address = orig->loc->requested_address;
@@ -8586,8 +8583,7 @@ add_location_to_breakpoint (struct breakpoint *b,
   loc->msymbol = sal->msymbol;
   loc->objfile = sal->objfile;
 
-  set_breakpoint_location_function (loc,
-				    sal->explicit_pc || sal->explicit_line);
+  set_breakpoint_location_function (loc);
 
   /* While by definition, permanent breakpoints are already present in the
      code, we don't mark the location as inserted.  Normally one would expect


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-09  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09  9:32 [binutils-gdb] gdb: Remove unneeded parameter from set_breakpoint_location_function Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).