summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-04-27 00:12:54 +0000
committerAndrew Cagney <cagney@redhat.com>2002-04-27 00:12:54 +0000
commitb6779aa27612fca67374dd122b13ba309008bd4e (patch)
tree66f20a3590ff8e33dd78fdbc1038697acfef8e6a
parente32eb77491360689fa512e51958bfc20844597ac (diff)
downloadppe42-binutils-b6779aa27612fca67374dd122b13ba309008bd4e.tar.gz
ppe42-binutils-b6779aa27612fca67374dd122b13ba309008bd4e.zip
* x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging
code without frame pointers.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/x86-64-tdep.c22
2 files changed, 24 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 99733a9e82..41c04ea943 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2002-04-26 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging
+ code without frame pointers.
+
2002-04-26 Andrew Cagney <ac131313@redhat.com>
* sparc-tdep.c (sparc_gdbarch_init): Add comment explaining why
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index cbca04eee7..f30b85e618 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -116,6 +116,9 @@ static struct register_info x86_64_register_info_table[] = {
int x86_64_num_regs = X86_64_NUM_REGS;
int x86_64_num_gregs = X86_64_NUM_GREGS;
+/* Did we already print a note about frame pointer? */
+int omit_fp_note_printed = 0;
+
/* Number of bytes of storage in the actual machine representation for
register REGNO. */
int
@@ -811,10 +814,23 @@ x86_64_skip_prologue (CORE_ADDR pc)
read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE);
- /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */
- for (i = 0; i < PROLOG_BUFSIZE; i++)
- if (prolog_expect[i] != prolog_buf[i])
+ /* First check, whether pc points to pushq %rbp. If not,
+ * print a recommendation to enable frame pointer. */
+ if (prolog_expect[0] != prolog_buf[0])
+ {
+ if (!omit_fp_note_printed)
+ {
+ printf_filtered
+ ("NOTE: This function doesn't seem to have a valid prologue.\n"
+ " Try to add -fno-omit-frame-pointer tou your gcc's CFLAGS.\n");
+ omit_fp_note_printed++;
+ }
return pc;
+ }
+ /* Valid prolog continues with movq %rsp,%rbp. */
+ for (i = 1; i < PROLOG_BUFSIZE; i++)
+ if (prolog_expect[i] != prolog_buf[i])
+ return pc + 1; /* First instruction after pushq %rbp. */
v_function = find_pc_function (pc);
v_sal = find_pc_line (pc, 0);
OpenPOWER on IntegriCloud