VC's debugger command-line switches. 
Author Message
 VC's debugger command-line switches.

Afternoon people,

I'm trying to find the full list of command line switches for VC but
I'm not having much luck with getting the info from MSDN.

Trying to debug my dll, of an external exe that I don't have the
debug-version of/can't get the debug version of.

Did all the usual stuff:

* Set the app's exe name in the "Executable for debug sessions", but
the exe is a stub that launches the main exe.  Set the main exe as THE
exe, and it doesn't start-up (obviously needs the stub to launch it).

* Tried the back-door method, by including a "DebugBreak()" into the
DLL.  The main exe catches the exception and closes the program
gracefully.  Obviously it doesn't distinguish between debug exception
and other "bad code" exceptions.

* Tried to setup VC as the de{*filter*} in "HKLM/Software/MS/WinNT/Current
Version/Image File Execution Options" so it starts-up in debug mode.
Couldn't find the command-line switches in MSDN so I "borrowed" them
from the AEDebug key.   Didn't work (couldn't start the exe due to bad
command-line params).

Anyone have a clue to where they're documented.  The IDE command-line
params detailed are the ones for loading/building projects, but the
ones in aedebug  (-p and -e) are undocumented (or so I think).

Can I do this with msdev.exe or, for this special case, should I learn
how to use WinDbg and forget the de{*filter*} in msdev ?

Cheers for any clarity offered.

Jimbo



Wed, 07 Jan 2004 22:21:06 GMT  
 VC's debugger command-line switches.
Hi, Jim:

How is your dll loaded by the exe?  If it is statically linked in, then you
should simply be able to set the exe name in the "Executable for debug
sessions" and set your breakpoint in your dll.  The de{*filter*} shall stop
even if you do not have the debug symbol for the exe.

If your dll is dynamically loaded in,  you may try to use the "additional
dll".  In project | setting | Debug, choose category "additional dll", add
your dll to the list.  That will cause the de{*filter*} try to load your dll's
symbol at the startup time of the exe which will allow you set the
breakpoint in your dll.   You still need to set the exe name in the
"Executable for debug sessions"

I think the -P in the ade{*filter*} means for process ID.  These are not the
options for msdev but rather consummed by the OS on how to launch the
de{*filter*}.

James



Sun, 11 Jan 2004 08:25:09 GMT  
 VC's debugger command-line switches.


Quote:
>Hi, Jim:

>How is your dll loaded by the exe ?

Dynamicly.

Quote:
>If your dll is dynamically loaded in,  you may try to use the "additional
>dll".  ... You still need to set the exe name in the
>"Executable for debug sessions"

Exe A starts, launches Exe B, and exits as soon as it does (with the
de{*filter*}).  Exe B dyn-loads Dll A.  Can't set Exe B as program as it
doesn't start properly, and here I think I've wandered into an
anti-piracy device.  Quite nifty but but a bit tricky.  Didn't realise
until most of my avenues got slammed shut.

I can quite happily attach-to-process and debug that way, but I miss
the DllMain call and miss-out using the heap-checker of win2k, and
that's it.  Not too-much of a problem really, just missing the usual
external sanity check.

Cheers for the suggestions James,

Jimbo



Thu, 15 Jan 2004 23:09:15 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Command line use of VC 6 debugger?

2. filter switch in command line???

3. command line switch for help...

4. MS-DOS Command-Line Switches

5. Generic Command Line Switch Handler

6. command line switches

7. How to parse command line switches

8. multichar command line switches

9. Activating menu item with command line switch

10. Command line error D2016 : '/ZI' and '/clr' command-line options are incompatible

11. Command line error D2016 : '/ZI' and '/O2' command-line options are incompatible

12. Starting VC6.0 debugger from command line?

 

 
Powered by phpBB® Forum Software