This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [7/8] Remove macro SKIP_PROLOGUE
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Fri, 08 Jun 2007 11:11:48 +0200
- Subject: [rfc] [7/8] Remove macro SKIP_PROLOGUE
Hello,
this patch removes SKIP_PROLOGUE macro from gdbarch.sh
ChangeLog:
* gdbarch.sh (SKIP_PROLOGUE): Replace by gdbarch_skip_prologue.
* symtab.c (find_function_start_sal, in_prologue): Likewise.
* linespec.c (minsym_found): Likewise.
* infrun.c (step_into_function): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
Is this ok to commit?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
diff -urN src/gdb/gdbarch.c src.orig/gdb/gdbarch.c
--- src/gdb/gdbarch.c 2007-06-08 05:38:50.000000000 +0200
+++ src.orig/gdb/gdbarch.c 2007-06-08 08:24:20.000000000 +0200
@@ -1278,12 +1278,6 @@
fprintf_unfiltered (file,
"gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
(long) current_gdbarch->skip_permanent_breakpoint);
-#ifdef SKIP_PROLOGUE
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "SKIP_PROLOGUE(ip)",
- XSTRING (SKIP_PROLOGUE (ip)));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: skip_prologue = <0x%lx>\n",
(long) current_gdbarch->skip_prologue);
diff -urN src/gdb/gdbarch.h src.orig/gdb/gdbarch.h
--- src/gdb/gdbarch.h 2007-06-08 05:38:50.000000000 +0200
+++ src.orig/gdb/gdbarch.h 2007-06-08 08:24:20.000000000 +0200
@@ -675,12 +675,6 @@
typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip);
extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip);
extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue);
-#if !defined (GDB_TM_FILE) && defined (SKIP_PROLOGUE)
-#error "Non multi-arch definition of SKIP_PROLOGUE"
-#endif
-#if !defined (SKIP_PROLOGUE)
-#define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
-#endif
typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
diff -urN src/gdb/gdbarch.sh src.orig/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh 2007-06-08 05:38:50.000000000 +0200
+++ src.orig/gdb/gdbarch.sh 2007-06-08 08:25:00.000000000 +0200
@@ -541,7 +541,7 @@
F:=:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache
#
-f:=:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
+f::CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
f::int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0
f:=:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0:
M::CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
diff -urN src/gdb/infrun.c src.orig/gdb/infrun.c
--- src/gdb/infrun.c 2007-06-08 05:38:50.000000000 +0200
+++ src.orig/gdb/infrun.c 2007-06-08 08:25:22.000000000 +0200
@@ -2708,7 +2708,8 @@
s = find_pc_symtab (stop_pc);
if (s && s->language != language_asm)
- ecs->stop_func_start = SKIP_PROLOGUE (ecs->stop_func_start);
+ ecs->stop_func_start = gdbarch_skip_prologue
+ (current_gdbarch, ecs->stop_func_start);
ecs->sal = find_pc_line (ecs->stop_func_start, 0);
/* Use the step_resume_break to step until the end of the prologue,
diff -urN src/gdb/linespec.c src.orig/gdb/linespec.c
--- src/gdb/linespec.c 2007-03-28 02:12:15.000000000 +0200
+++ src.orig/gdb/linespec.c 2007-06-08 08:25:34.000000000 +0200
@@ -1834,7 +1834,8 @@
if (funfirstline)
{
values.sals[0].pc += DEPRECATED_FUNCTION_START_OFFSET;
- values.sals[0].pc = SKIP_PROLOGUE (values.sals[0].pc);
+ values.sals[0].pc = gdbarch_skip_prologue
+ (current_gdbarch, values.sals[0].pc);
}
values.nelts = 1;
return values;
diff -urN src/gdb/symtab.c src.orig/gdb/symtab.c
--- src/gdb/symtab.c 2007-06-06 05:21:54.000000000 +0200
+++ src.orig/gdb/symtab.c 2007-06-08 08:26:06.000000000 +0200
@@ -2521,20 +2521,21 @@
{ /* skip "first line" of function (which is actually its prologue) */
asection *section = SYMBOL_BFD_SECTION (sym);
/* If function is in an unmapped overlay, use its unmapped LMA
- address, so that SKIP_PROLOGUE has something unique to work on */
+ address, so that gdbarch_skip_prologue has something unique to work
+ on */
if (section_is_overlay (section) &&
!section_is_mapped (section))
pc = overlay_unmapped_address (pc, section);
pc += DEPRECATED_FUNCTION_START_OFFSET;
- pc = SKIP_PROLOGUE (pc);
+ pc = gdbarch_skip_prologue (current_gdbarch, pc);
/* For overlays, map pc back into its mapped VMA range */
pc = overlay_mapped_address (pc, section);
}
sal = find_pc_sect_line (pc, SYMBOL_BFD_SECTION (sym), 0);
- /* Check if SKIP_PROLOGUE left us in mid-line, and the next
+ /* Check if gdbarch_skip_prologue left us in mid-line, and the next
line is still part of the same function. */
if (sal.pc != pc
&& BLOCK_START (SYMBOL_BLOCK_VALUE (sym)) <= sal.end
@@ -4022,7 +4023,7 @@
- The minimal symbols and partial symbols, which can usually tell
us the starting and ending addresses of a function.
- If we know the function's start address, we can call the
- architecture-defined SKIP_PROLOGUE function to analyze the
+ architecture-defined gdbarch_skip_prologue function to analyze the
instruction stream and guess where the prologue ends.
- Our `func_start' argument; if non-zero, this is the caller's
best guess as to the function's entry point. At the time of
@@ -4040,7 +4041,7 @@
if (! func_start)
return 1; /* We *might* be in a prologue. */
- prologue_end = SKIP_PROLOGUE (func_start);
+ prologue_end = gdbarch_skip_prologue (current_gdbarch, func_start);
return func_start <= pc && pc < prologue_end;
}
@@ -4064,7 +4065,8 @@
/* We don't have any good line number info, so use the minsym
information, together with the architecture-specific prologue
scanning code. */
- CORE_ADDR prologue_end = SKIP_PROLOGUE (func_addr);
+ CORE_ADDR prologue_end = gdbarch_skip_prologue
+ (current_gdbarch, func_addr);
return func_addr <= pc && pc < prologue_end;
}