This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
stub for 68EZ328.
- To: "'gdb mail list'" <gdb at sourceware dot cygnus dot com>
- Subject: stub for 68EZ328.
- From: David Williams <davidwilliams at ozemail dot com dot au>
- Date: Sat, 11 Dec 1999 15:57:26 +1100
- Organization: DLC software P/L
- Reply-To: "davidwilliams at ozemail dot com dot au" <davidwilliams at ozemail dot com dot au>
Hi again,
I have got a small stub partially working (thanks to Bill Gatliff). However
there are some problems I need some help with.
1. If I switch to a local stack then my system hangs. I am using the
following code to do this
#define STACKSIZE 400
int localStack[STACKSIZE/sizeof(int)];
int* localStackPtr = &localStack[STACKSIZE/sizeof(int) - 1];
<snip>
#define SAVE_CONTEXT() asm("
movem.l %d0-%d7/%a0-%a7,CPUregisters /* save registers */
lea CPUregisters,%a0 /* get address of registers */
move.l (%sp),66(%a0) /* Save SR to CPUregisters */
move.l 2(%sp),68(%a0) /* Save PC to CPUregisters */
move.l localStackPtr,%sp /* switch to local stack */
");
By simply commenting out the line "move.l localStackPtr,%sp" the system
works. However I have been told I should use a local stack for the stub as
GDB will mess-up my applications stack when GDB does an "inferior function
call". I really don't understand what GDB is doing during an inferior fu
nction call and so dont understand how it corrupts the stack. Any comments
on this would be most welcome.
2. Unforntunately the emulation module built into the 68EZ328 supports only
a single hardware breakpoint. Does GDB ever require to set more than one
breakpoint when stepping through source code? I have noticed that sometimes
it sets a breakpoint and sometimes it uses the step instruction facility.
Is it possible that GDB might need to set two breakpoints when unsure of a
conditional branch?
3. To support hardware watchpoints, I think I will have to make some
changes to GDB source. As ordinary 68000 devices do not support this. Is
this the case? If so where should I start looking?
TIA
David Williams.