.logopen

Hi

How to create a log file locally during remote debugging (.logopen seems to open a log file on remote computer) or at least to increase the Debugger Command Window buffer size?

TIA
Andrew

Have you tried the open log file GUI menu option in WinDbg?

? S

-----Original Message-----
From: xxxxx@hotmail.com
Sent: Sunday, January 11, 2009 08:17
To: Windows System Software Devs Interest List
Subject: [ntdev] .logopen

Hi

How to create a log file locally during remote debugging (.logopen seems to open a log file on remote computer) or at least to increase the Debugger Command Window buffer size?

TIA
Andrew


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I believe I did try to open a log file using GUI w/ the same result

Preamble: It’s been a while since I’ve setup any type of dbgeng based
remote debugging, and I find the documentation of the whole subject to
be essentially incomprehensible, perhaps even the worst of all the
windbg documentation, which is saying something, so no guarantees about
any of this being necessarily correct.

Q. Are you (a) remoting through the debugger itself, (b) using a kd
connection server (kdsrv, a. k. .a - ‘smart client’) or neither? If the
answer is neither, then I won’t be able to help you, because I’ve never
used ‘remote,’ or any of the other methods.

If (a), then paths specified on the command line or as part of a windbg
command/metacommand/extension command are resolved on the server, not
the client; but for (b), the opposite is true - paths are resolved on
the ‘smart client.’ There are some exceptions - even for (a), source
files are resolved on the client, for example, but I - and perhaps the
log file is one of them; I really

However, just to make things a little more confusing, I believe that
when using 'smart client’connection, even though paths specified on the
command line and as part of commands are resolved on the ‘smart client,’
dbgeng uses the environment variables of the server, so any environment
variables which you wish to use must be specified on the server, not the
‘smart client,’ and I don’t recall whether they are resolved on the
client or server.

  1. How are you specifying the name of the log file - on the command
    line, via the ui, with an environment variable, as part of the
    ‘.openlog’ command, or are you just typing ‘.openlog’ with no argument?
    If you’re using either of _NT_DEBUG_LOG_FILE_OPEN or
    _NT_DEBUG_LOG_FILE_APPEND, then whether you’re using (a) or (b) might
    matter.

I’m not that I helped you at all, but that’s what I recall.

Good luck,

mm

xxxxx@hotmail.com wrote:

Hi

How to create a log file locally during remote debugging (.logopen seems to open a log file on remote computer) or at least to increase the Debugger Command Window buffer size?

TIA
Andrew

I am connected to a remote session thru WinDbg and I try to create a log file using the .logopen command w/ a local disk path and it looks like this path is resolved on a server

Actually, this is exactly my question - how to force a log file to be created locally in this situation?

Never tried, but could it work?

.logopen \c$\mylog.txt

Not sure but worth a try !

Well, as if I’ve to sign something !
Prokash Sinha
http://prokash.squarespace.com
Success has many fathers, but failure is an orphan.

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Sunday, January 11, 2009 1:19 PM
Subject: RE:[ntdev] .logopen

>I am connected to a remote session thru WinDbg and I try to create a log
>file using the .logopen command w/ a local disk path and it looks like this
>path is resolved on a server
>
> Actually, this is exactly my question - how to force a log file to be
> created locally in this situation?
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Unless I’m missing something, this is by design. I think what pro
posted will work, though I’d probably just map a drive to do it, but
given that you want this path to be local, have you considered using
kdsrv?

I definitely do not claim to understand any of the merits of one over
the other, and for that matter, I’m not really even sure I understand
the basic scenario that the windbg docs outline fore the remoting
through the debugger case, so I’m not offering advice either way, but
just giving you something to consider.

From the docs on ‘remoting through the debugger:’

‘If you simply have one server and one client and they can freely
connect to each other, the same debugger binaries are installed on both
the client and the server, and the debugging technician who will be
operating the client will be able to talk to someone in the room with
the server, this is the recommended method.’

All I get out of that is that it sounds like you need a second person to
use this techique, which can’t be the common case, and the use of the
word ‘simply’ really excellent.

Good luck,

mm

xxxxx@hotmail.com wrote:

I am connected to a remote session thru WinDbg and I try to create a log file using the .logopen command w/ a local disk path and it looks like this path is resolved on a server

Actually, this is exactly my question - how to force a log file to be created locally in this situation?

I definitely do not claim to understand any of the merits of one over

the other, and for that matter, I’m not really even sure I understand the
basic scenario that the windbg docs outline fore the remoting through the
debugger case, so I’m not offering advice either way, but just giving you
something to consider.

Martin,

I think remoting has its use. Does not matter how we achieve it, but when
multiple people want to get the session to debug something ( including
bee-on-the-wall type person(s) who can observe what commands are being
issued by the experts ). Also for customer’s site trouble shooting, this
remoting helps…

Having local logs is just a choice I guess, so that none of the participant
have to go full the master document on the server.

BTW, I recently added an article for some basics of Windbg commands on the
following link(blogs). Anyone new in the 64bit venture might get some
immediate help and redirections ( but it is nowhere complete or
comprehesive).

Well, as if I’ve to sign something !
Prokash Sinha
http://prokash.squarespace.com
Success has many fathers, but failure is an orphan.

.logopen \\c$\mylog.txt does not seem to work

What did you type? Pls post it without revealing the ip address of your
machine. Including the response you get from the debugger.

Well, as if I’ve to sign something !
Prokash Sinha
http://prokash.squarespace.com
Success has many fathers, but failure is an orphan.

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Sunday, January 11, 2009 3:07 PM
Subject: RE:[ntdev] .logopen

> .logopen \\c$\mylog.txt does not seem to work
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

3: kd> .logopen \xxx.xxx.xxx.xxx\e$\mylog.txt

Log file could not be opend

stop the harvest…this works

  • shared a folder WLOG
  • .logopen \MYPCNAME\WLOG\mylog.txt

but 10 times slowly than w/o logging

Thank you for the idea

Do yourself a favor and at least for know remove some of the unknown
here - try mapping a drive instead? What pro is suggesting should
clearly work from a Windows point of view, but this is windbg, and it
would be even remotely surprising if windbg had it’s own idea of how
this should be parsed, et. c. Also, those are Admin shares, so you have
to have the correct credentials by default, or is going to fail, whereas
if you map a driver, you can address the credentials ahead of time.

Good luck,

mm

xxxxx@hotmail.com wrote:

3: kd> .logopen \xxx.xxx.xxx.xxx\e$\mylog.txt

Log file could not be opend

I played around a bit and didn’t find a nice, exposed way to do this. Local logging seems to turn itself off whenever you connect to a -remote session, no matter how you started it, at least for me. That is a bit unfortunate. I have never had a problem with this myself, but I can see where it’d be useful.

If both machines can talk to eachother over the network, to be honest, I’d just open a log on the remote machine and copy it over afterwards. I would try to avoid doing debugger logging over a network share as I’m not sure that the debugger logging facility will handle the case of the file going away due to a network dropout in a particularly great way (never tried, but I kind of doubt it, and I’d rather not risk my debugging session on it, anyway).

  • S

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Sunday, January 11, 2009 3:39 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] .logopen

I believe I did try to open a log file using GUI w/ the same result


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

OKAY, so it is the sharing not typing IP address, right?.

It’s winter, so we all stop harvesting now :slight_smile:

Well, as if I’ve to sign something !
Prokash Sinha
http://prokash.squarespace.com
Success has many fathers, but failure is an orphan.

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Sunday, January 11, 2009 3:23 PM
Subject: RE:[ntdev] .logopen

> stop the harvest…this works
>
> - shared a folder WLOG
> - .logopen \MYPCNAME\WLOG\mylog.txt
>
> but 10 times slowly than w/o logging
>
> Thank you for the idea
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

Yep, I tried to open a log file before establishing remote connection hoping that the log file will be ?inherited? ? no luck?

Why it is so difficult just to re-route the Debugger Command Window spit to the local file?

That worked for me: the output was stored in the local machine, that is running WinDbg:

windbg.exe -logo C:\MyLog\remote-host.windbg -k com:port=com2,baud=115200

Good luck,
S.

The OP is speaking of -remote style debugging, and not initiating a KD connection from the local debugger.

  • S

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, January 12, 2009 1:19 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] .logopen

That worked for me: the output was stored in the local machine, that is running WinDbg:

windbg.exe -logo C:\MyLog\remote-host.windbg -k com:port=com2,baud=115200

Good luck,
S.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

On 1/11/09, xxxxx@hotmail.com wrote:
>
> Hi
>
> How to create a log file locally during remote debugging (.logopen seems to
> open a log file on remote computer) or at least to increase the Debugger
> Command Window buffer size?
>
> TIA
> Andrew

not sure if this would help as i have never remoted

see if what this says makes any sense to your request

As a more detailed example of remote debugging with remote.exe, assume the
following about a local host computer in a three-computer kernel debugging
scenario:
**

- Debugging needs to take place over a null-modem cable on COM2.
- The symbol files are in the folder c:\winnt\symbols.
- A log file called debug.log is created in c:\temp.

The log file holds a copy of everything you see on the Debug screen during
your debug session. All input from the person doing the debugging, and all
output from the kernel debugger on the target system, is written to
that logfile.

A sample batch file for running a debugging session on the local host is:

set _NT_DEBUG_PORT=com2
set _NT_DEBUG_BAUD_RATE=19200
set _NT_SYMBOL_PATH=c:\winnt\symbols
set _NT_LOG_FILE_OPEN=c:\temp\debug.log
remote /s “KD -v” debug

Note If this batch file is not in the same directory as Remote.exe, and
Remote.exe is not in a directory listed in the system path, then you
should give the full path to the utility when invoking Remote.exe in this
batch file.

After this batch file is run, anyone with a Windows computer that is
networked to the local host computer can connect to the debug session by
using the following command:

remote /c computername debug

where computername is the NetBIOS name of the local host computer.

regards

raj_r