none
Call stack without full file path RRS feed

  • Question

  • Hello,

    is there a way to display a call stack in Windbg without displaying the full file path. Please note that I still want the file name in the call stack output but not the complete file path.  please let me know if that's possible.

    Thursday, March 6, 2014 7:14 PM

Answers

  • Nothing that I am aware of - probably something, which bears a certain resemblance to perl ...  

    while(my $dire = <STDIN>){
     $dire =~ s/^(.*)(\[.*\\)(.*)\]$/$1$2$3/;
     if(defined $1){
    	print $1 . $3 . "\n";
     } else {
    	print $dire;
     }
    }

    0:000> k
    ChildEBP RetAddr  
    0032f838 0007972f blue!blue+0x27 [c:\users\sammy\documents\visual studio 2010\projects\blue\blue\blue.cpp @ 37]
    0032f97c 0007da59 blue!wmain+0x6f [c:\users\sammy\documents\visual studio 2010\projects\blue\blue\blue.cpp @ 64]
    0032f9c8 0007d91f blue!__tmainCRTStartup+0x129 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 278]
    0032f9d0 7729d2e9 blue!wmainCRTStartup+0xf [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 189]
    0032f9dc 77661603 kernel32!BaseThreadInitThunk+0xe
    0032fa1c 776615d6 ntdll!__RtlUserThreadStart+0x23
    0032fa34 00000000 ntdll!_RtlUserThreadStart+0x1b
    
    0:000> .shell -ci "k" perl.exe c:\temp\FileP.pl
    ChildEBP RetAddr  
    0032f838 0007972f blue!blue+0x27 blue.cpp @ 37
    0032f97c 0007da59 blue!wmain+0x6f blue.cpp @ 64
    0032f9c8 0007d91f blue!__tmainCRTStartup+0x129 crt0.c @ 278
    0032f9d0 7729d2e9 blue!wmainCRTStartup+0xf crt0.c @ 189
    0032f9dc 77661603 kernel32!BaseThreadInitThunk+0xe
    0032fa1c 776615d6 ntdll!__RtlUserThreadStart+0x23
    0032fa34 00000000 ntdll!_RtlUserThreadStart+0x1b
    .shell: Process exited

    Would be interesting, if someone has experience with PyKd or maybe PowerDbg ...

    No warranty
    With kind regards


    • Marked as answer by Satyemm Wednesday, March 12, 2014 11:34 PM
    Sunday, March 9, 2014 11:19 PM

All replies

  • Why is this bothering you?
    Friday, March 7, 2014 7:54 AM
  • It makes parsing difficult for some internal tools(written on top of windbg) that do parsing of call stack output. And as I said the tool is still interested in filename.

    Also while it doesn't block me from doing anything, most of the times during debugging I also don't need the file path because I know where my project is but I do need the file name. And it annoys me to scroll right to actually see the file name when the path becomes really long.

    So I just wanted to check if there is such a command in windbg or not.

    Friday, March 7, 2014 6:32 PM
  • Nothing that I am aware of - probably something, which bears a certain resemblance to perl ...  

    while(my $dire = <STDIN>){
     $dire =~ s/^(.*)(\[.*\\)(.*)\]$/$1$2$3/;
     if(defined $1){
    	print $1 . $3 . "\n";
     } else {
    	print $dire;
     }
    }

    0:000> k
    ChildEBP RetAddr  
    0032f838 0007972f blue!blue+0x27 [c:\users\sammy\documents\visual studio 2010\projects\blue\blue\blue.cpp @ 37]
    0032f97c 0007da59 blue!wmain+0x6f [c:\users\sammy\documents\visual studio 2010\projects\blue\blue\blue.cpp @ 64]
    0032f9c8 0007d91f blue!__tmainCRTStartup+0x129 [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 278]
    0032f9d0 7729d2e9 blue!wmainCRTStartup+0xf [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 189]
    0032f9dc 77661603 kernel32!BaseThreadInitThunk+0xe
    0032fa1c 776615d6 ntdll!__RtlUserThreadStart+0x23
    0032fa34 00000000 ntdll!_RtlUserThreadStart+0x1b
    
    0:000> .shell -ci "k" perl.exe c:\temp\FileP.pl
    ChildEBP RetAddr  
    0032f838 0007972f blue!blue+0x27 blue.cpp @ 37
    0032f97c 0007da59 blue!wmain+0x6f blue.cpp @ 64
    0032f9c8 0007d91f blue!__tmainCRTStartup+0x129 crt0.c @ 278
    0032f9d0 7729d2e9 blue!wmainCRTStartup+0xf crt0.c @ 189
    0032f9dc 77661603 kernel32!BaseThreadInitThunk+0xe
    0032fa1c 776615d6 ntdll!__RtlUserThreadStart+0x23
    0032fa34 00000000 ntdll!_RtlUserThreadStart+0x1b
    .shell: Process exited

    Would be interesting, if someone has experience with PyKd or maybe PowerDbg ...

    No warranty
    With kind regards


    • Marked as answer by Satyemm Wednesday, March 12, 2014 11:34 PM
    Sunday, March 9, 2014 11:19 PM
  • Thanks mate. This is something that can be helpful. I will try it out.
    Wednesday, March 12, 2014 11:34 PM