www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



digitalmars.D.debugger - [ddbg] lsv shows duplicated variables

↑ ↓ ← Ary Manzana <ary esperanto.org.ar> writes:
Hi!

I don't know if this is the intended behaviour, but for the following code:

---------------------------------------------------------------------
module main;

void main() {
	for(int i = 0; i < 10; i++) {      // Line 4
	}
	for(int i = 0; i < 10; i++) {
	}
	for(int i = 0; i < 10; i++) {      // Line 8
	}
}
---------------------------------------------------------------------

#####################################################################
Loading symbols from main
->bp main:4
Breakpoint set: main.d:4 0x402014
->
Breakpoint set: main.d:4 0x402014
->r
ntdll.dll loaded
KERNEL32.dll loaded
USER32.dll loaded
GDI32.dll loaded
Breakpoint 0 hit at main.d:4 0x402014
         for(int i = 0; i < 10; i++) {
->lsv
Scope: _Dmain
i = 4211075
i = 18
i = 4272652
->
#####################################################################

That is, the "i" variable is shown three times, even though the next two 
aren't visible yet. If you set a breakpoint in a next line, for example 
line 8, the "i" variable is also shown three times. I think one "i" 
should be shown always.

The problem is that I'm integrating ddbg in Descent, and in the 
varaibles view I use the "lsv" command, so the "i" variable appears 
three times. A hack would be, if a variable appears many times, send "= 
i" to the debugger and keep the one with that value, but... if it can be 
fixed in ddbg, much better.
Apr 29 2007
↑ ↓ → Jascha Wetzel <"[firstname]" mainia.de> writes:
DMD doesn't emit symbols for scopes below procedure level (bugzilla
#1201). therefore Ddbg can't tell which one is the right variable.
when evaluating an expression with an ambiguous identifier, Ddbg simply
chooses the first instance it comes across.

the last time i checked, MSVC had the same problem. although CodeView
provides a solution.

Ary Manzana wrote:
 Hi!
 
 I don't know if this is the intended behaviour, but for the following code:
 
 ---------------------------------------------------------------------
 module main;
 
 void main() {
     for(int i = 0; i < 10; i++) {      // Line 4
     }
     for(int i = 0; i < 10; i++) {
     }
     for(int i = 0; i < 10; i++) {      // Line 8
     }
 }
 ---------------------------------------------------------------------
 
 #####################################################################
 Loading symbols from main
 ->bp main:4
 Breakpoint set: main.d:4 0x402014
 ->
 Breakpoint set: main.d:4 0x402014
 ->r
 ntdll.dll loaded
 KERNEL32.dll loaded
 USER32.dll loaded
 GDI32.dll loaded
 Breakpoint 0 hit at main.d:4 0x402014
         for(int i = 0; i < 10; i++) {
 ->lsv
 Scope: _Dmain
 i = 4211075
 i = 18
 i = 4272652
 ->
 #####################################################################
 
 That is, the "i" variable is shown three times, even though the next two
 aren't visible yet. If you set a breakpoint in a next line, for example
 line 8, the "i" variable is also shown three times. I think one "i"
 should be shown always.
 
 The problem is that I'm integrating ddbg in Descent, and in the
 varaibles view I use the "lsv" command, so the "i" variable appears
 three times. A hack would be, if a variable appears many times, send "=
 i" to the debugger and keep the one with that value, but... if it can be
 fixed in ddbg, much better.

Apr 29 2007