This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Rename block_function


In the same vein as my last patch.  All callers of block_function want
a symbol that corresponds to the start of a real function in the
object file, with an associated section, start address, etc.  Today
there is no difference, but the name change makes it clearer what to
expect once inlined functions are supported.

Tested x86_64-linux and committed.

-- 
Daniel Jacobowitz
CodeSourcery

2008-07-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* block.c (block_function): Renamed to ...
	(block_linkage_function): ... this.  All callers changed.
	* block.h (block_function): Renamed to ...
	(block_linkage_function): ... this.

---
 gdb/ada-lang.c   |    4 ++--
 gdb/block.c      |    6 ++++--
 gdb/block.h      |    2 +-
 gdb/blockframe.c |    6 +++---
 gdb/breakpoint.c |    5 +++--
 5 files changed, 13 insertions(+), 10 deletions(-)

Index: src/gdb/ada-lang.c
===================================================================
--- src.orig/gdb/ada-lang.c	2008-07-02 16:37:31.000000000 -0400
+++ src/gdb/ada-lang.c	2008-07-02 16:37:40.000000000 -0400
@@ -4625,7 +4625,7 @@ remove_irrelevant_renamings (struct ada_
   if (current_block == NULL)
     return nsyms;
 
-  current_function = block_function (current_block);
+  current_function = block_linkage_function (current_block);
   if (current_function == NULL)
     return nsyms;
 
@@ -6721,7 +6721,7 @@ ada_find_renaming_symbol (const char *na
 static struct symbol *
 find_old_style_renaming_symbol (const char *name, struct block *block)
 {
-  const struct symbol *function_sym = block_function (block);
+  const struct symbol *function_sym = block_linkage_function (block);
   char *rename;
 
   if (function_sym != NULL)
Index: src/gdb/block.c
===================================================================
--- src.orig/gdb/block.c	2008-07-02 16:37:44.000000000 -0400
+++ src/gdb/block.c	2008-07-02 16:39:15.000000000 -0400
@@ -53,10 +53,12 @@ contained_in (const struct block *a, con
 
 
 /* Return the symbol for the function which contains a specified
-   lexical block, described by a struct block BL.  */
+   lexical block, described by a struct block BL.  The return value
+   will not be an inlined function; the containing function will be
+   returned instead.  */
 
 struct symbol *
-block_function (const struct block *bl)
+block_linkage_function (const struct block *bl)
 {
   while (BLOCK_FUNCTION (bl) == 0 && BLOCK_SUPERBLOCK (bl) != 0)
     bl = BLOCK_SUPERBLOCK (bl);
Index: src/gdb/block.h
===================================================================
--- src.orig/gdb/block.h	2008-07-02 16:39:28.000000000 -0400
+++ src/gdb/block.h	2008-07-02 16:39:34.000000000 -0400
@@ -132,7 +132,7 @@ struct blockvector
 
 enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 };
 
-extern struct symbol *block_function (const struct block *);
+extern struct symbol *block_linkage_function (const struct block *);
 
 extern int contained_in (const struct block *, const struct block *);
 
Index: src/gdb/blockframe.c
===================================================================
--- src.orig/gdb/blockframe.c	2008-07-02 16:39:37.000000000 -0400
+++ src/gdb/blockframe.c	2008-07-02 16:39:47.000000000 -0400
@@ -77,7 +77,7 @@ get_pc_function_start (CORE_ADDR pc)
   bl = block_for_pc (pc);
   if (bl)
     {
-      struct symbol *symbol = block_function (bl);
+      struct symbol *symbol = block_linkage_function (bl);
 
       if (symbol)
 	{
@@ -106,7 +106,7 @@ get_frame_function (struct frame_info *f
   struct block *bl = get_frame_block (frame, 0);
   if (bl == 0)
     return 0;
-  return block_function (bl);
+  return block_linkage_function (bl);
 }
 
 
@@ -119,7 +119,7 @@ find_pc_sect_function (CORE_ADDR pc, str
   struct block *b = block_for_pc_sect (pc, section);
   if (b == 0)
     return 0;
-  return block_function (b);
+  return block_linkage_function (b);
 }
 
 /* Return the function containing pc value PC.
Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c	2008-07-02 16:37:24.000000000 -0400
+++ src/gdb/breakpoint.c	2008-07-02 16:40:03.000000000 -0400
@@ -2654,7 +2654,8 @@ watchpoint_check (void *p)
       /* If we've gotten confused in the unwinder, we might have
 	 returned a frame that can't describe this variable.  */
       if (within_current_scope
-	  && block_function (b->exp_valid_block) != get_frame_function (fr))
+	  && (block_linkage_function (b->exp_valid_block)
+	      != get_frame_function (fr)))
 	within_current_scope = 0;
 
       /* in_function_epilogue_p() returns a non-zero value if we're still
@@ -5702,7 +5703,7 @@ resolve_sal_pc (struct symtab_and_line *
       bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab);
       if (bv != NULL)
 	{
-	  sym = block_function (b);
+	  sym = block_linkage_function (b);
 	  if (sym != NULL)
 	    {
 	      fixup_symbol_section (sym, sal->symtab->objfile);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]