aboutsummaryrefslogtreecommitdiff
path: root/debug/programs/debug.c
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2016-06-30 18:57:24 -0700
committerTim Newsome <tim@sifive.com>2016-07-19 11:24:25 -0700
commit3ed5afdc5b7e2c32bc6facf410c8fa091dd55470 (patch)
tree736738c27c4366d2583b93ea91eb8710b7995a1a /debug/programs/debug.c
parenta8f4c20794b4eff8089f7fedb2d1bb4eff0a08d4 (diff)
downloadriscv-tests-3ed5afdc5b7e2c32bc6facf410c8fa091dd55470.zip
riscv-tests-3ed5afdc5b7e2c32bc6facf410c8fa091dd55470.tar.gz
riscv-tests-3ed5afdc5b7e2c32bc6facf410c8fa091dd55470.tar.bz2
I think I've finally got malloc working right.
Now gdb can call functions and change strings.
Diffstat (limited to 'debug/programs/debug.c')
-rw-r--r--debug/programs/debug.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/debug/programs/debug.c b/debug/programs/debug.c
index 2010eaa..20b1cdc 100644
--- a/debug/programs/debug.c
+++ b/debug/programs/debug.c
@@ -1,11 +1,10 @@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
+#include <stdlib.h>
unsigned int crc32a(uint8_t *message, unsigned int size);
-char __malloc_start[512];
-
void rot13(char *buf)
{
while (*buf) {
@@ -28,8 +27,12 @@ size_t strlen(const char *buf)
return len;
}
+extern void *__malloc_freelist;
+
int main()
{
+ __malloc_freelist = 0;
+
volatile int i = 0;
int j = 0;
char *fox = "The quick brown fox jumps of the lazy dog.";