aboutsummaryrefslogtreecommitdiff
path: root/debug/programs
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-06-10 14:06:13 -0700
committerTim Newsome <tim@sifive.com>2016-07-18 18:51:54 -0700
commitc11808e013c7c34161d9f343cd97d5f2440c4c2e (patch)
treeb4a094824e7518e1364cb6d4dd8c759fee42e036 /debug/programs
parent6ccc0bdde5eea898e88961f49e755bd2b4577792 (diff)
downloadriscv-tests-c11808e013c7c34161d9f343cd97d5f2440c4c2e.zip
riscv-tests-c11808e013c7c34161d9f343cd97d5f2440c4c2e.tar.gz
riscv-tests-c11808e013c7c34161d9f343cd97d5f2440c4c2e.tar.bz2
Make tests work with broken 32-bit compiler.
Apparently the 32-bit compiler doesn't generate good enough debug info for gdb to know what function we're in, which also means it doesn't know where the local variables in those functions are stored.
Diffstat (limited to 'debug/programs')
-rw-r--r--debug/programs/debug.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/debug/programs/debug.c b/debug/programs/debug.c
index afca484..c7c23a6 100644
--- a/debug/programs/debug.c
+++ b/debug/programs/debug.c
@@ -26,10 +26,14 @@ size_t strlen(const char *buf)
return len;
}
+// TODO: These should be local to main, but if I make them global then gdb can
+// find them.
+static volatile int i;
+static int j;
int main()
{
- volatile int i = 0;
- int j = 0;
+ i = 0;
+ j = 0;
char *fox = "The quick brown fox jumps of the lazy dog.";
unsigned int checksum = 0;