From a0f7585ae11c960607a83c09844bf8c203308f08 Mon Sep 17 00:00:00 2001 From: mpabi Date: Sat, 25 May 2024 20:12:41 +0000 Subject: [PATCH] gdb tested ;) --- cpp/_rvmain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/_rvmain.cpp b/cpp/_rvmain.cpp index 1cd6766..338a5e7 100644 --- a/cpp/_rvmain.cpp +++ b/cpp/_rvmain.cpp @@ -131,6 +131,7 @@ int alg(char *ptr) { char *token = simple_strtok(ptr, delims); while (token != (char *)NULL) { + p[pos].ptr = token; p[pos].len = strlen(token); ++pos; token = simple_strtok((char *)NULL, delims); @@ -138,7 +139,9 @@ int alg(char *ptr) { return pos; } - +// gdb: p/x (model[]*)p[0].len +// gdb: p/s (char *)(model[]*)p[2].ptr +// :) powered by rv32i int main() { char *str = " Success is often defined as the ability to reach your goals in life, whatever those goals may be. In some ways, a better word for success might be attainment, accomplishment, or progress. It is not necessarily a destination but a journey that helps develop the skills and resources you need to thrive."; alg(str);