www.digitalmars.com         C & C++   DMDScript  

D - Um. "Error: Access Violation", no other information, doesn't even

reply SL <shadowlord13 users.sourceforge.net> writes:
So I'm running the debug version of this program here I just compiled, 
and I get "Error: Access Violation", no other information, doesn't even 
ask if I want to debug it, the program just prints that and exits.

It was compiled with the following command:
dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d 
windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more

I attempted to debug it with VCPP6SE, but it didn't seem to find any 
symbols and showed me a disassembly of the program, which I was 
disinclined to try to trace through - I compiled it debug and all that 
for a reason. :/

I wonder if it's trying to access this object before it's initialized... 
*adds checks* nope.

I wonder if it's because of the synchronized(someobjecthere) {} stuff 
which was accessing said object... *comments them out* nope.

Hmmm. Oh how I wish that "Error: Access Violation" was an exception 
which would give me filenames and line numbers. *continues fiddling to 
try to find the cause*
Mar 24 2004
next sibling parent reply C <dont respond.com> writes:
I usually get this error when forgetting to 'new' something.  But i feel=
 =

your pain, this single oversight could cause hours of searching , almost=
 =

nullifying the reduced development time of using D :/.  I think someone =

mentioned something about the error messages getting beefed next release=
 =

<crosses fingers> .

OT, id like to learn about the math they use for astrononmy =

( this.getHE=3Dmass*sunHU*(1/(pow(pow(1.9,(uint)orbit),2))); ) , is ther=
e a =

good book you can recommend for a complete newb ?  Is it possible I can =

take a look at your code ?

Thanks,
Charlie

On Wed, 24 Mar 2004 13:20:09 -0500, SL =

<shadowlord13 users.sourceforge.net> wrote:

 So I'm running the debug version of this program here I just compiled,=

 and I get "Error: Access Violation", no other information, doesn't eve=

 ask if I want to debug it, the program just prints that and exits.

 It was compiled with the following command:
 dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d =

 windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more

 I attempted to debug it with VCPP6SE, but it didn't seem to find any =

 symbols and showed me a disassembly of the program, which I was =

 disinclined to try to trace through - I compiled it debug and all that=

 for a reason. :/

 I wonder if it's trying to access this object before it's initialized.=

 *adds checks* nope.

 I wonder if it's because of the synchronized(someobjecthere) {} stuff =

 which was accessing said object... *comments them out* nope.

 Hmmm. Oh how I wish that "Error: Access Violation" was an exception =

 which would give me filenames and line numbers. *continues fiddling to=

 try to find the cause*

-- = D Newsgroup.
Mar 24 2004
next sibling parent SL <shadowlord13 users.sourceforge.net> writes:
C wrote:
 I usually get this error when forgetting to 'new' something.  But i feel 
 your pain, this single oversight could cause hours of searching , almost 
 nullifying the reduced development time of using D :/.  I think someone 
 mentioned something about the error messages getting beefed next release 
 <crosses fingers> .
 
 OT, id like to learn about the math they use for astrononmy ( 
 this.getHE=mass*sunHU*(1/(pow(pow(1.9,(uint)orbit),2))); ) , is there a 
 good book you can recommend for a complete newb ?  Is it possible I can 
 take a look at your code ?
 

I just played with numbers until it looked mostly-right. That isn't an actual formula they use for astronomy. (It's supposed to be "heat units" that the planet gets from the sun, so I used an inverse square law, but I probably should multiply by 1/2 surface area or something instead of mass...) The only actual normally-used formulas I used were for sphere volume and surface area, and even then I was just forcing volume to equal mass. (real radius=pow((volume*3)/(4*PI),1/3); this.surfaceArea=4*PI*radius*radius;)(This doesn't need to be perfect, I'm just playing around) Mass distribution isn't accurate either, mmm... The sun is supposed to be 99 or 98% of the mass in the solar system, or something, I think. I've got it at 50% ATM. Oh, and I'm
Mar 25 2004
prev sibling next sibling parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
C wrote:
 I usually get this error when forgetting to 'new' something.  But i feel 
 your pain, this single oversight could cause hours of searching , almost 
 nullifying the reduced development time of using D :/.  I think someone 
 mentioned something about the error messages getting beefed next release 
 <crosses fingers> .

Also look for lines like: assert(obj != null); or assert(obj == null); This has bitten me a couple of times. Unfortunately, what happens here is that == and != are the compare-by-value operators. Thus, what you are really saying is: assert(obj.member1 == (cast(WHATEVER)null).member1 && obj.member2 == (cast(WHATEVER)null).member2 && obj.member3 == (cast(WHATEVER)null).member3 ... ); Of course, this will segfault (a.k.a. "Access Violation") when it tries to read the first member of the "null" object. So what you really need instead is: assert(obj !== null); or assert(obj === null); which are the compare-by-pointer operators.
Mar 25 2004
parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Russ Lewis wrote:

 C wrote:

 I usually get this error when forgetting to 'new' something.  But i 
 feel your pain, this single oversight could cause hours of searching 
 , almost nullifying the reduced development time of using D :/.  I 
 think someone mentioned something about the error messages getting 
 beefed next release <crosses fingers> .

Also look for lines like: assert(obj != null); or assert(obj == null); This has bitten me a couple of times. Unfortunately, what happens here is that == and != are the compare-by-value operators. Thus, what you are really saying is: assert(obj.member1 == (cast(WHATEVER)null).member1 && obj.member2 == (cast(WHATEVER)null).member2 && obj.member3 == (cast(WHATEVER)null).member3 ... ); Of course, this will segfault (a.k.a. "Access Violation") when it tries to read the first member of the "null" object. So what you really need instead is: assert(obj !== null); or assert(obj === null); which are the compare-by-pointer operators.

assert(obj); or assert(!obj); -- -Anderson: http://badmama.com.au/~anderson/
Mar 25 2004
parent reply Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
J Anderson wrote:
 Or just
 assert(obj);
 or
 assert(!obj);

When you assert(obj), the compiler does NOT check obj against null...it just runs ahead and starts testing it. So assert(obj); will get Access Violation if obj === null. :(
Mar 25 2004
parent J Anderson <REMOVEanderson badmama.com.au> writes:
Russ Lewis wrote:

 When you assert(obj), the compiler does NOT check obj against 
 null...it just runs ahead and starts testing it.

 So
     assert(obj);
 will get Access Violation if obj === null.

 :(

assert(obj) in C++ and I always think of objects as pointers in D. We also want to encourage users to take the efficient option. The == and === should stay as they are. In this example: test t; // = new test; if (t) {} It's correct, so why change it for assert? There seems to be some double standards here. -- -Anderson: http://badmama.com.au/~anderson/
Mar 25 2004
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
C wrote:

 I usually get this error when forgetting to 'new' something.  But i feel 
 your pain, this single oversight could cause hours of searching , almost 
 nullifying the reduced development time of using D :/.  I think someone 
 mentioned something about the error messages getting beefed next release 
 <crosses fingers> .

I agree, I too drive myself mad finding the cause of my access violations, only to finally kick myself that I'm following a reference to nowhere. A few ideas: - The compiler ought to be able to try to detect whether an object reference is null when it is used. If it's definitely null (like it's just been declared and there's nowhere it could've been assigned) it would report an error. - For situations where the nullness can't be determined at compile-time, it would implicitly stick an assert(obj) before each member use. Except that it would throw a new type, we could call it NullReferenceError, instead of AssertError. Just like AssertError at least, it would report the filename and linenumber. Of course, just like an assert or ABC, the check would be taken out for the release build. Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
Mar 29 2004
parent Manfred Nowak <svv1999 hotmail.com> writes:
Stewart Gordon wrote:

[...]
 Except that it would throw a new type, we could call it NullReferenceError, 
 instead of AssertError.

I am totally with you. So long!
Mar 30 2004
prev sibling next sibling parent larry cowan <larry_member pathlink.com> writes:
Might try the old C coder's method of dropping in printf's as traces to isolate
where it's happenning.  In general, D seems to do a decent job of flushing so
fprintf to stderr hasn't been necessary for me yet... Good luck.

In article <c3sjf3$8i4$1 digitaldaemon.com>, SL says...
So I'm running the debug version of this program here I just compiled, 
and I get "Error: Access Violation", no other information, doesn't even 
ask if I want to debug it, the program just prints that and exits.

It was compiled with the following command:
dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d 
windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more

I attempted to debug it with VCPP6SE, but it didn't seem to find any 
symbols and showed me a disassembly of the program, which I was 
disinclined to try to trace through - I compiled it debug and all that 
for a reason. :/

I wonder if it's trying to access this object before it's initialized... 
*adds checks* nope.

I wonder if it's because of the synchronized(someobjecthere) {} stuff 
which was accessing said object... *comments them out* nope.

Hmmm. Oh how I wish that "Error: Access Violation" was an exception 
which would give me filenames and line numbers. *continues fiddling to 
try to find the cause*

Mar 24 2004
prev sibling next sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
I think i was able to do a few steps (at least as to get line number) 
with OpenWatcom compiler. Walter also recommands MS's windbg.exe

That you see assembly may be caused by 2 further reasons:
- debugger cannot find the source or
- you traced into a non-debug library right from the beginning. you 
might want to step out of it.

-eye

SL schrieb:

 So I'm running the debug version of this program here I just compiled, 
 and I get "Error: Access Violation", no other information, doesn't even 
 ask if I want to debug it, the program just prints that and exits.
 
 It was compiled with the following command:
 dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d 
 windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more
 
 I attempted to debug it with VCPP6SE, but it didn't seem to find any 
 symbols and showed me a disassembly of the program, which I was 
 disinclined to try to trace through - I compiled it debug and all that 
 for a reason. :/
 
 I wonder if it's trying to access this object before it's initialized... 
 *adds checks* nope.
 
 I wonder if it's because of the synchronized(someobjecthere) {} stuff 
 which was accessing said object... *comments them out* nope.
 
 Hmmm. Oh how I wish that "Error: Access Violation" was an exception 
 which would give me filenames and line numbers. *continues fiddling to 
 try to find the cause*

Mar 24 2004
prev sibling parent reply J C Calvarese <jcc7 cox.net> writes:
SL wrote:
 So I'm running the debug version of this program here I just compiled, 
 and I get "Error: Access Violation", no other information, doesn't even 
 ask if I want to debug it, the program just prints that and exits.
 
 It was compiled with the following command:
 dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d 
 windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more
 
 I attempted to debug it with VCPP6SE, but it didn't seem to find any 
 symbols and showed me a disassembly of the program, which I was 
 disinclined to try to trace through - I compiled it debug and all that 
 for a reason. :/
 
 I wonder if it's trying to access this object before it's initialized... 
 *adds checks* nope.
 
 I wonder if it's because of the synchronized(someobjecthere) {} stuff 
 which was accessing said object... *comments them out* nope.
 
 Hmmm. Oh how I wish that "Error: Access Violation" was an exception 
 which would give me filenames and line numbers. *continues fiddling to 
 try to find the cause*

Aside form not new-ing objects, another common way to get an Access Violation is faulty printf code as described on this page: http://www.wikiservice.at/wiki4d/wiki.cgi?FaqRoadmap#ErrorAccessViolationonprintingastring Without seeing any code, it's hard to say what the problem is. Like Larry suggested, sprinkling printf's all you code is probably the best way to track down the problem: printf("Reached line 10\n"); ... printf("Reached line 30\n"); ... printf("Reached line 50\n"); You could also use assert to make sure what you think is true, is true. -- Justin http://jcc_7.tripod.com/d/
Mar 24 2004
parent reply Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
J C Calvarese <jcc7 cox.net> wrote:

 Like Larry suggested, sprinkling printf's all you code is probably the
 best way to track down the problem:
 
     printf("Reached line 10\n");
     ...
     printf("Reached line 30\n");
     ...
     printf("Reached line 50\n");
 
 You could also use assert to make sure what you think is true, is
 true. 

PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-) -- dave
Mar 24 2004
next sibling parent "Phill" <phill pacific.net.au> writes:
I think you can also get this when you havent
set the length on an array, and then try to
access it.

I haven't got the latest version though.

Phill.


"Dave Sieber" <dsieber spamnot.sbcglobal.net> wrote in message
news:Xns94B6DDDF2D6FFdsiebersbc 63.105.9.61...
 J C Calvarese <jcc7 cox.net> wrote:

 Like Larry suggested, sprinkling printf's all you code is probably the
 best way to track down the problem:

     printf("Reached line 10\n");
     ...
     printf("Reached line 30\n");
     ...
     printf("Reached line 50\n");

 You could also use assert to make sure what you think is true, is
 true.

PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-) -- dave

Mar 24 2004
prev sibling next sibling parent reply J C Calvarese <jcc7 cox.net> writes:
Dave Sieber wrote:
[snip]
 PMJI, but as I am just taking a first look at D, does this mean that there 
 is no debugger at this time? I did the above back in the 80s when I first 
 learned C. I'm not sure I want to go back to that decade again :-)

Even for the sake of nostalgia? ;) I don't use a debugger with D yet, but it's supposed to be possible. Here's what Walter wrote back in January... "Is there some program available that supports D debugging info?" -- imr1984 "Any debugger that uses standard debugging information. If using linux, you can use gdb. If using Windows, you can use, for example, Microsoft's windbg.exe program (which comes on the DMC++ CD)." -- Walter D/22036 -- Justin http://jcc_7.tripod.com/d/
Mar 24 2004
parent Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
J C Calvarese <jcc7 cox.net> wrote:

 Dave Sieber wrote:
 [snip]
 PMJI, but as I am just taking a first look at D, does this mean that
 there is no debugger at this time? I did the above back in the 80s
 when I first learned C. I'm not sure I want to go back to that decade
 again :-) 

Even for the sake of nostalgia? ;)

LOL. I got enuff nostalgia already, ok? :-)
 I don't use a debugger with D yet, but it's supposed to be possible. 
 Here's what Walter wrote back in January...

<snip> Yes, I have windbg here, although I admit I've never used it. D certainly looks very interesting, and I can't help but agree wholeheartedly with Walter's ambitions. I'm behind him 100% in that regard, and applaud his courage to Do Something About It (tm). Just as an aside, I've just started reading a bit on D, and find myself mentally comparing it to C# as I read. I really like what MS did with C# (much better than Java, IMO), but the icing on the cake is Visual Studio, which makes programming in C# a joy (I honestly never thought I could say that about programming :-) Getting an environment like that for D would be absolutely KILLER. I wonder if Visual Studio could debug a D executable? Seems that'd be a tall order. Back to the original question in this post (and sorry for such noobish questions): it seems, then, that access violations do not generate an exception, or at least with default compilation they don't. Is there a way this could be done via some special switches? Also, is there a standard exception type and hierarchy in D? One of the problems in C++ is that, with no standard exception type (you can throw whatever you want), when one is writing code that uses, say, STL, MFC, ATL, and possibly others, you end up either having to have multiple catch's for each type you want, or throwing away the exception altogether and doing a catch(...), which I really don't like. Again, C# (and Java) at least have a standard notion of an exception, so you don't get all these incompatibilities with code from different sources. -- dave
Mar 24 2004
prev sibling next sibling parent reply C <dont respond.com> writes:
Pet rock, flock of seagulls, the brat pack .... spandex....whats not to =

love! :)
hehe no debugger though.  You can use windbg if ur familiar with asm , =

also the IDDE on the CD has some debugging capabilities.  To get source =

interaction i think the linker needs to create .pdb files ( dont quote m=
e =

though ).

C


On Thu, 25 Mar 2004 05:48:39 +0000 (UTC), Dave Sieber =

<dsieber spamnot.sbcglobal.net> wrote:

 J C Calvarese <jcc7 cox.net> wrote:

 Like Larry suggested, sprinkling printf's all you code is probably th=


 best way to track down the problem:

     printf("Reached line 10\n");
     ...
     printf("Reached line 30\n");
     ...
     printf("Reached line 50\n");

 You could also use assert to make sure what you think is true, is
 true.

PMJI, but as I am just taking a first look at D, does this mean that =

 there
 is no debugger at this time? I did the above back in the 80s when I fi=

 learned C. I'm not sure I want to go back to that decade again :-)

-- = D Newsgroup.
Mar 25 2004
parent reply Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
C <dont respond.com> wrote:

 Pet rock, flock of seagulls, the brat pack .... spandex....whats not
 to love! :)

ARGH!!!! :-) And you forgot Thomas Dolby, Ultravox, and Duran Duran! Actually, the 80s were my hey-day, many fond memories of... "stuff" I did back then <G>
 hehe no debugger though.  You can use windbg if ur familiar with asm ,
 also the IDDE on the CD has some debugging capabilities.  To get
 source interaction i think the linker needs to create .pdb files (
 dont quote me though ).

No problem. I'm just beginning to look into D, and am looking for what might be a workable set of development tools. So far, Emacs looks ok, although the emacs mode I got looks like it's basically just syntax coloring -- better than nothing, but I want more intelligent tools, epsecially class browsing similar to Class View in Visual Studio. DIDE looks interesting but I haven't spent enough time with it. -- dave
Mar 24 2004
parent reply C <dont respond.com> writes:
 DIDE looks interesting but I haven't spent enough time with it.

Yes DIDE is awesome ;). Emacs also has a rudimentary code browser by using c-tags. M-x speedbar= = brings up a nifty interface. C On Thu, 25 Mar 2004 07:06:52 +0000 (UTC), Dave Sieber = <dsieber spamnot.sbcglobal.net> wrote:
 C <dont respond.com> wrote:

 Pet rock, flock of seagulls, the brat pack .... spandex....whats not
 to love! :)

ARGH!!!! :-) And you forgot Thomas Dolby, Ultravox, and Duran Duran! Actually, the 80s were my hey-day, many fond memories of... "stuff" I =

 back then <G>

 hehe no debugger though.  You can use windbg if ur familiar with asm =


 also the IDDE on the CD has some debugging capabilities.  To get
 source interaction i think the linker needs to create .pdb files (
 dont quote me though ).

No problem. I'm just beginning to look into D, and am looking for what=

 might be a workable set of development tools. So far, Emacs looks ok,
 although the emacs mode I got looks like it's basically just syntax
 coloring -- better than nothing, but I want more intelligent tools,
 epsecially class browsing similar to Class View in Visual Studio.

 DIDE looks interesting but I haven't spent enough time with it.

-- = D Newsgroup.
Mar 25 2004
parent reply Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
C <dont respond.com> wrote:

 Yes DIDE is awesome ;).

It looks promising, for sure. The interface needs some work, but I couldn't use it for serious programming as long they are using arrow-key mode for editing. I will keep my eye on it.
 Emacs also has a rudimentary code browser by using c-tags.  M-x speedbar 
 brings up a nifty interface.

It seems that speedbar doesn't yet know how to read a D source file? Speedbar has improved a lot, but I find it inadequate for real C++ work. In fact, I've pretty much given up on Emacs as a programming editor, but for old-school C-style work it's quite handy. I'm using it now for my D explorations, just little programs I am trying out, not even up to make files yet :-) -- dave
Mar 25 2004
parent reply C <dont respond.com> writes:
 The interface needs some work

 arrow-key mode for
 editing.

Arrow-key mode ?
 It seems that speedbar doesn't yet know how to read a D source file?

Yea i noticed that after I posted. I thought they were updating c-tags = for D support but it doesnt look like its done yet.
 but I find it inadequate for real C++ work.

Sacriledge!! What do you consider a 'good' IDE, and what features make = it = so good ? I use emacs all the time, you get so comfotable with it after= a = while its hard to be anywhere near as productive with another. C On Fri, 26 Mar 2004 02:54:13 +0000 (UTC), Dave Sieber = <dsieber spamnot.sbcglobal.net> wrote:
 C <dont respond.com> wrote:

 Yes DIDE is awesome ;).

It looks promising, for sure. The interface needs some work, but I =

 couldn't
 use it for serious programming as long they are using arrow-key mode f=

 editing. I will keep my eye on it.

 Emacs also has a rudimentary code browser by using c-tags.  M-x speed=


 brings up a nifty interface.

It seems that speedbar doesn't yet know how to read a D source file? Speedbar has improved a lot, but I find it inadequate for real C++ wor=

 In
 fact, I've pretty much given up on Emacs as a programming editor, but =

 old-school C-style work it's quite handy. I'm using it now for my D
 explorations, just little programs I am trying out, not even up to mak=

 files yet :-)

-- = D Newsgroup.
Mar 25 2004
parent reply Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
C <dont respond.com> wrote:

 Arrow-key mode ?

Using only the arrow keys for moving the cursor, which constantly requires you to pull your hand away from the standard key position. AKA "Notepad- style" :-)
 but I find it inadequate for real C++ work.

Sacriledge!! What do you consider a 'good' IDE, and what features make it so good ? I use emacs all the time, you get so comfotable with it after a while its hard to be anywhere near as productive with another.

LOL. Yes, I know it's sacrilege :-) Well, first off, of course, it's a personal preference thing -- as the long-running vi vs. emacs war demonstrates. Some people love vi, some love emacs, and they will never agree with each other. And some lusers love notepad :-) IAC, what I am looking for is an development system that understands my program. Emacs is a great text editor, but that's all it is -- text editing. It doesn't understand my C++ except through a multitude of regular expressions that one hopes are mostly correct. It can't even narrow-to- defun correctly in C++. I want an intelligent source browser that knows where everything is in my code and that isn't confused because I didn't put the brace in column 0. Speedbar and imenu don't qualify, at least for C++, but it's not their fault -- the damned language is so insanely complex it would take a super-human effort to get it right, and with elisp it would be dreadfully slow. This is why I think Walter is totally on the right track with D, and I'm glad someone with the skill to do something about it actually *is* doing something about it. To tell you the truth, if it weren't for Microsoft's policy of not fixing their bugs (until the next paid upgrade :-) I would say the current Visual Studio .NET is the best. Well, actually, it is, despite that. I am incredibly more productive with that tool than with anything else I have found. And I have been searching for years. I've used Emacs about 8 years, but my use of it has dropped way off. One would need to take more than a passing glance at Visual Studio .NET to see why it is so good. But it understands C/C++ more than any other tool I've ever used (although it misses on a fair amount of my code that uses a lot of templates and namespaces). And of course, I've customized it with my own set of keystrokes and macros, but not extensively. I've concluded that lots of little macro-y things aren't the solution to productivity, at least for me. When I have a large project going, I do not want to spend ANY time dicking around with source files, trying to find the definition or declaration of something. Intellisense has gotten *very* smart in their recent versions (emacs with cc-mode and speedbar and imenu come nowhere close). And it's interactive in real-time: they have incremental parsing of the source as you type, and both Intellisense and Class View are updated on the fly. It's quite impressive. Of course they still have a ways to go, and they still have feature backfires. BTW, you might be interested to know that when I interviewed at MS for the Visual C++ team (for which I was turned down, I think because I said "fuck" in one of the interviews, and I called one of the interviewers a bastard (purely in fun :-)), one of the main things they were interested in was the kinds of features that would appeal to someone who normally used Emacs or other Unix-style tools. We had a big discussion about this. I must add that I'm not a Microsoft Corporation fan, especially their dishonest and predatory business practices, but I also feel that credit should be given where it is due, and they've earned it with Visual Studio. The developers I met up there were all very sharp guys devoted to creating great development tools -- but I doubt they have any say at all about what happens up at the management level, and if I worked there I would feel betrayed by the antics Bill and Steve engage in. And I don't like any of MS's other products :-) MFC, for instance, is a terrible example, IMO, of an "industry standard" technology. Anyway, I appreciate your interest in this topic. I've found virtually no interest amongst the MS fan-boys I've worked with :-) but it makes sense that someone willing to move forward with D would also have a strong interest in advanced development tools as well. -- dave
Mar 25 2004
parent reply C <dont respond.com> writes:
 Using only the arrow keys for moving the cursor, which constantly =

 requires
 you to pull your hand away from the standard key position.  AKA "Notep=

 style" :-)

Argh your right , that is probably what slows me down the most. Im = working on a ( dreaded ) MFC acellerator table class, hopefully this wil= l = allow for more advanced configurations. Does VC .net have this ? I don= t = have it yet , but from what you've said I defintley want to check it out= .
 it would take a super-human effort to get it right, and with elisp it
 would be dreadfully slow.

Yes no doubt there, formatting large files takes an unbearabley long tim= e.
 MS for the Visual C++ team (for which I was turned down, I think becau=

 I
 said "fuck" in one of the interviews, and I called one of the =

 interviewers
 a bastard (purely in fun :-))

lol , little boozin in the morning :) ?
 The developers I met up there were all very sharp guys devoted to =

 creating
 great development tools

Yea from what I understand they've aquired some big players , done alot = for 'standards conformance'. Im not quite a fan either, but they have = done alot for CS in general.
 but I also feel that credit
 should be given where it is due, and they've earned it with Visual =

 Studio.

Yea I really want to check it out, i bought the pre-2003 version, I wond= er = if that $29 dollar upgrade still stands.
 Anyway, I appreciate your interest in this topic.

And I appreciate the input! C On Fri, 26 Mar 2004 04:46:27 +0000 (UTC), Dave Sieber = <dsieber spamnot.sbcglobal.net> wrote:
 C <dont respond.com> wrote:

 Arrow-key mode ?

Using only the arrow keys for moving the cursor, which constantly =

 requires
 you to pull your hand away from the standard key position.  AKA "Notep=

 style" :-)

 but I find it inadequate for real C++ work.

Sacriledge!! What do you consider a 'good' IDE, and what features make it so good ? I use emacs all the time, you get so comfotable with it after a while its hard to be anywhere near as productive with=


 another.

LOL. Yes, I know it's sacrilege :-) Well, first off, of course, it's=

 personal preference thing -- as the long-running vi vs. emacs war
 demonstrates. Some people love vi, some love emacs, and they will neve=

 agree with each other. And some lusers love notepad :-)

 IAC, what I am looking for is an development system that understands m=

 program. Emacs is a great text editor, but that's all it is -- text
 editing. It doesn't understand my C++ except through a multitude of =

 regular
 expressions that one hopes are mostly correct. It can't even narrow-to=

 defun correctly in C++. I want an intelligent source browser that know=

 where everything is in my code and that isn't confused because I didn'=

 put the brace in column 0. Speedbar and imenu don't qualify, at least =

 C++, but it's not their fault -- the damned language is so insanely =

 complex
 it would take a super-human effort to get it right, and with elisp it
 would be dreadfully slow. This is why I think Walter is totally on the=

 right track with D, and I'm glad someone with the skill to do somethin=

 about it actually *is* doing something about it.

 To tell you the truth, if it weren't for Microsoft's policy of not fix=

 their bugs (until the next paid upgrade :-) I would say the current =

 Visual
 Studio .NET is the best. Well, actually, it is, despite that. I am
 incredibly more productive with that tool than with anything else I ha=

 found. And I have been searching for years. I've used Emacs about 8 =

 years,
 but my use of it has dropped way off. One would need to take more than=

 passing glance at Visual Studio .NET to see why it is so good. But it
 understands C/C++ more than any other tool I've ever used (although it=

 misses on a fair amount of my code that uses a lot of templates and
 namespaces). And of course, I've customized it with my own set of
 keystrokes and macros, but not extensively. I've concluded that lots o=

 little macro-y things aren't the solution to productivity, at least fo=

 me.
 When I have a large project going, I do not want to spend ANY time =

 dicking
 around with source files, trying to find the definition or declaration=

 something. Intellisense has gotten *very* smart in their recent versio=

 (emacs with cc-mode and speedbar and imenu come nowhere close). And it=

 interactive in real-time: they have incremental parsing of the source =

 you type, and both Intellisense and Class View are updated on the fly.=

 It's
 quite impressive.

 Of course they still have a ways to go, and they still have feature
 backfires. BTW, you might be interested to know that when I interviewe=

 at
 MS for the Visual C++ team (for which I was turned down, I think becau=

 I
 said "fuck" in one of the interviews, and I called one of the =

 interviewers
 a bastard (purely in fun :-)), one of the main things they were =

 interested
 in was the kinds of features that would appeal to someone who normally=

 used
 Emacs or other Unix-style tools. We had a big discussion about this.

 I must add that I'm not a Microsoft Corporation fan, especially their
 dishonest and predatory business practices, but I also feel that credi=

 should be given where it is due, and they've earned it with Visual =

 Studio.
 The developers I met up there were all very sharp guys devoted to =

 creating
 great development tools -- but I doubt they have any say at all about =

 what
 happens up at the management level, and if I worked there I would feel=

 betrayed by the antics Bill and Steve engage in. And I don't like any =

 MS's other products :-) MFC, for instance, is a terrible example, IMO,=

 an "industry standard" technology.

 Anyway, I appreciate your interest in this topic. I've found virtually=

 interest amongst the MS fan-boys I've worked with :-) but it makes sen=

 that someone willing to move forward with D would also have a strong
 interest in advanced development tools as well.

-- = D Newsgroup.
Mar 25 2004
parent Dave Sieber <dsieber spamnot.sbcglobal.net> writes:
C <dont respond.com> wrote:

 Argh your right , that is probably what slows me down the most.  Im 
 working on a ( dreaded ) MFC acellerator table class, hopefully this
 will allow for more advanced configurations.  Does VC .net have this ?
  I dont have it yet , but from what you've said I defintley want to
 check it out. 

Hmmm, I'm not sure what an MFC accelerator table is...? (MFC was never my strong suit :-)
 lol , little boozin in the morning :) ?

Hah! I WISH! I would have been less nervous, I think :-) I had six interviews back to back, over 8 hours, including being interviewed through lunch. And I blew it in the very last one...
 Yea I really want to check it out, i bought the pre-2003 version, I
 wonder if that $29 dollar upgrade still stands.

If you're doing C++ work, you definitely should get VS.NET 2003. The C++ compiler is *much* better. It compiles Boost with no problems, Koenig lookup works, partial ordering, etc. There is still the occasional internal compiler error, but it is greatly improved. That said, you will find some issues with Visual Studio itself, depending on the kind of work you're doing. As I mentioned, if you're doing heavy-duty templates and namespaces, you may find that Intellisense and/or Class View can get confused. For straight-ahead stuff, though, it works great. I really do wish they would issue some patches or service packs, like they used to do back with VC++ 6.0. -- dave
Mar 25 2004
prev sibling parent reply SL <shadowlord13 users.sourceforge.net> writes:
Dave Sieber wrote:

 J C Calvarese <jcc7 cox.net> wrote:
 
 
Like Larry suggested, sprinkling printf's all you code is probably the
best way to track down the problem:

    printf("Reached line 10\n");
    ...
    printf("Reached line 30\n");
    ...
    printf("Reached line 50\n");

You could also use assert to make sure what you think is true, is
true. 

PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-)

Yeah, I just finished modifying a debug.py script that I wrote a while back for a C program... It makes a copy of all the source files and then inserts printf statements containing the filename and line number on (almost) every valid line (in the copies, which are in a subfolder of the project folder). Then I compile the copies (it also copies the compile.bat and debug.bat for me), and run them and watch it to see where it dies. It's slightly simpler with D though, because I don't have to use cumbersome workarounds to make the printfs actually get shown if the app dies. I had to make it understand classes and extern (didn't have extern in the C program it was written for), but it works now. And so I've tracked down the error... --------- spacesim.d:179 spacesim.d:180 spacesim.d:228 spacesim.d:229 Error: Access Violation ---------- Lines 228-230: ---- foreach (int i, Planet planet; planets) { planet.cycle(); } ---- Apparently I made a mistake in the constructor so it didn't initialize all of the Planet references in Planet[] planets. P.S. It'd definitely be nice to have a compiler flag which inserts printfs like these throughout the code, in order to have a constant execution trace running while the program runs, for finding this sort of thing, and any other conditions which don't normally produce enough information to easily track down (Perhaps stack overflows, running out of memory, etc? I haven't wound up with any of those yet in D, though, so I don't know how well they may be handled). Oh yeah, I discovered a curiousity while doing this. ---- printf("spacesim.d:%i ",204); real massleft=mass-mass/2; ---- This *works*, and does so exactly the same as: ---- printf("spacesim.d:%i\n",204); real massleft=mass-mass/2; ---- Apparently, in the first example, the line break in the middle of the string is included as part of the string! Fascinating. :P -SL
Mar 25 2004
parent reply Andy Friesen <andy ikagames.com> writes:
SL wrote:
 Apparently, in the first example, the line break in the middle of the 
 string is included as part of the string!

That's part of the spec. D string literals span lines. -- andy
Mar 25 2004
next sibling parent SL <shadowlord13 users.sourceforge.net> writes:
Andy Friesen wrote:

 SL wrote:
 
 Apparently, in the first example, the line break in the middle of the 
 string is included as part of the string!

That's part of the spec. D string literals span lines. -- andy

Nice. I hadn't noticed that in the spec.
Mar 25 2004
prev sibling parent C <dont respond.com> writes:
Hey andy I couldnt get to http://ikagames.com/andy/d/streams.d , has it =

been moved ?

C

On Thu, 25 Mar 2004 06:56:06 -0800, Andy Friesen <andy ikagames.com> wro=
te:

 SL wrote:
 Apparently, in the first example, the line break in the middle of the=


 string is included as part of the string!

That's part of the spec. D string literals span lines. -- andy

-- = D Newsgroup.
Mar 25 2004