-
-
Notifications
You must be signed in to change notification settings - Fork 545
Open
Labels
type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the problem
After starting debugging, global variables with addresses equal to the start of the .bss and .data segments are not displayed in the VARIABLES debugging pane.
To reproduce
I will describe three ways to reproduce the problem. The first one uses standard Arduino software only with additional hardware, the second uses additional software tools with extra hardware, and the third one uses software only; however, some software is 3rd party.
Use the sketch below.
#define LED LED_BUILTIN
byte thisByte = 0;
byte otherByte = 0;
byte store[2] = {1,2};
byte hiddenByte;
byte hiddenStore[2] = {1,2};
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
int i=digitalRead(1)+20;
digitalWrite(LED, HIGH);
delay(1000);
thisByte = thisByte + i + store[i%2];
digitalWrite(LED, LOW);
thisByte = thisByte + i + 1 + hiddenByte + hiddenStore[i%2];
i = i*5;
thisByte = thisByte - 3;
otherByte = thisByte;
delay(100+thisByte+otherByte);
}
- Use Arduino Zero: Select the right board in the boards manager. (Compile and) upload sketch and start debugging. Click on
Pausein theDebugging Control Panel. Click onGlobalin theVariablespane.hiddenSortis not displayed. As one can verify usingarm-none-eabi-objdump -x, the address ofhiddenSortcoincides with the.datasegment. There is no variable with an address coinciding with the.bsssegment. - Use Atmega328P Xplained Mini (or 168PB or 328PB): Add https://felias-fogg.github.io/package_debugging_index.json to the list of
Additional boards manager URLs. Install the additional coreAtmel AVR Xplained-minis (Debug enabled)in theBoards manager. In the boards manager, select the appropriate board. In theToolsmenu selectCompiler LTOand chooseLTO disabled, in order to enable that global variables are displayed (I believe that this is another bug!). Compile and start debugging. Click onGlobalin theVariablespane.hiddenStoreandhiddenByteare not displayed. As one can verify usingavr-objdump -x, the address ofhiddenStorecoincides with the.datasegment and the address ofhiddenBytecoincides with the.bsssegment. - Use
simavrsimulator: Do everything as described in (2), but stop before "Compile and start debugging". ChooseSimulator (simavr)as theProgrammerin theToolsmenu. Now compile and start debugging. Then continue as described in (2), which will have the same outcome.
Expected behavior
The expected behavior is that the variables hiddenByte and hiddenStore are displayed.
Arduino IDE version
2.3.7-nightly
Operating system
macOS
Operating system version
15.7.1
Additional context
Mac mini M2 (not that this matters)
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details
Metadata
Metadata
Assignees
Labels
type: imperfectionPerceived defect in any part of projectPerceived defect in any part of project