diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-30 00:19:05 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-30 00:19:05 +0000 |
commit | 66373dd2d508407ed5894ad65f654eea8d892319 (patch) | |
tree | cea73051005449ba4de8837074cc40dd08acb9f0 /tools | |
parent | 1ef28dbcf1a8b72f590f2d73bc204e85605ab605 (diff) |
[libclang] Have c-index-test output more information about a cursor with -cursor-at:
-the location of the cursor
-its extent
-its spelling
Part of radar://11113120
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/c-index-test/c-index-test.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index 39bb8ebed0..5dd9254631 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -1439,7 +1439,19 @@ static int inspect_cursor_at(int argc, const char **argv) { if (I + 1 == Repeats) { CXCompletionString completionString = clang_getCursorCompletionString( Cursor); + CXSourceLocation CursorLoc = clang_getCursorLocation(Cursor); + CXString Spelling; + const char *cspell; + unsigned line, column; + clang_getSpellingLocation(CursorLoc, 0, &line, &column, 0); + printf("%d:%d ", line, column); PrintCursor(Cursor); + PrintCursorExtent(Cursor); + Spelling = clang_getCursorSpelling(Cursor); + cspell = clang_getCString(Spelling); + if (cspell && strlen(cspell) != 0) + printf(" Spelling=%s", cspell); + clang_disposeString(Spelling); if (completionString != NULL) { printf("\nCompletion string: "); print_completion_string(completionString, stdout); |