From 79b2bcf37a2cb567e3f92f2515b4ff7fd163aea3 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 10 Oct 2024 15:11:22 -0700 Subject: [PATCH] fix incorrect alignment assumption in arena --- src/base/base_arena.c | 3 ++- src/raddbg/raddbg_main.c | 49 +++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/base/base_arena.c b/src/base/base_arena.c index 28eb6e83..02153650 100644 --- a/src/base/base_arena.c +++ b/src/base/base_arena.c @@ -105,7 +105,8 @@ arena_push(Arena *arena, U64 size, U64 align) // rjf: commit new pages, if needed if(current->cmt < pos_pst && !(current->flags & ArenaFlag_LargePages)) { - U64 cmt_pst_aligned = AlignPow2(pos_pst, current->cmt_size); + U64 cmt_pst_aligned = pos_pst + current->cmt_size-1; + cmt_pst_aligned -= cmt_pst_aligned%current->cmt_size; U64 cmt_pst_clamped = ClampTop(cmt_pst_aligned, current->res); U64 cmt_size = cmt_pst_clamped - current->cmt; os_commit((U8 *)current + current->cmt, cmt_size); diff --git a/src/raddbg/raddbg_main.c b/src/raddbg/raddbg_main.c index b1922892..ed25924c 100644 --- a/src/raddbg/raddbg_main.c +++ b/src/raddbg/raddbg_main.c @@ -7,7 +7,6 @@ // [ ] remainder of @msgs pass: // [ ] entity listers - kill-specific-process, etc. // [ ] new universal ctx menu, hover, tooltips systems -// [ ] fix memory view // [ ] `switch` replacement (recent files history) // [ ] resolving name as file or #include // [ ] new `restart processes` path @@ -27,31 +26,6 @@ // because you're like "wait why did it stop" and then you later remember // that's because there was a function breakpoint there. // [ ] debugger readme pass -// -// -// -// [x] codebase readme pass -// [x] target editor -// [x] modules view -// [x] eval writing/committing -// [x] breakpoint hit count resetting -// [x] reset bp hit counts - not just on NewProcess, but on RUN! because -// we are now evaluating them on the control thread... -// [x] fix bug where text info is evicted, and switching back to a tab scrolls -// to the top -// [x] reset bp hit counts - not just on NewProcess, but on RUN! because -// we are now evaluating them on the control thread... -// [x] fix bug where text info is evicted, and switching back to a tab scrolls -// to the top -// [x] targets view -// [x] ensure launch controls parameterize commands correctly) -// [x] ensure ctrl+click -// [x] scheduler view -// [x] eval committing -// [x] fix registers -// [x] file overrides -> always pick most specific one! found with conflicting -// overrides, e.g. C:/devel/ -> D:/devel/, but also C:/devel/foo -> -// C:/devel/bar, etc. //////////////////////////////// //~ rjf: post-0.9.12 TODO notes @@ -525,6 +499,29 @@ // [x] file path map editor // [x] file path map building // [x] meta eval system +// [x] codebase readme pass +// [x] target editor +// [x] modules view +// [x] eval writing/committing +// [x] breakpoint hit count resetting +// [x] reset bp hit counts - not just on NewProcess, but on RUN! because +// we are now evaluating them on the control thread... +// [x] fix bug where text info is evicted, and switching back to a tab scrolls +// to the top +// [x] reset bp hit counts - not just on NewProcess, but on RUN! because +// we are now evaluating them on the control thread... +// [x] fix bug where text info is evicted, and switching back to a tab scrolls +// to the top +// [x] targets view +// [x] ensure launch controls parameterize commands correctly) +// [x] ensure ctrl+click +// [x] scheduler view +// [x] eval committing +// [x] fix registers +// [x] file overrides -> always pick most specific one! found with conflicting +// overrides, e.g. C:/devel/ -> D:/devel/, but also C:/devel/foo -> +// C:/devel/bar, etc. +// [x] fix memory view //////////////////////////////// //~ rjf: Build Options