Community
Participate
Working Groups
Build Identifier: 8.01 I was debugging hardware (bios) from the reset vector, when trying to set watchpoints in a ram stage debug, and I got doubled variables in the variable view (in the example code below, variable1 would be doubled, one on top of the table and one on bottom of the table). If I try to click on one of these variables in order to set a watchpoint, the highlighting flickers rapidly between the two variables and a watchpoint can't be set. The code being debugged looks like: void foo(int variable1); void foo(int variable1) { //do stuff } Looking at a GDB console, I can see that GDB is only aware of one variable named variable1, so it appears there's something strange in the CDT handling code. Reproducible: Always Steps to Reproduce: 1. Attach a debug session through GDB to a remote target. 2. Ensure the target is at or near the reset vector. 3. Let the target run somewhere into early BIOS startup, where there is source code present. (This problem does not happen after the BIOS is loaded). 4. Look at the Variables tab in the debug view, there should be two copies of at least on variable. 5. Left click on one copy of the doubled variable, the highlighting will flicker.
Could you post the gdb traces? http://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F Thanks
Created attachment 210819 [details] GDB Traces of problem Here are the GDB traces as requested. I've taken out some sideband commands that we're sending that don't affect the debugging through GDB and changed file names.
What is the variable name that is duplicated? There is no 'variable1' in the traces.
Apologies. The doubled variable is boot_complete.
I may be missing something, but according to the trace 'boot_complete' is an argument of 'hardwaremain' function. If this is correct 'boot_complete' should not be reported as a local variable in 960,284 64-stack-list-locals --thread 1 --frame 0 1 960,303 64^done,locals=[{name="lb_mem",value="0x1001fe"},{name="boot_complete",value="0"}]
(In reply to comment #5) > I may be missing something, but according to the trace 'boot_complete' is an > argument of 'hardwaremain' function. If this is correct 'boot_complete' should > not be reported as a local variable in > > 960,284 64-stack-list-locals --thread 1 --frame 0 1 > 960,303 > 64^done,locals=[{name="lb_mem",value="0x1001fe"},{name="boot_complete",value="0"}] Unless it is also declared as a local variable, shadowing the argument. This would explain the double entry in the debug view. We handle two local variables with the same name by only showing one, but we don't handle one local variable and one argument.
See bug 368565 comment 2: "This is related to Bug 210976, except that in your case one variable is an argument while the other is a local variable." *** This bug has been marked as a duplicate of bug 368565 ***
Thanks Mikhail for noticing the variable was also a parameter.