1 | // |
---|---|
2 | // Copyright (c) Microsoft. All rights reserved. |
3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
4 | // |
5 | |
6 | #include "standardpch.h" |
7 | #include "verbdump.h" |
8 | #include "logging.h" |
9 | #include "methodcontext.h" |
10 | #include "methodcontextiterator.h" |
11 | #include "errorhandling.h" |
12 | |
13 | int verbDump::DoWork(const char* nameOfInput, int indexCount, const int* indexes) |
14 | { |
15 | LogVerbose("Dumping '%s' to console", nameOfInput); |
16 | |
17 | MethodContextIterator mci(indexCount, indexes); |
18 | if (!mci.Initialize(nameOfInput)) |
19 | return -1; |
20 | |
21 | int dumpedCount = 0; |
22 | |
23 | while (mci.MoveNext()) |
24 | { |
25 | MethodContext* mc = mci.Current(); |
26 | mc->dumpToConsole(mci.MethodContextNumber()); |
27 | dumpedCount++; |
28 | } |
29 | |
30 | LogVerbose("Dumped %d methodContexts", dumpedCount); |
31 | |
32 | if (!mci.Destroy()) |
33 | return -1; |
34 | |
35 | return 0; |
36 | } |
37 |