snsystems / dexter Goto Github PK
View Code? Open in Web Editor NEWDExTer - Debug Experience Tester
License: MIT License
DExTer - Debug Experience Tester
License: MIT License
If i run dexter with the following command:
py -3 .\dexter.py test .\tests\nostdlib\struct_inline_calls\ --builder clang-cl_vs2015 --debugger vs2015 --cflags="/Zi /Od" --ldflags="/Zi" --verbose
given the following test case, I'm unable to read the memory of a struct passed by value to doSomeMath:
`
struct foo {
static const size_t size = 7;
int a;
int b;
short c;
short data[size];
};
volatile foo * gpAwk;
inline void initABC(foo & bar, const int arg) {
bar.a = 6 + arg;
bar.b = 10 + arg; // DexLabel('initABC_str')
bar.c = 256 + arg; // DexLabel('initABC_end')
}
inline void initData(foo & bar, const int arg) {
for (size_t ix = 0; ix != bar.size; ++ix) { // DexLabel('initData_str')
bar.data[ix] = ix + arg; // DexLabel('initData_end')
}
}
inline int doSomeMath(foo bar, const int arg) {
int someMath = bar.a + bar.b + bar.c;
someMath += arg; // DexLabel('doSomeMath_str')
return someMath; // DexLabel('doSomeMath_end')
}
inline int makeSomePointers(foo & bar) {
if (bar.a) { // DexLabel('makeSomePointers_str')
gpAwk = &bar;
return 0;
}
return bar.a + bar.b + bar.c; // DexLabel('makeSomePointers_end')
}
int main(int argc, const char * argv[]) {
argc -= 1; // DexLabel('main_str')
foo bar;
initABC(bar, argc);
initData(bar, argc);
makeSomePointers(bar);
int math = doSomeMath(bar, argc);
return math +
bar.a +
bar.b +
bar.c +
bar.data[1] +
bar.data[6]; // DexLabel('main_end')
}
// DexExpectWatchType('bar', 'foo', from_line='main_str', to_line='main_end')
// DexExpectWatchValue('bar.a', 6, from_line='initABC_str', to_line='initABC_end')
// DexExpectWatchValue('bar.b', 0, 10, from_line='initABC_str', to_line='initABC_end')
// DexExpectWatchValue('bar.c', 0, from_line='initABC_str', to_line='initABC_end')
// DexExpectWatchValue('bar.a', 6, from_line='initData_str', to_line='initData_end')
// DexExpectWatchValue('bar.b', 10, from_line='initData_str', to_line='initData_end')
// DexExpectWatchValue('bar.c', 256, from_line='initData_str', to_line='initData_end')
// DexExpectWatchValue('bar.data[1]', 0, 1, from_line='initData_str', to_line='initData_end')
// DexExpectWatchValue('bar.data[6]', 0, 6, from_line='initData_str', to_line='initData_end')
// DexExpectWatchValue('bar.a', 6, from_line='doSomeMath_str', to_line='doSomeMath_end')
// DexExpectWatchValue('bar.b', 10, from_line='doSomeMath_str', to_line='doSomeMath_end')
// DexExpectWatchValue('bar.c', 256, from_line='doSomeMath_str', to_line='doSomeMath_end')
// DexExpectWatchValue('bar.data[1]', 0, 1, from_line='doSomeMath_str', to_line='doSomeMath_end')
// DexExpectWatchValue('bar.data[6]', 0, 6, from_line='doSomeMath_str', to_line='doSomeMath_end')
// DexExpectWatchValue('bar.a', 6, from_line='makeSomePointers_str', to_line='makeSomePointers_end')
// DexExpectWatchValue('bar.b', 10, from_line='makeSomePointers_str', to_line='makeSomePointers_end')
// DexExpectWatchValue('bar.c', 256, from_line='makeSomePointers_str', to_line='makeSomePointers_end')
// DexExpectWatchValue('bar.data[1]', 1, from_line='makeSomePointers_str', to_line='makeSomePointers_end')
// DexExpectWatchValue('bar.data[6]', 6, from_line='makeSomePointers_str', to_line='makeSomePointers_end')
// DexExpectWatchValue('bar.a', 0, 6, from_line='main_str', to_line='main_end')
// DexExpectWatchValue('bar.b', 0, 10, from_line='main_str', to_line='main_end')
// DexExpectWatchValue('bar.c', 0, 256, from_line='main_str', to_line='main_end')
// DexExpectWatchValue('bar.data[1]', 0, 1, from_line='main_str', to_line='main_end')
// DexExpectWatchValue('bar.data[6]', 0, 6, from_line='main_str', to_line='main_end')
`
for all the attempted reads between doSomeMath_str and doSomeMath_end i get the following message:
` test.cpp:25-26 [bar.a] ExpectValue [4/7]
result could not be retrieved:
step 36 () [-4]
step 37 ()
test.cpp:25-26 [bar.b] ExpectValue [4/7]
result could not be retrieved:
step 36 () [-4]
step 37 ()
test.cpp:25-26 [bar.c] ExpectValue [4/7]
result could not be retrieved:
step 36 () [-4]
step 37 ()
test.cpp:25-26 [bar.data[1]] ExpectValue [8/14]
result could not be retrieved:
step 36 () [-4]
step 37 () [-4]
test.cpp:25-26 [bar.data[6]] ExpectValue [8/14]
result could not be retrieved:
step 36 () [-4]
step 37 () [-4]
`
however, If I spin up visual studio and run the debugger I have no problems viewing the struct members with the doSomeMath function.
I have a problem with this code [0], which seems to be designed to make the debugger "continue" if we're not yet in a correct source file. On windows under dbgeng, step_info.current_location.path
is
c:\users\jmorse\source\debuginfo-tests\dexter-tests\hello.c
And self.context.options.source_files
is
['C:\\Users\\gbmorsej\\source\\o\\debuginfo-tests\\dexter-tests\\hello.c']
Which are two very different strings. The symptom is that dbgeng doesn't implement "go"; but even if it did, this would still be broken.
Ultimately I don't think we should be trying to resolve the paths that the debugger coughs up into paths on the actual filesystem -- or if we do, we should make that the debugger drivers problem, not generic code.
[0]
dexter/dex/debugger/DebuggerBase.py
Line 158 in 861102e
In the RFC which we're totally uploading to llvm sometime soon, and isn't on this github project yet, all the builder scripts that dexter uses just call "clang". They don't actually build things using the clang binaries in the build tree that debuginfo-tests is associated with.
Would be nice to test msvc's /Zo: https://docs.microsoft.com/en-us/cpp/build/reference/zo-enhance-optimized-debugging?view=vs-2017
Contributing to DExTer section of the README isn't complete.
We require llvm-lit
and the other tools frequently used with it: not
and FileCheck
. I don't know if there's a packaged version of these hosted anywhere like there is for llvm-lit`.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.