MCPcopy Create free account
hub / github.com/DFHack/dfhack / printVec

Function printVec

plugins/devel/vectors.cpp:131–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static void printVec(color_ostream &con, const char* msg, t_vecTriplet *vec,
132 uintptr_t start, uintptr_t pos, std::vector<t_memrange> &ranges)
133{
134 uintptr_t length = (intptr_t)vec->end - (intptr_t)vec->start;
135 uintptr_t offset = pos - start;
136
137 con.print("{:8} offset 0x{:06x}, addr 0x{:01x}, start 0x{:01x}, length {:}",
138 msg, offset, pos, intptr_t(vec->start), length);
139 if (length >= 4 && length % 4 == 0)
140 {
141 void *ptr = vec->start;
142 for (int level = 0; level < 2; level++)
143 {
144 if (inAnyRange(ranges, ptr))
145 ptr = *(void**)ptr;
146 }
147 std::string classname;
148 if (Core::getInstance().vinfo->getVTableName(ptr, classname))
149 con.print(", 1st item: {}", classname);
150 }
151 con.print("\n");
152}
153
154command_result df_vectors (color_ostream &con, vector <string> & parameters)
155{

Callers 1

df_vectorsFunction · 0.85

Calls 2

inAnyRangeFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected