Re: copymemory basic question



"Someone" <nobody@xxxxxxx> wrote in message
news:MeESe.7826$ct5.3837@xxxxxxxxxxxxx
>
> There is an easier way to see the compiled code than this by using VC++
> 6.0.
>
> Here are step by step instructions:

I have used VC (actually Visual Studio) somewhat but I have not done some of
what you have below. I understand and agree that this is worth a separate
thread so I won't go into detail here.

> - Create a new VB project, and write a sample code in Form_Click in Form1.
> - Add a MsgBox "Hello" in the code.
> - Save the project(a must).

I have used that technique before; that is, put a MessageBox in a VC program
so I can debug the program. Once that has been done, we can save the
workspace and then debug the program without using the MessageBox or MsgBox.

I would prefer to be able to create the workspace without use of the
MessageBox or MsgBox or anything like that to pause the program but I have
not figured out how to do that directly. When I do I can create a new thread
with the information.

It is possible, however, to use VS to make a "makefile" project and then we
can debug the program without needing a MessageBox or MsgBox or anything
like that to create the project or debug or whatever. By creating a project
that way, it is possible to add source files to the project, but there are
potential problems that I won't get into here.

I would prefer to have a project type that is more relevant than "makefile"
but I don't know of one.

> - Go to Project|Properties|Compile, and select "Create Symbolic Debug
> Info".
> - Compile and save.

Thank you for the "Create Symbolic Debug Info". I tried to find things like
that but overlooked it. It will likely be useful with DumpBin too.

> - Go to Build|Start Debug|Attach to process, and select your running EXE.
> - Click on Form1, this will execute Form_Click, and a message box with the
> word Hello will appear. Do not click OK yet.
> - Go to VC++ 6.0|Debug|Break.

If the VS project is created as above, then it is not necessary to do the
"Attach to process" and breaking in and such.

> - Go to View|Debug Windows, and make sure that "Call Stack" window is
> visible.
> - One of the lines in "Call Stack" shows "Form1::Form_Click()", double
> click on that, this will view the source code.
> - Now Right Click on any source line that you like, and select "Go to
> Disassembly", this will show the source and what VB compiled the code to
> in an easy to view format.

Alternatively, while debugging, it is possible to open the source file while
debugging the program and then we can click on a line as you describe to get
to the disassembly.

> It's important to note that VB6 does source level optimization, a specific
> line may be compiled differently based on the lines before it.

In the case of the OptimizedTiny function in my message, the disassembly is
not able to show anything due to the optimization.


.



Relevant Pages

  • Tricking pl1s production_table
    ... you're using debug and break statements to create a trace log. ... testprog: procedure options; ... I can't just go compile everything with -table ... which doesn't happen below optimization level 2. ...
    (comp.sys.stratus)
  • Re: when to use variable vs. constant?
    ... I have no idea what weight to give that optimization. ... It's not rally as simple as it sounds: substitution is always being ... whether the substitution happens at compile time or run time. ... DEBUG = 0' at the beginning of programs. ...
    (perl.beginners)
  • Re: Debug Vs Release
    ... > If I compile that code in debug mode then dissassemble the EXE, ... > private static void Main(stringargs) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Getting a stack trace from a running application
    ... Unfortunately, the only infromation they can provide is a memory address, which is pretty useless as it doesn't tell me if my main exe is the culprit or if it's some dll or ocx or whatever. ... If you compile the the program with debug information, the debugger will show the responsible line of your code that caused the error. ...
    (comp.lang.basic.visual.misc)
  • Re: MustInherit in Window forms
    ... #If Debug then ... Public MustInherit BaseClass ... compile in Release mode. ... the Base form to implement DisconnectFromAbrServer. ...
    (microsoft.public.dotnet.languages.vb)