IIS 5.1/Xp/VS8 debugging ISAPIs

IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 18:17:00 von mmodrall

Hi...

Haven't had to debug ISAPIs in a *long* time; this is the first time I've
had to do it with the new tools, and I'm seeing weird things, at least
compared to VS 2003.

I've got the ISAPIs installed on IIS 5.1.
I've attached the debugger to inetinfo.exe.
I've got my source loaded with breakpoints set (it let me set the
breakpoints, so it seems the symbols are loaded)
....
but the breakpoints are never hit.

Another weird thing - If I go to the Modules page, it doesn't show anything
on the list unless the module is loaded *while* the Modules page is up. If I
iisreset, bring up the modules page, then hit it with a request, a bunch of
modules show up. If I close the modules page and reopen it, there's nothing
in the list.

Is there any way to get to break points in unmanaged code in VS8?

Thanks
Mark

ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
surprised me.

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 18:44:04 von David Wang

First, let's verify some missing details in user configuration that
can affect debugging.

- Where is the PDB for the ISAPI DLL?
- Are you talking about ISAPI Extension or ISAPI Filter DLL
- What Application Isolation mode is the Default Website using

Caveat: I do not use any Visual Studio to debug native or managed
code, so there may be real oddities in VS8, but let's take care of the
user-configuration first. For the curious, I use the NTSD/WINDBG
debuggers from Microsoft's Debugging Toolkit for native-code and
managed-code interop, and then a private debugging tool for managed
code.

Details:
1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
to attach the debugger to the right process executing the ISAPI or
else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
at the site-level are loaded/unloaded on the fly as needed.

Thus, only global ISAPI Filters are guaranteed to be loaded in
inetinfo.exe by the time you attach debuggers to it from a UI (there
are ways to attach debuggers ASAP or trigger breakpoints as soon as a
DLL load, but you are not using those techniques here). Anything else
MAY be in inetinfo.exe by the time you attach debuggers, but they may
not be. Hence, I wanted details to confirm.

2. IISRESET will restart all IIS-related processes, so I don't know
how you can see the Modules page work across IISRESET -- unless Visual
Studio started auto-re-attaching to processes (which is kinda scary
behavior, in my mind)

3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
put the PDB alongside the DLL


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//



On Nov 1, 10:17 am, Mark wrote:
> Hi...
>
> Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> had to do it with the new tools, and I'm seeing weird things, at least
> compared to VS 2003.
>
> I've got the ISAPIs installed on IIS 5.1.
> I've attached the debugger to inetinfo.exe.
> I've got my source loaded with breakpoints set (it let me set the
> breakpoints, so it seems the symbols are loaded)
> ...
> but the breakpoints are never hit.
>
> Another weird thing - If I go to the Modules page, it doesn't show anything
> on the list unless the module is loaded *while* the Modules page is up. If I
> iisreset, bring up the modules page, then hit it with a request, a bunch of
> modules show up. If I close the modules page and reopen it, there's nothing
> in the list.
>
> Is there any way to get to break points in unmanaged code in VS8?
>
> Thanks
> Mark
>
> ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> surprised me.

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 19:26:02 von mmodrall

Hi David...

Thank you for your reply. To answer your questions,
1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
..dlls.

2. I have the website in low isolation mode

3. Sorry for the confusion about the Modules page. I was referring to the
window between IISRESET and the first request coming in and priming the pump
with all the late-bound loads. If I
a. IISRESET
b. attach inetinfo.exe
c. open the Modules page (which is empty)
d. fire a request to the web server
I will see modules appear on the Modules page as the request is being served
and programs are being late-loaded.

If I close the Modules page and reopen it, it's empty again.

I've also gone to the Modules page and under Symbol Settings I've manually
entered the paths to my ISAPI pdb files.

I figure the pdbs must be in there, since it does allow me to set
breakpoints; they just never get tripped. When the pdbs weren't loaded, it
wouldn't let me set the breakpoints.

It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
great. Using WinDbg just feels like driving a Yugo.

Thanks
Mark


"David Wang" wrote:

> First, let's verify some missing details in user configuration that
> can affect debugging.
>
> - Where is the PDB for the ISAPI DLL?
> - Are you talking about ISAPI Extension or ISAPI Filter DLL
> - What Application Isolation mode is the Default Website using
>
> Caveat: I do not use any Visual Studio to debug native or managed
> code, so there may be real oddities in VS8, but let's take care of the
> user-configuration first. For the curious, I use the NTSD/WINDBG
> debuggers from Microsoft's Debugging Toolkit for native-code and
> managed-code interop, and then a private debugging tool for managed
> code.
>
> Details:
> 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> to attach the debugger to the right process executing the ISAPI or
> else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> at the site-level are loaded/unloaded on the fly as needed.
>
> Thus, only global ISAPI Filters are guaranteed to be loaded in
> inetinfo.exe by the time you attach debuggers to it from a UI (there
> are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> DLL load, but you are not using those techniques here). Anything else
> MAY be in inetinfo.exe by the time you attach debuggers, but they may
> not be. Hence, I wanted details to confirm.
>
> 2. IISRESET will restart all IIS-related processes, so I don't know
> how you can see the Modules page work across IISRESET -- unless Visual
> Studio started auto-re-attaching to processes (which is kinda scary
> behavior, in my mind)
>
> 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> put the PDB alongside the DLL
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
> On Nov 1, 10:17 am, Mark wrote:
> > Hi...
> >
> > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > had to do it with the new tools, and I'm seeing weird things, at least
> > compared to VS 2003.
> >
> > I've got the ISAPIs installed on IIS 5.1.
> > I've attached the debugger to inetinfo.exe.
> > I've got my source loaded with breakpoints set (it let me set the
> > breakpoints, so it seems the symbols are loaded)
> > ...
> > but the breakpoints are never hit.
> >
> > Another weird thing - If I go to the Modules page, it doesn't show anything
> > on the list unless the module is loaded *while* the Modules page is up. If I
> > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > modules show up. If I close the modules page and reopen it, there's nothing
> > in the list.
> >
> > Is there any way to get to break points in unmanaged code in VS8?
> >
> > Thanks
> > Mark
> >
> > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > surprised me.
>
>
>

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 21:39:19 von David Wang

Hmm, interesting.

So, I go and install VS8 on XP Pro to see what's going on when
debugging global ISAPI Filters (standard C++). I followed all your
steps (other than the Modules page -- I know what you are talking
about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
same information), and I actually hit my breakpoint with that request.

Can you clarify if you are loading global or site ISAPI Filters?


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//


On Nov 1, 11:26 am, Mark wrote:
> Hi David...
>
> Thank you for your reply. To answer your questions,
> 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> .dlls.
>
> 2. I have the website in low isolation mode
>
> 3. Sorry for the confusion about the Modules page. I was referring to the
> window between IISRESET and the first request coming in and priming the pump
> with all the late-bound loads. If I
> a. IISRESET
> b. attach inetinfo.exe
> c. open the Modules page (which is empty)
> d. fire a request to the web server
> I will see modules appear on the Modules page as the request is being served
> and programs are being late-loaded.
>
> If I close the Modules page and reopen it, it's empty again.
>
> I've also gone to the Modules page and under Symbol Settings I've manually
> entered the paths to my ISAPI pdb files.
>
> I figure the pdbs must be in there, since it does allow me to set
> breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> wouldn't let me set the breakpoints.
>
> It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> great. Using WinDbg just feels like driving a Yugo.
>
> Thanks
> Mark
>
>
>
> "David Wang" wrote:
> > First, let's verify some missing details in user configuration that
> > can affect debugging.
>
> > - Where is the PDB for the ISAPI DLL?
> > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > - What Application Isolation mode is the Default Website using
>
> > Caveat: I do not use any Visual Studio to debug native or managed
> > code, so there may be real oddities in VS8, but let's take care of the
> > user-configuration first. For the curious, I use the NTSD/WINDBG
> > debuggers from Microsoft's Debugging Toolkit for native-code and
> > managed-code interop, and then a private debugging tool for managed
> > code.
>
> > Details:
> > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > to attach the debugger to the right process executing the ISAPI or
> > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > at the site-level are loaded/unloaded on the fly as needed.
>
> > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > DLL load, but you are not using those techniques here). Anything else
> > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > not be. Hence, I wanted details to confirm.
>
> > 2. IISRESET will restart all IIS-related processes, so I don't know
> > how you can see the Modules page work across IISRESET -- unless Visual
> > Studio started auto-re-attaching to processes (which is kinda scary
> > behavior, in my mind)
>
> > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > put the PDB alongside the DLL
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //
>
> > On Nov 1, 10:17 am, Mark wrote:
> > > Hi...
>
> > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > had to do it with the new tools, and I'm seeing weird things, at least
> > > compared to VS 2003.
>
> > > I've got the ISAPIs installed on IIS 5.1.
> > > I've attached the debugger to inetinfo.exe.
> > > I've got my source loaded with breakpoints set (it let me set the
> > > breakpoints, so it seems the symbols are loaded)
> > > ...
> > > but the breakpoints are never hit.
>
> > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > modules show up. If I close the modules page and reopen it, there's nothing
> > > in the list.
>
> > > Is there any way to get to break points in unmanaged code in VS8?
>
> > > Thanks
> > > Mark
>
> > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > surprised me.- Hide quoted text -
>
> - Show quoted text -

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 22:01:01 von mmodrall

Hi David...

I've got them attached to the site, not the global level. I guess I should
go try it the other way. I've set break points in every method of the isapi
and haven't seen a hit.

Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
COM; I put breaks in the C# code but those don't get hit either. I can tell
from the output, though, that the code is getting run.

The Modules page in VS8 in under Debug > Windows when you're attached to a
process.

"David Wang" wrote:

> Hmm, interesting.
>
> So, I go and install VS8 on XP Pro to see what's going on when
> debugging global ISAPI Filters (standard C++). I followed all your
> steps (other than the Modules page -- I know what you are talking
> about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> same information), and I actually hit my breakpoint with that request.
>
> Can you clarify if you are loading global or site ISAPI Filters?
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
> On Nov 1, 11:26 am, Mark wrote:
> > Hi David...
> >
> > Thank you for your reply. To answer your questions,
> > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > .dlls.
> >
> > 2. I have the website in low isolation mode
> >
> > 3. Sorry for the confusion about the Modules page. I was referring to the
> > window between IISRESET and the first request coming in and priming the pump
> > with all the late-bound loads. If I
> > a. IISRESET
> > b. attach inetinfo.exe
> > c. open the Modules page (which is empty)
> > d. fire a request to the web server
> > I will see modules appear on the Modules page as the request is being served
> > and programs are being late-loaded.
> >
> > If I close the Modules page and reopen it, it's empty again.
> >
> > I've also gone to the Modules page and under Symbol Settings I've manually
> > entered the paths to my ISAPI pdb files.
> >
> > I figure the pdbs must be in there, since it does allow me to set
> > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > wouldn't let me set the breakpoints.
> >
> > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > great. Using WinDbg just feels like driving a Yugo.
> >
> > Thanks
> > Mark
> >
> >
> >
> > "David Wang" wrote:
> > > First, let's verify some missing details in user configuration that
> > > can affect debugging.
> >
> > > - Where is the PDB for the ISAPI DLL?
> > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > - What Application Isolation mode is the Default Website using
> >
> > > Caveat: I do not use any Visual Studio to debug native or managed
> > > code, so there may be real oddities in VS8, but let's take care of the
> > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > managed-code interop, and then a private debugging tool for managed
> > > code.
> >
> > > Details:
> > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > to attach the debugger to the right process executing the ISAPI or
> > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > at the site-level are loaded/unloaded on the fly as needed.
> >
> > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > DLL load, but you are not using those techniques here). Anything else
> > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > not be. Hence, I wanted details to confirm.
> >
> > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > how you can see the Modules page work across IISRESET -- unless Visual
> > > Studio started auto-re-attaching to processes (which is kinda scary
> > > behavior, in my mind)
> >
> > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > put the PDB alongside the DLL
> >
> > > //David
> > >http://w3-4u.blogspot.com
> > >http://blogs.msdn.com/David.Wang
> > > //
> >
> > > On Nov 1, 10:17 am, Mark wrote:
> > > > Hi...
> >
> > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > compared to VS 2003.
> >
> > > > I've got the ISAPIs installed on IIS 5.1.
> > > > I've attached the debugger to inetinfo.exe.
> > > > I've got my source loaded with breakpoints set (it let me set the
> > > > breakpoints, so it seems the symbols are loaded)
> > > > ...
> > > > but the breakpoints are never hit.
> >
> > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > in the list.
> >
> > > > Is there any way to get to break points in unmanaged code in VS8?
> >
> > > > Thanks
> > > > Mark
> >
> > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > surprised me.- Hide quoted text -
> >
> > - Show quoted text -
>
>
>

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 23:07:00 von mmodrall

Just a little more info... I used tasklist and saw that the ISAPI dlls are
indeed loaded, and they are being compiled debug... Still no breaking at
breakpoints, unfortunately...

Thanks
Mark


"Mark" wrote:

> Hi David...
>
> I've got them attached to the site, not the global level. I guess I should
> go try it the other way. I've set break points in every method of the isapi
> and haven't seen a hit.
>
> Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> COM; I put breaks in the C# code but those don't get hit either. I can tell
> from the output, though, that the code is getting run.
>
> The Modules page in VS8 in under Debug > Windows when you're attached to a
> process.
>
> "David Wang" wrote:
>
> > Hmm, interesting.
> >
> > So, I go and install VS8 on XP Pro to see what's going on when
> > debugging global ISAPI Filters (standard C++). I followed all your
> > steps (other than the Modules page -- I know what you are talking
> > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > same information), and I actually hit my breakpoint with that request.
> >
> > Can you clarify if you are loading global or site ISAPI Filters?
> >
> >
> > //David
> > http://w3-4u.blogspot.com
> > http://blogs.msdn.com/David.Wang
> > //
> >
> >
> > On Nov 1, 11:26 am, Mark wrote:
> > > Hi David...
> > >
> > > Thank you for your reply. To answer your questions,
> > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > .dlls.
> > >
> > > 2. I have the website in low isolation mode
> > >
> > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > window between IISRESET and the first request coming in and priming the pump
> > > with all the late-bound loads. If I
> > > a. IISRESET
> > > b. attach inetinfo.exe
> > > c. open the Modules page (which is empty)
> > > d. fire a request to the web server
> > > I will see modules appear on the Modules page as the request is being served
> > > and programs are being late-loaded.
> > >
> > > If I close the Modules page and reopen it, it's empty again.
> > >
> > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > entered the paths to my ISAPI pdb files.
> > >
> > > I figure the pdbs must be in there, since it does allow me to set
> > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > wouldn't let me set the breakpoints.
> > >
> > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > great. Using WinDbg just feels like driving a Yugo.
> > >
> > > Thanks
> > > Mark
> > >
> > >
> > >
> > > "David Wang" wrote:
> > > > First, let's verify some missing details in user configuration that
> > > > can affect debugging.
> > >
> > > > - Where is the PDB for the ISAPI DLL?
> > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > - What Application Isolation mode is the Default Website using
> > >
> > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > managed-code interop, and then a private debugging tool for managed
> > > > code.
> > >
> > > > Details:
> > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > to attach the debugger to the right process executing the ISAPI or
> > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > at the site-level are loaded/unloaded on the fly as needed.
> > >
> > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > DLL load, but you are not using those techniques here). Anything else
> > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > not be. Hence, I wanted details to confirm.
> > >
> > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > behavior, in my mind)
> > >
> > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > put the PDB alongside the DLL
> > >
> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //
> > >
> > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > Hi...
> > >
> > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > compared to VS 2003.
> > >
> > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > I've attached the debugger to inetinfo.exe.
> > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > breakpoints, so it seems the symbols are loaded)
> > > > > ...
> > > > > but the breakpoints are never hit.
> > >
> > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > in the list.
> > >
> > > > > Is there any way to get to break points in unmanaged code in VS8?
> > >
> > > > > Thanks
> > > > > Mark
> > >
> > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > surprised me.- Hide quoted text -
> > >
> > > - Show quoted text -
> >
> >
> >

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 01.11.2007 23:42:32 von David Wang

And the symbols PDB matches the DLL?

I don't know how to verify that within VS. I can do that with NTSD/
WINDBG.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//






On Nov 1, 3:07 pm, Mark wrote:
> Just a little more info... I used tasklist and saw that the ISAPI dlls are
> indeed loaded, and they are being compiled debug... Still no breaking at
> breakpoints, unfortunately...
>
> Thanks
> Mark
>
>
>
> "Mark" wrote:
> > Hi David...
>
> > I've got them attached to the site, not the global level. I guess I should
> > go try it the other way. I've set break points in every method of the isapi
> > and haven't seen a hit.
>
> > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > from the output, though, that the code is getting run.
>
> > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > process.
>
> > "David Wang" wrote:
>
> > > Hmm, interesting.
>
> > > So, I go and install VS8 on XP Pro to see what's going on when
> > > debugging global ISAPI Filters (standard C++). I followed all your
> > > steps (other than the Modules page -- I know what you are talking
> > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > same information), and I actually hit my breakpoint with that request.
>
> > > Can you clarify if you are loading global or site ISAPI Filters?
>
> > > //David
> > >http://w3-4u.blogspot.com
> > >http://blogs.msdn.com/David.Wang
> > > //
>
> > > On Nov 1, 11:26 am, Mark wrote:
> > > > Hi David...
>
> > > > Thank you for your reply. To answer your questions,
> > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > .dlls.
>
> > > > 2. I have the website in low isolation mode
>
> > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > window between IISRESET and the first request coming in and priming the pump
> > > > with all the late-bound loads. If I
> > > > a. IISRESET
> > > > b. attach inetinfo.exe
> > > > c. open the Modules page (which is empty)
> > > > d. fire a request to the web server
> > > > I will see modules appear on the Modules page as the request is being served
> > > > and programs are being late-loaded.
>
> > > > If I close the Modules page and reopen it, it's empty again.
>
> > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > entered the paths to my ISAPI pdb files.
>
> > > > I figure the pdbs must be in there, since it does allow me to set
> > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > wouldn't let me set the breakpoints.
>
> > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > great. Using WinDbg just feels like driving a Yugo.
>
> > > > Thanks
> > > > Mark
>
> > > > "David Wang" wrote:
> > > > > First, let's verify some missing details in user configuration that
> > > > > can affect debugging.
>
> > > > > - Where is the PDB for the ISAPI DLL?
> > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > - What Application Isolation mode is the Default Website using
>
> > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > managed-code interop, and then a private debugging tool for managed
> > > > > code.
>
> > > > > Details:
> > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > at the site-level are loaded/unloaded on the fly as needed.
>
> > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > not be. Hence, I wanted details to confirm.
>
> > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > behavior, in my mind)
>
> > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > put the PDB alongside the DLL
>
> > > > > //David
> > > > >http://w3-4u.blogspot.com
> > > > >http://blogs.msdn.com/David.Wang
> > > > > //
>
> > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > Hi...
>
> > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > compared to VS 2003.
>
> > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > ...
> > > > > > but the breakpoints are never hit.
>
> > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > in the list.
>
> > > > > > Is there any way to get to break points in unmanaged code in VS8?
>
> > > > > > Thanks
> > > > > > Mark
>
> > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > surprised me.- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 02.11.2007 14:24:02 von mmodrall

VS will balk when you try to set the breakpoint if the symbol file doesnt
match the binary...

"David Wang" wrote:

> And the symbols PDB matches the DLL?
>
> I don't know how to verify that within VS. I can do that with NTSD/
> WINDBG.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
>
>
>
> On Nov 1, 3:07 pm, Mark wrote:
> > Just a little more info... I used tasklist and saw that the ISAPI dlls are
> > indeed loaded, and they are being compiled debug... Still no breaking at
> > breakpoints, unfortunately...
> >
> > Thanks
> > Mark
> >
> >
> >
> > "Mark" wrote:
> > > Hi David...
> >
> > > I've got them attached to the site, not the global level. I guess I should
> > > go try it the other way. I've set break points in every method of the isapi
> > > and haven't seen a hit.
> >
> > > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > > from the output, though, that the code is getting run.
> >
> > > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > > process.
> >
> > > "David Wang" wrote:
> >
> > > > Hmm, interesting.
> >
> > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > debugging global ISAPI Filters (standard C++). I followed all your
> > > > steps (other than the Modules page -- I know what you are talking
> > > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > > same information), and I actually hit my breakpoint with that request.
> >
> > > > Can you clarify if you are loading global or site ISAPI Filters?
> >
> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //
> >
> > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > Hi David...
> >
> > > > > Thank you for your reply. To answer your questions,
> > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > > .dlls.
> >
> > > > > 2. I have the website in low isolation mode
> >
> > > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > > window between IISRESET and the first request coming in and priming the pump
> > > > > with all the late-bound loads. If I
> > > > > a. IISRESET
> > > > > b. attach inetinfo.exe
> > > > > c. open the Modules page (which is empty)
> > > > > d. fire a request to the web server
> > > > > I will see modules appear on the Modules page as the request is being served
> > > > > and programs are being late-loaded.
> >
> > > > > If I close the Modules page and reopen it, it's empty again.
> >
> > > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > > entered the paths to my ISAPI pdb files.
> >
> > > > > I figure the pdbs must be in there, since it does allow me to set
> > > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > > wouldn't let me set the breakpoints.
> >
> > > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > > great. Using WinDbg just feels like driving a Yugo.
> >
> > > > > Thanks
> > > > > Mark
> >
> > > > > "David Wang" wrote:
> > > > > > First, let's verify some missing details in user configuration that
> > > > > > can affect debugging.
> >
> > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > > - What Application Isolation mode is the Default Website using
> >
> > > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > > managed-code interop, and then a private debugging tool for managed
> > > > > > code.
> >
> > > > > > Details:
> > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > > at the site-level are loaded/unloaded on the fly as needed.
> >
> > > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > > not be. Hence, I wanted details to confirm.
> >
> > > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > > behavior, in my mind)
> >
> > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > > put the PDB alongside the DLL
> >
> > > > > > //David
> > > > > >http://w3-4u.blogspot.com
> > > > > >http://blogs.msdn.com/David.Wang
> > > > > > //
> >
> > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > Hi...
> >
> > > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > > compared to VS 2003.
> >
> > > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > ...
> > > > > > > but the breakpoints are never hit.
> >
> > > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > > in the list.
> >
> > > > > > > Is there any way to get to break points in unmanaged code in VS8?
> >
> > > > > > > Thanks
> > > > > > > Mark
> >
> > > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > > surprised me.- Hide quoted text -
> >
> > > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>
>

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 02.11.2007 15:56:01 von mmodrall

Okay, looking at it again this morning,
* tasklist shows that the dlls are loaded

* the symbol files *don't* appear to be loaded, though I don't know why.
The symbol files are in the same directory as the dlls in both cases. In VS
Tools>Options, both of the symbols files are listed in the symbols search path

* the VS8 Modules page only seems to show .Net assemblies loaded. I can't
find any view that show loaded modules in general.

* I set the breakpoints in cpp, then attached to the process, went back to
the files and found the breakpoints disabled because the symbols weren't
loaded.

* I fired up VS8 without a solution and attached to the process. I opened
the source file separately and couldn't set the breakpoints there either...

* Can't find any UI to go and load the symbol files any more in VS8.

Seems like VS8 has removed/demoted a lot of unmanaged debugging features.
Either that or I just can't find them.

Thanks
Mark


"David Wang" wrote:

> And the symbols PDB matches the DLL?
>
> I don't know how to verify that within VS. I can do that with NTSD/
> WINDBG.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
>
>
>
> On Nov 1, 3:07 pm, Mark wrote:
> > Just a little more info... I used tasklist and saw that the ISAPI dlls are
> > indeed loaded, and they are being compiled debug... Still no breaking at
> > breakpoints, unfortunately...
> >
> > Thanks
> > Mark
> >
> >
> >
> > "Mark" wrote:
> > > Hi David...
> >
> > > I've got them attached to the site, not the global level. I guess I should
> > > go try it the other way. I've set break points in every method of the isapi
> > > and haven't seen a hit.
> >
> > > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > > from the output, though, that the code is getting run.
> >
> > > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > > process.
> >
> > > "David Wang" wrote:
> >
> > > > Hmm, interesting.
> >
> > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > debugging global ISAPI Filters (standard C++). I followed all your
> > > > steps (other than the Modules page -- I know what you are talking
> > > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > > same information), and I actually hit my breakpoint with that request.
> >
> > > > Can you clarify if you are loading global or site ISAPI Filters?
> >
> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //
> >
> > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > Hi David...
> >
> > > > > Thank you for your reply. To answer your questions,
> > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > > .dlls.
> >
> > > > > 2. I have the website in low isolation mode
> >
> > > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > > window between IISRESET and the first request coming in and priming the pump
> > > > > with all the late-bound loads. If I
> > > > > a. IISRESET
> > > > > b. attach inetinfo.exe
> > > > > c. open the Modules page (which is empty)
> > > > > d. fire a request to the web server
> > > > > I will see modules appear on the Modules page as the request is being served
> > > > > and programs are being late-loaded.
> >
> > > > > If I close the Modules page and reopen it, it's empty again.
> >
> > > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > > entered the paths to my ISAPI pdb files.
> >
> > > > > I figure the pdbs must be in there, since it does allow me to set
> > > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > > wouldn't let me set the breakpoints.
> >
> > > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > > great. Using WinDbg just feels like driving a Yugo.
> >
> > > > > Thanks
> > > > > Mark
> >
> > > > > "David Wang" wrote:
> > > > > > First, let's verify some missing details in user configuration that
> > > > > > can affect debugging.
> >
> > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > > - What Application Isolation mode is the Default Website using
> >
> > > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > > managed-code interop, and then a private debugging tool for managed
> > > > > > code.
> >
> > > > > > Details:
> > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > > at the site-level are loaded/unloaded on the fly as needed.
> >
> > > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > > not be. Hence, I wanted details to confirm.
> >
> > > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > > behavior, in my mind)
> >
> > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > > put the PDB alongside the DLL
> >
> > > > > > //David
> > > > > >http://w3-4u.blogspot.com
> > > > > >http://blogs.msdn.com/David.Wang
> > > > > > //
> >
> > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > Hi...
> >
> > > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > > compared to VS 2003.
> >
> > > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > ...
> > > > > > > but the breakpoints are never hit.
> >
> > > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > > in the list.
> >
> > > > > > > Is there any way to get to break points in unmanaged code in VS8?
> >
> > > > > > > Thanks
> > > > > > > Mark
> >
> > > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > > surprised me.- Hide quoted text -
> >
> > > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>
>

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 02.11.2007 18:32:52 von David Wang

Hmm, I don't use VS at all so I really can't help on what's available/
not. Could it be that you don't have the Visual C++ portion and its
debugging support installed in VS?

Or maybe when Visual Studio decides to auto-detect whether to do
native or managed code debugging that it somehow does it incorrectly?
(so attach/select manually)

I have C++ and C# installed for VS, and I see the usually expected
debugging support for native code working.

I find that if I attach to inetinfo.exe debugging "Managed code" that
my native code breakpoints do not trigger even though I can set them.

This is looking bizarre. Makes me think we are missing something
obvious.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//





On Nov 2, 7:56 am, Mark wrote:
> Okay, looking at it again this morning,
> * tasklist shows that the dlls are loaded
>
> * the symbol files *don't* appear to be loaded, though I don't know why.
> The symbol files are in the same directory as the dlls in both cases. In VS
> Tools>Options, both of the symbols files are listed in the symbols search path
>
> * the VS8 Modules page only seems to show .Net assemblies loaded. I can't
> find any view that show loaded modules in general.
>
> * I set the breakpoints in cpp, then attached to the process, went back to
> the files and found the breakpoints disabled because the symbols weren't
> loaded.
>
> * I fired up VS8 without a solution and attached to the process. I opened
> the source file separately and couldn't set the breakpoints there either...
>
> * Can't find any UI to go and load the symbol files any more in VS8.
>
> Seems like VS8 has removed/demoted a lot of unmanaged debugging features.
> Either that or I just can't find them.
>
> Thanks
> Mark
>
>
>
> "David Wang" wrote:
> > And the symbols PDB matches the DLL?
>
> > I don't know how to verify that within VS. I can do that with NTSD/
> > WINDBG.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //
>
> > On Nov 1, 3:07 pm, Mark wrote:
> > > Just a little more info... I used tasklist and saw that the ISAPI dlls are
> > > indeed loaded, and they are being compiled debug... Still no breaking at
> > > breakpoints, unfortunately...
>
> > > Thanks
> > > Mark
>
> > > "Mark" wrote:
> > > > Hi David...
>
> > > > I've got them attached to the site, not the global level. I guess I should
> > > > go try it the other way. I've set break points in every method of the isapi
> > > > and haven't seen a hit.
>
> > > > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > > > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > > > from the output, though, that the code is getting run.
>
> > > > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > > > process.
>
> > > > "David Wang" wrote:
>
> > > > > Hmm, interesting.
>
> > > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > > debugging global ISAPI Filters (standard C++). I followed all your
> > > > > steps (other than the Modules page -- I know what you are talking
> > > > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > > > same information), and I actually hit my breakpoint with that request.
>
> > > > > Can you clarify if you are loading global or site ISAPI Filters?
>
> > > > > //David
> > > > >http://w3-4u.blogspot.com
> > > > >http://blogs.msdn.com/David.Wang
> > > > > //
>
> > > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > > Hi David...
>
> > > > > > Thank you for your reply. To answer your questions,
> > > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > > > .dlls.
>
> > > > > > 2. I have the website in low isolation mode
>
> > > > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > > > window between IISRESET and the first request coming in and priming the pump
> > > > > > with all the late-bound loads. If I
> > > > > > a. IISRESET
> > > > > > b. attach inetinfo.exe
> > > > > > c. open the Modules page (which is empty)
> > > > > > d. fire a request to the web server
> > > > > > I will see modules appear on the Modules page as the request is being served
> > > > > > and programs are being late-loaded.
>
> > > > > > If I close the Modules page and reopen it, it's empty again.
>
> > > > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > > > entered the paths to my ISAPI pdb files.
>
> > > > > > I figure the pdbs must be in there, since it does allow me to set
> > > > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > > > wouldn't let me set the breakpoints.
>
> > > > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > > > great. Using WinDbg just feels like driving a Yugo.
>
> > > > > > Thanks
> > > > > > Mark
>
> > > > > > "David Wang" wrote:
> > > > > > > First, let's verify some missing details in user configuration that
> > > > > > > can affect debugging.
>
> > > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > > > - What Application Isolation mode is the Default Website using
>
> > > > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > > > managed-code interop, and then a private debugging tool for managed
> > > > > > > code.
>
> > > > > > > Details:
> > > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > > > at the site-level are loaded/unloaded on the fly as needed.
>
> > > > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > > > not be. Hence, I wanted details to confirm.
>
> > > > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > > > behavior, in my mind)
>
> > > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > > > put the PDB alongside the DLL
>
> > > > > > > //David
> > > > > > >http://w3-4u.blogspot.com
> > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > //
>
> > > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > > Hi...
>
> > > > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > > > compared to VS 2003.
>
> > > > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > > ...
> > > > > > > > but the breakpoints are never hit.
>
> > > > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > > > in the list.
>
> > > > > > > > Is there any way to get to break points in unmanaged code in VS8?
>
> > > > > > > > Thanks
> > > > > > > > Mark
>
> > > > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > > > surprised me.- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 02.11.2007 19:58:03 von mmodrall

Okay, using Windbg (because VS doesn't tell you much at all), I was able to
discover that the symbol file wasn't being loaded. I tried putting the
symbol file in \windows\symbols\dll but that didn't help.

Using windbg I was able to set the symbol path to the isapi build dir and
..reload /f " to verify the checksum but it *did* load the symbols.

The VS8 equivalent didn't appear to do that. VS8 Tools > Options >
Debugging > Symbols (where you can set the symbol file path(s)) has 2
mutually exclusive checkboxs - one says "Search the above locations only when
symbols are loaded manually" and the other "Load symbols using the updated
settings when this dialog is closed". Neither seems to get this symbol file
loaded.

Before VS8, there used to be a setting where you could tell the project
which dlls to "pre-load" but that option seems to have disappeared. And I
don't see any option in VS to load them "manually" as the Tools checkbox
suggests.

I can understand when you're attaching to a running process that the process
may not have the symbol files read when the debugger attaches, and that dlls
loaded *after* the debugger's attached may have their symbol files read, but
it seems like a debugger would want to load symbol files when it attached to
a process just to catch up.

Thanks
Mark


"David Wang" wrote:

> Hmm, I don't use VS at all so I really can't help on what's available/
> not. Could it be that you don't have the Visual C++ portion and its
> debugging support installed in VS?
>
> Or maybe when Visual Studio decides to auto-detect whether to do
> native or managed code debugging that it somehow does it incorrectly?
> (so attach/select manually)
>
> I have C++ and C# installed for VS, and I see the usually expected
> debugging support for native code working.
>
> I find that if I attach to inetinfo.exe debugging "Managed code" that
> my native code breakpoints do not trigger even though I can set them.
>
> This is looking bizarre. Makes me think we are missing something
> obvious.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
>
>
> On Nov 2, 7:56 am, Mark wrote:
> > Okay, looking at it again this morning,
> > * tasklist shows that the dlls are loaded
> >
> > * the symbol files *don't* appear to be loaded, though I don't know why.
> > The symbol files are in the same directory as the dlls in both cases. In VS
> > Tools>Options, both of the symbols files are listed in the symbols search path
> >
> > * the VS8 Modules page only seems to show .Net assemblies loaded. I can't
> > find any view that show loaded modules in general.
> >
> > * I set the breakpoints in cpp, then attached to the process, went back to
> > the files and found the breakpoints disabled because the symbols weren't
> > loaded.
> >
> > * I fired up VS8 without a solution and attached to the process. I opened
> > the source file separately and couldn't set the breakpoints there either...
> >
> > * Can't find any UI to go and load the symbol files any more in VS8.
> >
> > Seems like VS8 has removed/demoted a lot of unmanaged debugging features.
> > Either that or I just can't find them.
> >
> > Thanks
> > Mark
> >
> >
> >
> > "David Wang" wrote:
> > > And the symbols PDB matches the DLL?
> >
> > > I don't know how to verify that within VS. I can do that with NTSD/
> > > WINDBG.
> >
> > > //David
> > >http://w3-4u.blogspot.com
> > >http://blogs.msdn.com/David.Wang
> > > //
> >
> > > On Nov 1, 3:07 pm, Mark wrote:
> > > > Just a little more info... I used tasklist and saw that the ISAPI dlls are
> > > > indeed loaded, and they are being compiled debug... Still no breaking at
> > > > breakpoints, unfortunately...
> >
> > > > Thanks
> > > > Mark
> >
> > > > "Mark" wrote:
> > > > > Hi David...
> >
> > > > > I've got them attached to the site, not the global level. I guess I should
> > > > > go try it the other way. I've set break points in every method of the isapi
> > > > > and haven't seen a hit.
> >
> > > > > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > > > > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > > > > from the output, though, that the code is getting run.
> >
> > > > > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > > > > process.
> >
> > > > > "David Wang" wrote:
> >
> > > > > > Hmm, interesting.
> >
> > > > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > > > debugging global ISAPI Filters (standard C++). I followed all your
> > > > > > steps (other than the Modules page -- I know what you are talking
> > > > > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > > > > same information), and I actually hit my breakpoint with that request.
> >
> > > > > > Can you clarify if you are loading global or site ISAPI Filters?
> >
> > > > > > //David
> > > > > >http://w3-4u.blogspot.com
> > > > > >http://blogs.msdn.com/David.Wang
> > > > > > //
> >
> > > > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > > > Hi David...
> >
> > > > > > > Thank you for your reply. To answer your questions,
> > > > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > > > > .dlls.
> >
> > > > > > > 2. I have the website in low isolation mode
> >
> > > > > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > > > > window between IISRESET and the first request coming in and priming the pump
> > > > > > > with all the late-bound loads. If I
> > > > > > > a. IISRESET
> > > > > > > b. attach inetinfo.exe
> > > > > > > c. open the Modules page (which is empty)
> > > > > > > d. fire a request to the web server
> > > > > > > I will see modules appear on the Modules page as the request is being served
> > > > > > > and programs are being late-loaded.
> >
> > > > > > > If I close the Modules page and reopen it, it's empty again.
> >
> > > > > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > > > > entered the paths to my ISAPI pdb files.
> >
> > > > > > > I figure the pdbs must be in there, since it does allow me to set
> > > > > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > > > > wouldn't let me set the breakpoints.
> >
> > > > > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > > > > great. Using WinDbg just feels like driving a Yugo.
> >
> > > > > > > Thanks
> > > > > > > Mark
> >
> > > > > > > "David Wang" wrote:
> > > > > > > > First, let's verify some missing details in user configuration that
> > > > > > > > can affect debugging.
> >
> > > > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > > > > - What Application Isolation mode is the Default Website using
> >
> > > > > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > > > > managed-code interop, and then a private debugging tool for managed
> > > > > > > > code.
> >
> > > > > > > > Details:
> > > > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > > > > at the site-level are loaded/unloaded on the fly as needed.
> >
> > > > > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > > > > not be. Hence, I wanted details to confirm.
> >
> > > > > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > > > > behavior, in my mind)
> >
> > > > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > > > > put the PDB alongside the DLL
> >
> > > > > > > > //David
> > > > > > > >http://w3-4u.blogspot.com
> > > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > > //
> >
> > > > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > > > Hi...
> >
> > > > > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > > > > compared to VS 2003.
> >
> > > > > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > > > ...
> > > > > > > > > but the breakpoints are never hit.
> >
> > > > > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > > > > in the list.
> >
> > > > > > > > > Is there any way to get to break points in unmanaged code in VS8?
> >
> > > > > > > > > Thanks
> > > > > > > > > Mark
> >
> > > > > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > > > > surprised me.- Hide quoted text -
> >
> > > > > > > - Show quoted text -- Hide quoted text -
> >
> > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>
>

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 02.11.2007 20:43:02 von mmodrall

I found references to where "load manually" exists. Unfortunately, it's on
the Modules page which, as already mentioned, only seems to display .Net
assemblies and nothing else so it doesn't help you with unmanaged code at all.

I've cross-posted the question to vsstudio.development; hopefully someone
there will have some hints...

Thanks
Mark


"Mark" wrote:

> Okay, using Windbg (because VS doesn't tell you much at all), I was able to
> discover that the symbol file wasn't being loaded. I tried putting the
> symbol file in \windows\symbols\dll but that didn't help.
>
> Using windbg I was able to set the symbol path to the isapi build dir and
> .reload /f " > to verify the checksum but it *did* load the symbols.
>
> The VS8 equivalent didn't appear to do that. VS8 Tools > Options >
> Debugging > Symbols (where you can set the symbol file path(s)) has 2
> mutually exclusive checkboxs - one says "Search the above locations only when
> symbols are loaded manually" and the other "Load symbols using the updated
> settings when this dialog is closed". Neither seems to get this symbol file
> loaded.
>
> Before VS8, there used to be a setting where you could tell the project
> which dlls to "pre-load" but that option seems to have disappeared. And I
> don't see any option in VS to load them "manually" as the Tools checkbox
> suggests.
>
> I can understand when you're attaching to a running process that the process
> may not have the symbol files read when the debugger attaches, and that dlls
> loaded *after* the debugger's attached may have their symbol files read, but
> it seems like a debugger would want to load symbol files when it attached to
> a process just to catch up.
>
> Thanks
> Mark
>
>
> "David Wang" wrote:
>
> > Hmm, I don't use VS at all so I really can't help on what's available/
> > not. Could it be that you don't have the Visual C++ portion and its
> > debugging support installed in VS?
> >
> > Or maybe when Visual Studio decides to auto-detect whether to do
> > native or managed code debugging that it somehow does it incorrectly?
> > (so attach/select manually)
> >
> > I have C++ and C# installed for VS, and I see the usually expected
> > debugging support for native code working.
> >
> > I find that if I attach to inetinfo.exe debugging "Managed code" that
> > my native code breakpoints do not trigger even though I can set them.
> >
> > This is looking bizarre. Makes me think we are missing something
> > obvious.
> >
> >
> > //David
> > http://w3-4u.blogspot.com
> > http://blogs.msdn.com/David.Wang
> > //
> >
> >
> >
> >
> >
> > On Nov 2, 7:56 am, Mark wrote:
> > > Okay, looking at it again this morning,
> > > * tasklist shows that the dlls are loaded
> > >
> > > * the symbol files *don't* appear to be loaded, though I don't know why.
> > > The symbol files are in the same directory as the dlls in both cases. In VS
> > > Tools>Options, both of the symbols files are listed in the symbols search path
> > >
> > > * the VS8 Modules page only seems to show .Net assemblies loaded. I can't
> > > find any view that show loaded modules in general.
> > >
> > > * I set the breakpoints in cpp, then attached to the process, went back to
> > > the files and found the breakpoints disabled because the symbols weren't
> > > loaded.
> > >
> > > * I fired up VS8 without a solution and attached to the process. I opened
> > > the source file separately and couldn't set the breakpoints there either...
> > >
> > > * Can't find any UI to go and load the symbol files any more in VS8.
> > >
> > > Seems like VS8 has removed/demoted a lot of unmanaged debugging features.
> > > Either that or I just can't find them.
> > >
> > > Thanks
> > > Mark
> > >
> > >
> > >
> > > "David Wang" wrote:
> > > > And the symbols PDB matches the DLL?
> > >
> > > > I don't know how to verify that within VS. I can do that with NTSD/
> > > > WINDBG.
> > >
> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //
> > >
> > > > On Nov 1, 3:07 pm, Mark wrote:
> > > > > Just a little more info... I used tasklist and saw that the ISAPI dlls are
> > > > > indeed loaded, and they are being compiled debug... Still no breaking at
> > > > > breakpoints, unfortunately...
> > >
> > > > > Thanks
> > > > > Mark
> > >
> > > > > "Mark" wrote:
> > > > > > Hi David...
> > >
> > > > > > I've got them attached to the site, not the global level. I guess I should
> > > > > > go try it the other way. I've set break points in every method of the isapi
> > > > > > and haven't seen a hit.
> > >
> > > > > > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > > > > > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > > > > > from the output, though, that the code is getting run.
> > >
> > > > > > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > > > > > process.
> > >
> > > > > > "David Wang" wrote:
> > >
> > > > > > > Hmm, interesting.
> > >
> > > > > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > > > > debugging global ISAPI Filters (standard C++). I followed all your
> > > > > > > steps (other than the Modules page -- I know what you are talking
> > > > > > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > > > > > same information), and I actually hit my breakpoint with that request.
> > >
> > > > > > > Can you clarify if you are loading global or site ISAPI Filters?
> > >
> > > > > > > //David
> > > > > > >http://w3-4u.blogspot.com
> > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > //
> > >
> > > > > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > > > > Hi David...
> > >
> > > > > > > > Thank you for your reply. To answer your questions,
> > > > > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > > > > > .dlls.
> > >
> > > > > > > > 2. I have the website in low isolation mode
> > >
> > > > > > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > > > > > window between IISRESET and the first request coming in and priming the pump
> > > > > > > > with all the late-bound loads. If I
> > > > > > > > a. IISRESET
> > > > > > > > b. attach inetinfo.exe
> > > > > > > > c. open the Modules page (which is empty)
> > > > > > > > d. fire a request to the web server
> > > > > > > > I will see modules appear on the Modules page as the request is being served
> > > > > > > > and programs are being late-loaded.
> > >
> > > > > > > > If I close the Modules page and reopen it, it's empty again.
> > >
> > > > > > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > > > > > entered the paths to my ISAPI pdb files.
> > >
> > > > > > > > I figure the pdbs must be in there, since it does allow me to set
> > > > > > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > > > > > wouldn't let me set the breakpoints.
> > >
> > > > > > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > > > > > great. Using WinDbg just feels like driving a Yugo.
> > >
> > > > > > > > Thanks
> > > > > > > > Mark
> > >
> > > > > > > > "David Wang" wrote:
> > > > > > > > > First, let's verify some missing details in user configuration that
> > > > > > > > > can affect debugging.
> > >
> > > > > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > > > > > - What Application Isolation mode is the Default Website using
> > >
> > > > > > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > > > > > managed-code interop, and then a private debugging tool for managed
> > > > > > > > > code.
> > >
> > > > > > > > > Details:
> > > > > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > > > > > at the site-level are loaded/unloaded on the fly as needed.
> > >
> > > > > > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > > > > > not be. Hence, I wanted details to confirm.
> > >
> > > > > > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > > > > > behavior, in my mind)
> > >
> > > > > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > > > > > put the PDB alongside the DLL
> > >
> > > > > > > > > //David
> > > > > > > > >http://w3-4u.blogspot.com
> > > > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > > > //
> > >
> > > > > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > > > > Hi...
> > >
> > > > > > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > > > > > compared to VS 2003.
> > >
> > > > > > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > > > > ...
> > > > > > > > > > but the breakpoints are never hit.
> > >
> > > > > > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > > > > > in the list.
> > >
> > > > > > > > > > Is there any way to get to break points in unmanaged code in VS8?
> > >
> > > > > > > > > > Thanks
> > > > > > > > > > Mark
> > >
> > > > > > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > > > > > surprised me.- Hide quoted text -
> > >
> > > > > > > > - Show quoted text -- Hide quoted text -
> > >
> > > > > - Show quoted text -- Hide quoted text -
> > >
> > > - Show quoted text -
> >
> >
> >

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 02.11.2007 21:27:18 von mmodrall

Okay, I think I finally found it... In an article about Debugging COM+
applications I found mention of an option under the Debug > Attach To Process
command. There's a line that's grayed out that says what type of code you're
going to debug. The default is Managed.

You have to click the button next to the gray line to get a box saying what
the options are. You get a list of Managed, Native, and Script (the last
being incompatible with the other 2). You can check Native and Managed at
the same time though. That seems to get the symbol files loaded and other
things to show up in the Modules page. Attaching to Native code removes the
ability to detach.

So to debug an ISAPI in a running IIS, you
1. fire up VS8
2. Go to Debug > Attach To Process
3. In that dialog, check that the gray Attach To: line includes "Native
code". If it does not, click Select and enable it.
4. Find inetinfo.exe in the list and select it

Thanks
Mark


"David Wang" wrote:

> Hmm, I don't use VS at all so I really can't help on what's available/
> not. Could it be that you don't have the Visual C++ portion and its
> debugging support installed in VS?
>
> Or maybe when Visual Studio decides to auto-detect whether to do
> native or managed code debugging that it somehow does it incorrectly?
> (so attach/select manually)
>
> I have C++ and C# installed for VS, and I see the usually expected
> debugging support for native code working.
>
> I find that if I attach to inetinfo.exe debugging "Managed code" that
> my native code breakpoints do not trigger even though I can set them.
>
> This is looking bizarre. Makes me think we are missing something
> obvious.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
>
>
> On Nov 2, 7:56 am, Mark wrote:
> > Okay, looking at it again this morning,
> > * tasklist shows that the dlls are loaded
> >
> > * the symbol files *don't* appear to be loaded, though I don't know why.
> > The symbol files are in the same directory as the dlls in both cases. In VS
> > Tools>Options, both of the symbols files are listed in the symbols search path
> >
> > * the VS8 Modules page only seems to show .Net assemblies loaded. I can't
> > find any view that show loaded modules in general.
> >
> > * I set the breakpoints in cpp, then attached to the process, went back to
> > the files and found the breakpoints disabled because the symbols weren't
> > loaded.
> >
> > * I fired up VS8 without a solution and attached to the process. I opened
> > the source file separately and couldn't set the breakpoints there either...
> >
> > * Can't find any UI to go and load the symbol files any more in VS8.
> >
> > Seems like VS8 has removed/demoted a lot of unmanaged debugging features.
> > Either that or I just can't find them.
> >
> > Thanks
> > Mark
> >
> >
> >
> > "David Wang" wrote:
> > > And the symbols PDB matches the DLL?
> >
> > > I don't know how to verify that within VS. I can do that with NTSD/
> > > WINDBG.
> >
> > > //David
> > >http://w3-4u.blogspot.com
> > >http://blogs.msdn.com/David.Wang
> > > //
> >
> > > On Nov 1, 3:07 pm, Mark wrote:
> > > > Just a little more info... I used tasklist and saw that the ISAPI dlls are
> > > > indeed loaded, and they are being compiled debug... Still no breaking at
> > > > breakpoints, unfortunately...
> >
> > > > Thanks
> > > > Mark
> >
> > > > "Mark" wrote:
> > > > > Hi David...
> >
> > > > > I've got them attached to the site, not the global level. I guess I should
> > > > > go try it the other way. I've set break points in every method of the isapi
> > > > > and haven't seen a hit.
> >
> > > > > Don't ask me why, but the ISAPI is also instantiating a C# object wrapped in
> > > > > COM; I put breaks in the C# code but those don't get hit either. I can tell
> > > > > from the output, though, that the code is getting run.
> >
> > > > > The Modules page in VS8 in under Debug > Windows when you're attached to a
> > > > > process.
> >
> > > > > "David Wang" wrote:
> >
> > > > > > Hmm, interesting.
> >
> > > > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > > > debugging global ISAPI Filters (standard C++). I followed all your
> > > > > > steps (other than the Modules page -- I know what you are talking
> > > > > > about, but I cannot find it on VS8, so I used TLIST.EXE to give me the
> > > > > > same information), and I actually hit my breakpoint with that request.
> >
> > > > > > Can you clarify if you are loading global or site ISAPI Filters?
> >
> > > > > > //David
> > > > > >http://w3-4u.blogspot.com
> > > > > >http://blogs.msdn.com/David.Wang
> > > > > > //
> >
> > > > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > > > Hi David...
> >
> > > > > > > Thank you for your reply. To answer your questions,
> > > > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the same dir as the
> > > > > > > .dlls.
> >
> > > > > > > 2. I have the website in low isolation mode
> >
> > > > > > > 3. Sorry for the confusion about the Modules page. I was referring to the
> > > > > > > window between IISRESET and the first request coming in and priming the pump
> > > > > > > with all the late-bound loads. If I
> > > > > > > a. IISRESET
> > > > > > > b. attach inetinfo.exe
> > > > > > > c. open the Modules page (which is empty)
> > > > > > > d. fire a request to the web server
> > > > > > > I will see modules appear on the Modules page as the request is being served
> > > > > > > and programs are being late-loaded.
> >
> > > > > > > If I close the Modules page and reopen it, it's empty again.
> >
> > > > > > > I've also gone to the Modules page and under Symbol Settings I've manually
> > > > > > > entered the paths to my ISAPI pdb files.
> >
> > > > > > > I figure the pdbs must be in there, since it does allow me to set
> > > > > > > breakpoints; they just never get tripped. When the pdbs weren't loaded, it
> > > > > > > wouldn't let me set the breakpoints.
> >
> > > > > > > It's a shame if VS8 isn't any good for cpp debugging anymore; VS 2003 was
> > > > > > > great. Using WinDbg just feels like driving a Yugo.
> >
> > > > > > > Thanks
> > > > > > > Mark
> >
> > > > > > > "David Wang" wrote:
> > > > > > > > First, let's verify some missing details in user configuration that
> > > > > > > > can affect debugging.
> >
> > > > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > > > - Are you talking about ISAPI Extension or ISAPI Filter DLL
> > > > > > > > - What Application Isolation mode is the Default Website using
> >
> > > > > > > > Caveat: I do not use any Visual Studio to debug native or managed
> > > > > > > > code, so there may be real oddities in VS8, but let's take care of the
> > > > > > > > user-configuration first. For the curious, I use the NTSD/WINDBG
> > > > > > > > debuggers from Microsoft's Debugging Toolkit for native-code and
> > > > > > > > managed-code interop, and then a private debugging tool for managed
> > > > > > > > code.
> >
> > > > > > > > Details:
> > > > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe on IIS 5.1.
> > > > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolation Mode, and
> > > > > > > > in the Medium/High Isolation Mode, it's in some dllhost.exe. Use
> > > > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviously, you want
> > > > > > > > to attach the debugger to the right process executing the ISAPI or
> > > > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DLLs configured
> > > > > > > > at the site-level are loaded/unloaded on the fly as needed.
> >
> > > > > > > > Thus, only global ISAPI Filters are guaranteed to be loaded in
> > > > > > > > inetinfo.exe by the time you attach debuggers to it from a UI (there
> > > > > > > > are ways to attach debuggers ASAP or trigger breakpoints as soon as a
> > > > > > > > DLL load, but you are not using those techniques here). Anything else
> > > > > > > > MAY be in inetinfo.exe by the time you attach debuggers, but they may
> > > > > > > > not be. Hence, I wanted details to confirm.
> >
> > > > > > > > 2. IISRESET will restart all IIS-related processes, so I don't know
> > > > > > > > how you can see the Modules page work across IISRESET -- unless Visual
> > > > > > > > Studio started auto-re-attaching to processes (which is kinda scary
> > > > > > > > behavior, in my mind)
> >
> > > > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL is located, or
> > > > > > > > put the PDB alongside the DLL
> >
> > > > > > > > //David
> > > > > > > >http://w3-4u.blogspot.com
> > > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > > //
> >
> > > > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > > > Hi...
> >
> > > > > > > > > Haven't had to debug ISAPIs in a *long* time; this is the first time I've
> > > > > > > > > had to do it with the new tools, and I'm seeing weird things, at least
> > > > > > > > > compared to VS 2003.
> >
> > > > > > > > > I've got the ISAPIs installed on IIS 5.1.
> > > > > > > > > I've attached the debugger to inetinfo.exe.
> > > > > > > > > I've got my source loaded with breakpoints set (it let me set the
> > > > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > > > ...
> > > > > > > > > but the breakpoints are never hit.
> >
> > > > > > > > > Another weird thing - If I go to the Modules page, it doesn't show anything
> > > > > > > > > on the list unless the module is loaded *while* the Modules page is up. If I
> > > > > > > > > iisreset, bring up the modules page, then hit it with a request, a bunch of
> > > > > > > > > modules show up. If I close the modules page and reopen it, there's nothing
> > > > > > > > > in the list.
> >
> > > > > > > > > Is there any way to get to break points in unmanaged code in VS8?
> >
> > > > > > > > > Thanks
> > > > > > > > > Mark
> >
> > > > > > > > > ps Intellisense doesn't seem to work very well for C++ in VS8 either. Kinda
> > > > > > > > > surprised me.- Hide quoted text -
> >
> > > > > > > - Show quoted text -- Hide quoted text -
> >
> > > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
>
>

Re: IIS 5.1/Xp/VS8 debugging ISAPIs

am 03.11.2007 03:58:48 von David Wang

Glad it's resolved.

> I find that if I attach to inetinfo.exe debugging "Managed code"
> that my native code breakpoints do not trigger even though
> I can set them.

It sounds like you saw this behavior I mentioned earlier. Completely
non-obvious the first time.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//




On Nov 2, 1:27 pm, Mark wrote:
> Okay, I think I finally found it... In an article about Debugging COM+
> applications I found mention of an option under the Debug > Attach To Pro=
cess
> command. There's a line that's grayed out that says what type of code yo=
u're
> going to debug. The default is Managed.
>
> You have to click the button next to the gray line to get a box saying wh=
at
> the options are. You get a list of Managed, Native, and Script (the last
> being incompatible with the other 2). You can check Native and Managed at
> the same time though. That seems to get the symbol files loaded and other
> things to show up in the Modules page. Attaching to Native code removes =
the
> ability to detach.
>
> So to debug an ISAPI in a running IIS, you
> 1. fire up VS8
> 2. Go to Debug > Attach To Process
> 3. In that dialog, check that the gray Attach To: line includes "Native
> code". If it does not, click Select and enable it.
> 4. Find inetinfo.exe in the list and select it
>
> Thanks
> Mark
>
>
>
> "David Wang" wrote:
> > Hmm, I don't use VS at all so I really can't help on what's available/
> > not. Could it be that you don't have the Visual C++ portion and its
> > debugging support installed in VS?
>
> > Or maybe when Visual Studio decides to auto-detect whether to do
> > native or managed code debugging that it somehow does it incorrectly?
> > (so attach/select manually)
>
> > I have C++ and C# installed for VS, and I see the usually expected
> > debugging support for native code working.
>
> > I find that if I attach to inetinfo.exe debugging "Managed code" that
> > my native code breakpoints do not trigger even though I can set them.
>
> > This is looking bizarre. Makes me think we are missing something
> > obvious.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //
>
> > On Nov 2, 7:56 am, Mark wrote:
> > > Okay, looking at it again this morning,
> > > * tasklist shows that the dlls are loaded
>
> > > * the symbol files *don't* appear to be loaded, though I don't know w=
hy. =20
> > > The symbol files are in the same directory as the dlls in both cases.=
In VS
> > > Tools>Options, both of the symbols files are listed in the symbols se=
arch path
>
> > > * the VS8 Modules page only seems to show .Net assemblies loaded. I =
can't
> > > find any view that show loaded modules in general.
>
> > > * I set the breakpoints in cpp, then attached to the process, went ba=
ck to
> > > the files and found the breakpoints disabled because the symbols were=
n't
> > > loaded.
>
> > > * I fired up VS8 without a solution and attached to the process. I o=
pened
> > > the source file separately and couldn't set the breakpoints there eit=
her...
>
> > > * Can't find any UI to go and load the symbol files any more in VS8.
>
> > > Seems like VS8 has removed/demoted a lot of unmanaged debugging featu=
res. =20
> > > Either that or I just can't find them.
>
> > > Thanks
> > > Mark
>
> > > "David Wang" wrote:
> > > > And the symbols PDB matches the DLL?
>
> > > > I don't know how to verify that within VS. I can do that with NTSD/
> > > > WINDBG.
>
> > > > //David
> > > >http://w3-4u.blogspot.com
> > > >http://blogs.msdn.com/David.Wang
> > > > //
>
> > > > On Nov 1, 3:07 pm, Mark wrote:
> > > > > Just a little more info... I used tasklist and saw that the ISAP=
I dlls are
> > > > > indeed loaded, and they are being compiled debug... Still no bre=
aking at
> > > > > breakpoints, unfortunately...
>
> > > > > Thanks
> > > > > Mark
>
> > > > > "Mark" wrote:
> > > > > > Hi David...
>
> > > > > > I've got them attached to the site, not the global level. I gu=
ess I should
> > > > > > go try it the other way. I've set break points in every method=
of the isapi
> > > > > > and haven't seen a hit.
>
> > > > > > Don't ask me why, but the ISAPI is also instantiating a C# obje=
ct wrapped in
> > > > > > COM; I put breaks in the C# code but those don't get hit eithe=
r I can tell
> > > > > > from the output, though, that the code is getting run.
>
> > > > > > The Modules page in VS8 in under Debug > Windows when you're at=
tached to a
> > > > > > process.
>
> > > > > > "David Wang" wrote:
>
> > > > > > > Hmm, interesting.
>
> > > > > > > So, I go and install VS8 on XP Pro to see what's going on when
> > > > > > > debugging global ISAPI Filters (standard C++). I followed all=
your
> > > > > > > steps (other than the Modules page -- I know what you are tal=
king
> > > > > > > about, but I cannot find it on VS8, so I used TLIST.EXE to gi=
ve me the
> > > > > > > same information), and I actually hit my breakpoint with that=
request.
>
> > > > > > > Can you clarify if you are loading global or site ISAPI Filte=
rs?
>
> > > > > > > //David
> > > > > > >http://w3-4u.blogspot.com
> > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > //
>
> > > > > > > On Nov 1, 11:26 am, Mark wrote:
> > > > > > > > Hi David...
>
> > > > > > > > Thank you for your reply. To answer your questions,
> > > > > > > > 1. I have 2 ISAPI Filters, the pdbs for both live in the sa=
me dir as the
> > > > > > > > .dlls.
>
> > > > > > > > 2. I have the website in low isolation mode
>
> > > > > > > > 3. Sorry for the confusion about the Modules page. I was r=
eferring to the
> > > > > > > > window between IISRESET and the first request coming in and=
priming the pump
> > > > > > > > with all the late-bound loads. If I
> > > > > > > > a. IISRESET
> > > > > > > > b. attach inetinfo.exe
> > > > > > > > c. open the Modules page (which is empty)
> > > > > > > > d. fire a request to the web server
> > > > > > > > I will see modules appear on the Modules page as the reques=
t is being served
> > > > > > > > and programs are being late-loaded.
>
> > > > > > > > If I close the Modules page and reopen it, it's empty again.
>
> > > > > > > > I've also gone to the Modules page and under Symbol Setting=
s I've manually
> > > > > > > > entered the paths to my ISAPI pdb files.
>
> > > > > > > > I figure the pdbs must be in there, since it does allow me =
to set
> > > > > > > > breakpoints; they just never get tripped. When the pdbs we=
ren't loaded, it
> > > > > > > > wouldn't let me set the breakpoints.
>
> > > > > > > > It's a shame if VS8 isn't any good for cpp debugging anymor=
e; VS 2003 was
> > > > > > > > great. Using WinDbg just feels like driving a Yugo.
>
> > > > > > > > Thanks
> > > > > > > > Mark
>
> > > > > > > > "David Wang" wrote:
> > > > > > > > > First, let's verify some missing details in user configur=
ation that
> > > > > > > > > can affect debugging.
>
> > > > > > > > > - Where is the PDB for the ISAPI DLL?
> > > > > > > > > - Are you talking about ISAPI Extension or ISAPI Filter D=
LL
> > > > > > > > > - What Application Isolation mode is the Default Website =
using
>
> > > > > > > > > Caveat: I do not use any Visual Studio to debug native or=
managed
> > > > > > > > > code, so there may be real oddities in VS8, but let's tak=
e care of the
> > > > > > > > > user-configuration first. For the curious, I use the NTSD=
/WINDBG
> > > > > > > > > debuggers from Microsoft's Debugging Toolkit for native-c=
ode and
> > > > > > > > > managed-code interop, and then a private debugging tool f=
or managed
> > > > > > > > > code.
>
> > > > > > > > > Details:
> > > > > > > > > 1. Only ISAPI Filter is guaranteed to be in inetinfo.exe =
on IIS 5.1.
> > > > > > > > > ISAPI Extension can be in inetinfo.exe if in Low Isolatio=
n Mode, and
> > > > > > > > > in the Medium/High Isolation Mode, it's in some dllhost.e=
xe. Use
> > > > > > > > > TLIST.EXE from the Debugging Toolkit to find it. Obviousl=
y, you want
> > > > > > > > > to attach the debugger to the right process executing the=
ISAPI or
> > > > > > > > > else no breakpoints get hit. Furthermore, ISAPI Filter DL=
Ls configured
> > > > > > > > > at the site-level are loaded/unloaded on the fly as neede=
d
>
> > > > > > > > > Thus, only global ISAPI Filters are guaranteed to be load=
ed in
> > > > > > > > > inetinfo.exe by the time you attach debuggers to it from =
a UI (there
> > > > > > > > > are ways to attach debuggers ASAP or trigger breakpoints =
as soon as a
> > > > > > > > > DLL load, but you are not using those techniques here). A=
nything else
> > > > > > > > > MAY be in inetinfo.exe by the time you attach debuggers, =
but they may
> > > > > > > > > not be. Hence, I wanted details to confirm.
>
> > > > > > > > > 2. IISRESET will restart all IIS-related processes, so I =
don't know
> > > > > > > > > how you can see the Modules page work across IISRESET -- =
unless Visual
> > > > > > > > > Studio started auto-re-attaching to processes (which is k=
inda scary
> > > > > > > > > behavior, in my mind)
>
> > > > > > > > > 3. Make sure to tell VS where the PDB for the ISAPI DLL i=
s located, or
> > > > > > > > > put the PDB alongside the DLL
>
> > > > > > > > > //David
> > > > > > > > >http://w3-4u.blogspot.com
> > > > > > > > >http://blogs.msdn.com/David.Wang
> > > > > > > > > //
>
> > > > > > > > > On Nov 1, 10:17 am, Mark wrote:
> > > > > > > > > > Hi...
>
> > > > > > > > > > Haven't had to debug ISAPIs in a *long* time; this is t=
he first time I've
> > > > > > > > > > had to do it with the new tools, and I'm seeing weird =
things, at least
> > > > > > > > > > compared to VS 2003.
>
> > > > > > > > > > I've got the ISAPIs installed on IIS 5.1. =20
> > > > > > > > > > I've attached the debugger to inetinfo.exe. =20
> > > > > > > > > > I've got my source loaded with breakpoints set (it let =
me set the
> > > > > > > > > > breakpoints, so it seems the symbols are loaded)
> > > > > > > > > > ...
> > > > > > > > > > but the breakpoints are never hit.
>
> > > > > > > > > > Another weird thing - If I go to the Modules page, it d=
oesn't show anything
> > > > > > > > > > on the list unless the module is loaded *while* the Mod=
ules page is up. If I
> > > > > > > > > > iisreset, bring up the modules page, then hit it with a=
request, a bunch of
> > > > > > > > > > modules show up. If I close the modules page and reope=
n it, there's nothing
> > > > > > > > > > in the list.
>
> > > > > > > > > > Is there any way to get to break points in unmanaged co=
de in VS8?
>
> > > > > > > > > > Thanks
> > > > > > > > > > Mark
>
> > > > > > > > > > ps
>
> ...
>
> read more =BB- Hide quoted text -
>
> - Show quoted text -