dprintf() %s Max String Length

does dprintf have a MAX_STRING LENGTH parameter ?

i see

#define dprintf (ExtensionApis.lpOutputRoutine)

typedef struct _WINDBG_EXTENSION_APIS {
ULONG nSize;
PWINDBG_OUTPUT_ROUTINE lpOutputRoutine;

typedef
VOID
(WDBGAPIV*PWINDBG_OUTPUT_ROUTINE)(
PCSTR lpFormat,

);

in one of the disassembly i see

0006F824 6D656050 |buffer = OFFSET dbgeng.g_OutBuffer
0006F828 00003FFF |count = 3FFF (16383.) <---------------- is this
the MAX COUNT ???
0006F82C 6D596F70 |format = "Comment: ‘%s’
"
0006F830 0006F880 \arglist = 0006F880

how long a string can i pass to dprintf() ??
say with %s format specifier ?

i wanted to find the length of buffer for one of the dprintf() calls
is there any way i could find whats the sizeof buffer that holds the String ?

There is almost certainly a reasonable limit to the circular buffer on
the target; I just don’t know what it is.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of raj_r
Sent: Friday, June 29, 2007 11:33
To: Kernel Debugging Interest List
Subject: [windbg] dprintf() %s Max String Length

does dprintf have a MAX_STRING LENGTH parameter ?

i see

#define dprintf (ExtensionApis.lpOutputRoutine)

typedef struct _WINDBG_EXTENSION_APIS {
ULONG nSize;
PWINDBG_OUTPUT_ROUTINE lpOutputRoutine;

typedef
VOID
(WDBGAPIV*PWINDBG_OUTPUT_ROUTINE)(
PCSTR lpFormat,

);

in one of the disassembly i see

0006F824 6D656050 |buffer = OFFSET dbgeng.g_OutBuffer
0006F828 00003FFF |count = 3FFF (16383.) <---------------- is this
the MAX COUNT ???
0006F82C 6D596F70 |format = "Comment: ‘%s’
"
0006F830 0006F880 \arglist = 0006F880

how long a string can i pass to dprintf() ??
say with %s format specifier ?

i wanted to find the length of buffer for one of the dprintf() calls
is there any way i could find whats the sizeof buffer that holds the
String ?


You are currently subscribed to windbg as: xxxxx@evitechnology.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

raj_r wrote:

does dprintf have a MAX_STRING LENGTH parameter ?

in one of the disassembly i see

0006F824 6D656050 |buffer = OFFSET dbgeng.g_OutBuffer
0006F828 00003FFF |count = 3FFF (16383.) <---------------- is this
the MAX COUNT ???
0006F82C 6D596F70 |format = "Comment: ‘%s’
"
0006F830 0006F880 \arglist = 0006F880

how long a string can i pass to dprintf() ??
say with %s format specifier ?

i wanted to find the length of buffer for one of the dprintf() calls
is there any way i could find whats the sizeof buffer that holds the
String ?

That’s not a disassembly – that’s a stack dump. It looks to me like a
call to vsnprintf. If so, the 0x3FFF would be the maximum length of the
output buffer. You don’t really want debug strings longer than that,
anyway.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim,

sorry about the word disassembly yes its a stackdump of vsnprintf()

i wasnt coding i was trying to demarcate the size of buffer in a
header (that is max 0x1000 in size it looks like it is not possible
at this moment

i read in windbg help file that some sytems split strings that are
greater than 16k so you must use multiple requests

now if it can print 16k strings then i simply have to find a different
approach to find the length of buffer
possibly shifting hradware breakpoints byte by byte and noting when a
differnt line apart from dprintf() accessed the address space

regards

raj_r

On 6/29/07, Tim Roberts wrote:
> raj_r wrote:
> > does dprintf have a MAX_STRING LENGTH parameter ?
> > …
> > in one of the disassembly i see
> >
> > 0006F824 6D656050 |buffer = OFFSET dbgeng.g_OutBuffer
> > 0006F828 00003FFF |count = 3FFF (16383.) <---------------- is this
> > the MAX COUNT ???
> > 0006F82C 6D596F70 |format = "Comment: ‘%s’
> > "
> > 0006F830 0006F880 \arglist = 0006F880
> >
> > how long a string can i pass to dprintf() ??
> > say with %s format specifier ?
> >
> > i wanted to find the length of buffer for one of the dprintf() calls
> > is there any way i could find whats the sizeof buffer that holds the
> > String ?
>
> That’s not a disassembly – that’s a stack dump. It looks to me like a
> call to vsnprintf. If so, the 0x3FFF would be the maximum length of the
> output buffer. You don’t really want debug strings longer than that,
> anyway.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> You are currently subscribed to windbg as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>