From fe380dcc43ebf90a53dc13180660ad0710cb7197 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 21 Mar 1997 06:15:27 +0000 Subject: [PATCH] * mn10200-tdep.c (mn10200_analyze_prologue): Look for save of "a1" in the prologue too. --- gdb/ChangeLog | 3 +++ gdb/mn10200-tdep.c | 22 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f23470e0014..2a6e9b34646 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ Thu Mar 20 20:52:04 1997 Jeffrey A Law (law@cygnus.com) + * mn10200-tdep.c (mn10200_analyze_prologue): Look for save of "a1" + in the prologue too. + * remote-sim.c (gdb_os_vprintf_filtered): Fix to work with non-ANSI compilers. (gdb_os_evprintf_filtered): Similarly. diff --git a/gdb/mn10200-tdep.c b/gdb/mn10200-tdep.c index 206e553d2ba..3090597a86d 100644 --- a/gdb/mn10200-tdep.c +++ b/gdb/mn10200-tdep.c @@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ mov fp,a0 mov sp,fp add ,sp - Register saves for d2, d3, a3 as needed. Saves start + Register saves for d2, d3, a1, a2 as needed. Saves start at fp - and work towards higher addresses. Note that the saves are actually done off the stack pointer in the prologue! This makes for smaller code and easier @@ -46,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Without frame pointer: add ,sp - Register saves for d2, d3, a3 as needed. Saves start + Register saves for d2, d3, a1, a2 as needed. Saves start at sp and work towards higher addresses. @@ -325,6 +325,7 @@ mn10200_analyze_prologue (fi, pc) Search for movx d2,(X,a3) (0xf55eXX) then movx d3,(X,a3) (0xf55fXX) + then mov a1,(X,a3) (0x5dXX) No frame pointer case then mov a2,(X,a3) (0x5eXX) No frame pointer case or mov a0,(X,a3) (0x5cXX) Frame pointer case. */ @@ -365,6 +366,23 @@ mn10200_analyze_prologue (fi, pc) if (status != 0) return addr; } + if (buf[0] == 0x5d) + { + if (fi) + { + status = target_read_memory (addr + 1, buf, 1); + if (status != 0) + return addr; + fi->fsr.regs[5] = (fi->frame + stack_size + + extract_signed_integer (buf, 1)); + } + addr += 2; + if (addr >= stop) + return addr; + status = target_read_memory (addr, buf, 2); + if (status != 0) + return addr; + } if (buf[0] == 0x5e || buf[0] == 0x5c) { if (fi) -- 2.30.2