[PATCH] D54187: Add debuginfo-tests that use cdb on Windows

Greg Bedwell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 7 09:38:04 PST 2018


gbedwell added a comment.

In https://reviews.llvm.org/D54187#1290282, @probinson wrote:

> +gbedwell
>
> Just to throw the idea out there, why not abandon debuginfo-tests entirely and try using Dexter for this. Dexter's design center is debug-info quality, not correctness, but it already knows how to drive several different debuggers on multiple platforms.


I initially looked at the possibility of expanding debuginfo-tests rather than reinventing the wheel with dexter, but in the end decided that the aims were different enough that it would be messy to shoehorn one into the other.  I'm open to it though.  I think there's a case to be made for potentially sharing some of the low-level "this is my generalized abstraction layer for how I can talk to lots of different debuggers" code as a library with different client tools, but I wouldn't want to bog down this discussion with that.

I'm wary of going too far off-topic for this review as this is more related to the 'in the long run' aside rather than the review itself, but as I was asked for a few more details, for reference, dexter drives LLDB via the Python API ( https://lldb.llvm.org/python-reference.html ) and Visual Studio via the DTE interface ( https://docs.microsoft.com/en-us/dotnet/api/envdte.dte?view=visualstudiosdk-2017 ).

For something like the hello.c example in this review, and equivalent dexter test would look like:

  #include <stdio.h>
  int main() {
    printf("hello world\n");
    int x = 42;  // DexWatch('x')
  }
  
  // DexExpectWatchValue('x', '42')

It will step through every line of the program it can, collecting info about each step until it reaches the program exit.  It won't currently produce a pass/fail, but rather a score.  That is, if it observes that 'x' is visible and has the value 42 it'll get a perfect score.  If it's not visible it'll get a worse score.  If it's visible, but tells me that the value is 43, it'll get a worse score still (on the assumption that actively lying to the user is a much worse sin than shrugging and saying "I don't know").
The best place to look for real examples is probably Jeremy and Tom's test corpus which they've been using to raise bugs against LLVM: https://github.com/SNSystems/dexter/pull/4/commits/825c2c9aaccc0fb38ede2c8732152d6500c22ac5 
(see also http://llvm.org/devmtg/2018-04/slides/Bedwell-Measuring_the_User_Debugging_Experience_poster.png )


https://reviews.llvm.org/D54187





More information about the cfe-commits mailing list