-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messed up static / global variable preview and when using watch #11
Comments
Yeah, there are some limitations. |
So I assume I must somehow merge my sections. I'm an elf/hunk noob so after a bit of reading I still don't know which way I should go. Could you tell me if there's something wrong only with my hunk, or is the root cause in elf file? My elf has following sections:
My hunk has following contents:
|
Hmm.. it seems you have 3 data hunks. 2 is generally ok (1 regular, 1 chipmem), however only the first data hunk will support relocation with GDB. |
A bit of progress here. I was building using CMake and linked some .c files into a library, which in turn was linked with executable's .c files. When I changed CMake library generation to object-style library (just a bunch of .o files), I've got rid of one data hunk. It still didn't helped me, though. Upon closer inspection I see that your .elf doesn't have // some magic to ensure that code gets generated
volatile int *pAddr = (volatile int *)0xDEAD;
static const char *s_pReadOnly[] = {
"Joy 1", "Joy 2", "Joy 3", "Joy 4", "WSAD", "Arrows", "CPU", "Idle", "Off"
};
const char* returnReadOnly(void) {
return s_pReadOnly[*pAddr];
} then call those fns from main.c like: const char* returnReadOnly(void);
KPrintF("Hello debugger from Amiga! %s\n", returnReadOnly());
KPrintF("Hello debugger from Amiga! %s\n", returnReadOnly()); Build using your makefile. When stepping through code, preview of |
I've modified linker script so that it will merge .data and .rodata sections:
Now my Hunk has following sections:
Now the only difference between my hunk and yours from example project is that you don't have HUNK_RELOC32 in data hunk, and I have one section less than you (no incbin one since I use files). I've tried to merge .data and .text sections but then the debugger breakpoints stopped working. Any ideas? |
your hunks look fine to me. what's the problem still? |
The problem is a mismatch between watch / variable view's addresses and true addresses, as in picture below My code from #11 (comment) should reproduce that in your example too, when put into separate file. |
Completely reworked the relocation in 2a4d42b. Should now support arbitrary number of sections/hunks. Please try the new version and close issue if resolved. Also, |
Would it be too much if I ask you for an extension build? Or some kind of instructions how to build it and generate vsix? All my changes so far were based on modifying .js files directly and backporting changes to .ts for pull request. I Guess I'll have to set it up correctly now. |
Sure. Try this. |
If that's too complicated for you, just get |
works! 🎉 |
Hi,
I'm having some problems with debugger features:
I'm using custom CMake to generate .map, .elf and hunk files in similar manner as your makefile, but perhaps I've messed up something. I'll try to debug it myself but I need a little guidance from you. How does vscode know at which address is given static/global/local variable?
-m68000 -fomit-frame-pointer -nostdlib -Wno-unused-function -Wno-volatile-register-var -fno-tree-loop-distribution -flto -fwhole-program -Wno-old-style-declaration
-Wl,--emit-relocs,-Ttext=0
-Wl,-Map=germz.map
linker flag.${OBJDUMP} --disassemble -S ${GERMZ_EXECUTABLE} > germz.s
to generate disassembly, where${OBJDUMP}
is objdump from your compiler suite.EDIT: The local variables are most of the time okay, the problem is with static/global vars.
The text was updated successfully, but these errors were encountered: