MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / parseEntries

Method parseEntries

src/Processors/Formats/Impl/DWARFBlockInputFormat.cpp:375–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375Chunk DWARFBlockInputFormat::parseEntries(UnitState & unit)
376{
377 const auto & header = getPort().getHeader();
378 const auto & column_name_to_idx = getColumnNameToIdx();
379 std::array<bool, COL_COUNT> need{};
380 for (const std::string & name : header.getNames())
381 need[column_name_to_idx.at(name)] = true;
382
383 /// For parallel arrays, we nominate one of them to be responsible for populating the offsets vector.
384 need[COL_ATTR_NAME] = need[COL_ATTR_NAME] || need[COL_ATTR_FORM] || need[COL_ATTR_INT] || need[COL_ATTR_STR];
385 need[COL_ANCESTOR_TAGS] = need[COL_ANCESTOR_TAGS] || need[COL_ANCESTOR_OFFSETS];
386
387 auto col_offset = ColumnVector<UInt64>::create();
388 auto col_size = ColumnVector<UInt32>::create();
389 auto col_tag = ColumnVector<UInt16>::create();
390 auto col_ancestor_tags = ColumnVector<UInt16>::create();
391 auto col_ancestor_dwarf_offsets = ColumnVector<UInt64>::create();
392 auto col_ancestor_array_offsets = ColumnVector<UInt64>::create();
393 auto col_name = ColumnString::create();
394 auto col_linkage_name = ColumnString::create();
395 ColumnIndex col_decl_file;
396 auto col_decl_line = ColumnVector<UInt32>::create();
397 auto col_ranges_start = ColumnVector<UInt64>::create();
398 auto col_ranges_end = ColumnVector<UInt64>::create();
399 auto col_ranges_offsets = ColumnVector<UInt64>::create();
400 auto col_attr_name = ColumnVector<UInt16>::create();
401 auto col_attr_form = ColumnVector<UInt16>::create();
402 auto col_attr_int = ColumnVector<UInt64>::create();
403 auto col_attr_str = ColumnLowCardinality::create(
404 MutableColumnPtr(ColumnUnique<ColumnString>::create(ColumnString::create()->cloneResized(1), /*is_nullable*/ false)),
405 MutableColumnPtr(ColumnVector<UInt16>::create()),
406 /*is_shared=*/false);
407 auto col_attr_offsets = ColumnVector<UInt64>::create();
408 size_t num_rows = 0;
409 auto err = llvm::Error::success();
410
411 while (num_rows < 65536)
412 {
413 ++num_rows;
414 uint64_t die_offset = unit.offset;
415 if (need[COL_OFFSET])
416 col_offset->insertValue(die_offset);
417 if (need[COL_ANCESTOR_TAGS])
418 {
419 for (size_t i = unit.stack.size() - 1; i != UINT64_MAX; --i)
420 {
421 col_ancestor_tags->insertValue(unit.stack[i].tag);
422 if (need[COL_ANCESTOR_OFFSETS])
423 col_ancestor_dwarf_offsets->insertValue(unit.stack[i].offset);
424 }
425 col_ancestor_array_offsets->insertValue(col_ancestor_tags->size());
426 }
427
428 uint64_t abbrev_code = extractor->getULEB128(&unit.offset, &err);
429 throwIfError(err, "DIE header");
430
431 if (abbrev_code == 0)
432 {

Callers

nothing calls this directly

Calls 15

parseAddressFunction · 0.85
removePrefixFunction · 0.85
insertIndexMethod · 0.80
getUnitMethod · 0.80
hasChildrenMethod · 0.80
detachIndexesMethod · 0.80
throwIfErrorFunction · 0.70
appendFunction · 0.70
ChunkClass · 0.70
createFunction · 0.50
ExceptionClass · 0.50
toStringFunction · 0.50

Tested by

no test coverage detected