-
Notifications
You must be signed in to change notification settings - Fork 243
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
Could not step over: TypeError: Cannot read property 'file' of undefined #263
Comments
Could you add Output from JLinkGDBServer (Output Tab, Adapter Output) can also be helpful |
I have just tried to set the showDevDebugOutput to true and run the example again. I have put a breakpoint at the mentioned function. I then tried to single step 3 times, but no luck. The debug output is attached to this message. |
Just tested again using the n and s commands in the Debug Terminal. It still works like a charm. I just noticed that the commands send to the debugger is somewhat different. Using the step button:
Using the n command:
Perhaps this can be of some help? |
The debug-log.txt is incomplete I think. I see no next instruction to gdb. There should be something like |
Yes, thats is correct. If I look into the gdb.ts and mi2.ts files, then it looks like there is some kind of parsing error which leads to the exception in line 1852 of gdb.ts, which tries to reference the 'file' attribute of the frame object. This fails for some reason. The frame object might also be 'udefined'. I'm not very much into the inner-stuff of these VSC plug-ins, but I'm very keen on getting to debug the plug-in. Do you know of a method on how to do that? |
Thanks so much. My gdb.ts has moved on in my fork. You are talking about this line right? The file attribute being From your debug log, it appears getting the frame actually succeeded and, it does have a file attribute.
|
Could you tell me the exact version of gdb you are using? I see you are using
|
One other trick. If I am having issues, just before I use an action, I clear the debug console, make that action (in your case click on the button) and see what comes out. Reduces the amount of info to look at, but not always the right thing because the problem may have started a bit before |
I'm very keen on getting to debug the actual cortex-debug extension. But I'm a total NOOB on this. I tried to find some examples on the internet, but until now I had no luck. I would very much like to help getting this extension to its maximum, since I think it is super and a crucial tool in general Arm embedded software development. Can you somehow, either walk me thru it, or point me in the right direction? Any help on this would be very much appreciated. |
I have just dumped the GDB version information:
|
Steps
Remember to remove the debugServer line after you are done |
Hmmm, got the extension debugging environment up and running. But now the issue is not there. Wierd. But perhaps the extension runs in a different "mode"? |
The whole thing did not make sense to me. Yesterday, I started suspecting a corrupt download/extension. Could you try un-installing the extension and re-installing it? I would even nuke the direcotries ~/.vscode/extensions/marus25.cortex-debug* before a re-install. |
I just did now. Nuking the extension directory and restarting VS code several times in between. Still the same problem. It is really weird and it only happens with What if I tried to build and install the extension locally from the Github clone? If so, can you advise on instructions on how to do it? |
Yes, the runtime environment is a bit different. Before you do that, could you try the following? Download the following VSIX file... https://github.com/haneefdm/cortex-debug/releases/tag/v0.3.6-pre1 See if that works. You download the file and use the Command Palette to load VSIX file manually |
Just did. Same problem. "The plot thinkens". I just did a small comparison of the Debug output from when I'm running in a clean release environment (the one failing) and in the extension debugging environment. I have just included them here. I can not see anything which stands out - at least not with my knowledge. |
Do you have another computer you can try this on? |
Yes, but this would take some time - not today. But I can have it running on monday afternoon (tomorrow). I would like to try to compile and install the extension locally, can I do that and how? |
I will take a look at the files you attached, maybe later tonight (few hours) Steps. From memory. You have to install the vsce package (I think globally) and then package it which creates a vsix file. I forget the exact syntax. But, once you have a VSIX file, then you can install it manually
|
Yes, my pre-release is to address this issue. Last week, VSCode broke how hover works in an editor and asking for total junk to be evaluated. My pre-release mitigates that somewhat. Keep your mouse away from the editor while you are trying to figure out what is going on. |
I don't think you are using the latest source. I don't see the timestamps in the log files you attached. |
I have removed the time stamps to be able to do a meaningful file compare - sorry for the inconvenience. Thanks for the good afvises. I will try to debug further and also try on another computer. I am having an idea of adding some debug output to the code (extension code), but I’m a bit confused as to how to do that when running in the release environment. Can you point me a direction of some ‘printf-like’ mechanism in the TypeScript system? |
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] First of all: This is great extension to make easier everything. Thank you! Unfortunately I have the same problem. I also test the v0.3.6-pre release to make sure. And I tried the GCC/GDB v6 and v7. |
I have a NUCLEO-F429ZI board, wonder if anyone can help me duplicate the problem. |
According to your directions, I did some debug and it seems some static functions have not been loaded to the "staticFuncs" list of the symbols.ts. I am nor sure why. Maybe the proejct size can effect the result. |
@stalyatech Hmmm, but Cortex-Debug can work without even knowing any symbols or even source code. Also, to do a step or next we, don't even need the symbols. Sure you will not see good variables/watch windows but... function symbols (global or static) are only needed for disassembly. Could you share your executable (elf file) so I can see what is going on? In case there is some other issue |
Ok. the problem is symbol loader fills the lists (allSymbols and staticFuncs) with filename without the sub directory. But "getFunctionByName" search the symbol list with sub directory. so it doesn't find the symbol (the function name that next code will be executed) in the list. I am not expert of the ts. I just made simple touch to the "getFunctionByName" code such as:
After that everything seems perfect :) |
@stalyatech You are more than likely on to something. But is not the right solution. You can have multiple files have the same base name with the same function/file names. Happens in auto-generated files and libraries Thanks for your help. I wish I could have an executable or even the output of objdump. I think @Lykkeberg attached one, that I will have to dig through. I created many static functions and I could not duplicate this. There are two problems here that I need to dig into. First, I have to have a proper elf file. Thank you all, I will check back after a few hours of sleep. |
@haneefdm thanks for your working again. I attached the my elf file. maybe it can help you for digging. |
@haneefdm the problem is |
No, in this case I see another issue. The singlestepping feature does not show the .cdasm file, but rather the .cdasm file from the calling module. The stepping feature works though. |
Minor update. The output of objdump is so huge, that it is getting truncated by Node.js, so many path-names, symbols are not even seen/parsed. Working on it. |
I need some help. I will really appreciate the help. I may have something that you @Lykkeberg @stalyatech could try. Looks like you can run from my fork repo source without me having to make a release. I can clean up and commit soon and let you know when ready. @stalyatech your executable is ginormous. It takes 2.4 seconds to get symbols info from it. It overflows the Node.js buffers as well. I have a super-fast laptop. We are tied to Javascript so, not built for performance. I am experimenting with a caching mechanism. |
I'm ready to help out - just say the word :-) |
Fingers crossed. https://github.com/haneefdm/cortex-debug |
I'm ready to test :) |
Great news. I just tested with the exact same piece of code, and the exact same piece of HW, and the exact same breakpoint and single stepping operations. It works like a charm. I can now single step and step-into functions, both static and non-static. Great job :-) I will spend the rest of my day, working on a project which needs this cortex-debug. I will report back this evening then. |
Great job :-) @haneefdm It is a perfect tool :) |
Thanks, guys. Could you also make sure static variables are also being displayed properly? |
Hi @haneefdm First: Second: They both happen when I'm setting breakpoints when the target is running. The break points are set though, but these errors pop up. |
Thanks. Hmmm. Something changed in VSCode recently. I will look into it. I think setting breakpoints requires us to pause, set bkpt and then continue. The pause, however, causes all kinds of activity. All windows try to update themselves but by that time, the program is running again. Not all windows are controlled by Cortex-Debug but the registers window is. It is harmless though but should be avoided if at all possible |
I am making some performance improvements for loading symbols. Again, has to do with statics. It is far too slow for my taste. Hopefully, when I am done, you can help me test the stuff again. |
Great job. Yes, I will most certainly help you debug and test it again - you just say when :-) |
Okay, we are ready for the next test round. I pushed everything to https://github.com/haneefdm/cortex-debug Things to expect
Cached results are stored in your systems TMP dir and each OS has different policies on how they purge so, once in a while (after reboot or X days after created). But, one time hit even if purged. Thank you in advance. I hope you are doing well with the pandemic. Be safe |
@haneefdm I am facing the same problem, and I tried out the fix as well. It definitely fixes the problem when stepping during debug. Thanks for the active support! The only issue that remains for me is the following error message popping up: However, this is not a blocking issue and seems to be ignorable for now. |
@haneefdm everything seems great. Stepping in static functions, evaluating the static variables, huge symbol file loading are working just like a charm :) Thank you for great job I hope everyone are doing well with the pandemic |
Hi @haneefdm. I have now been using the 0.3.6-pre3 build for a day now. It certainly load the elf files much faster - yay. No problems until now. This is looking very promising. And again - thanks a million for all the nice work. The Covid-19 is pulling some teeth now, since I have been working from home almost 3 weeks now. I hope that you all are well. |
You are all awesome. Wish you well. One more round of changes and looking into the popups that @Lykkeberg mentioned. Other popups too. They are non-invasive but should not be happening. Ideally. |
@Yocairo Could you describe the steps to reproduce this popup you are seeing? What was going on when you saw that popup? Also, your launch.json would be helpful
|
@haneefdm Sure, I am just debugging as normal. It seems to only occur when I'm quickly stepping through code (spamming the step over key). launch.json: Note: the debugServer entry was to use the source extension you provided above. |
Thanks. I was able to duplicate. Problem is that whenever the debugger pauses the program (due to step, breakpoint, etc.) all windows try to update themselves. The problem is some requests are coming when the debugger had already started running again and not all windows have finished updating. The solution is not elegant but I will try. |
I just pushed out 0.3.6.pre4 on my fork. https://github.com/haneefdm/cortex-debug.git
The second change above means that static functions single-stepping could be affected. No change for static variables which were already cached. |
Just made a PR #267 all the changes are in there. Hope to make a release soon. |
Fix for issue #263 and avoiding unneeded popups
0.3.6 is released. Thank you all. Please re-open if needed |
Fix for issue Marus#263 and avoiding unneeded popups
Compiler: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 7.3.1 20180622 (release)
Host OS: macOS Cataline (10.15.3)
VSC: 1.43.1
J-Link: 6.65b (other version tried as well)
Target CPU: Dialog DA14585
cortex-debug: v0.3.5
First of all: thanks a million for this great plug-in!
Got this error while single stepping a C code project with-in a static function. It works fine outside the static functions.
The specific function in this case, which can not be single-stepped is
static void setup_bme680(void)
I have included the .out file here for your help:
bme680-driver-design_585.out.zip
I have compiled with -O0 and -g3.
My launch.json file looks like this:
launch.json.zip
When I use the Debug terminal and enter i/n commands, single stepping works just like a charm, just not in the VSC UI.
The text was updated successfully, but these errors were encountered: