[PATCH] D63537: [llvm-dwarfdump] --gdb-index: fix uninitialized TuListOffset

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 03:04:53 PDT 2019


MaskRay added a comment.

> Ping

@dblaikie I'm thinking if we should support gdb index version 8.

This 2013 change bumped the index version from 7 to 8: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=796a7ff8234cfaa8ad1ab884c1c8dafe29b18d42 My take is that the index format doesn't change.

I tried the C example on https://sourceware.org/bugzilla/show_bug.cgi?id=15021 . Unfortunately, the produced .gdb_index from `mkdir dir; gdb-8 a -batch -q -ex 'save gdb-index dir'; objcopy --add-section .gdb_index=dir/a.gdb-index --set-section-flags .gdb_index=readonly a b` has an abnormal large "number of CU indices":

  178|   // The constant pool. CU vectors are stored first, followed by strings.                                 
  179|   // The first value is the number of CU indices in the vector. Each subsequent                           
  180|   // value is the index and symbol attributes of a CU in the CU list.                                     
  181|   for (uint32_t i = 0; i < CuVectorsTotal; ++i) {
  182|     ConstantPoolVectors.emplace_back(0, SmallVector<uint32_t, 0>());                                      
  183|     auto &Vec = ConstantPoolVectors.back();
  184|     Vec.first = Offset - ConstantPoolOffset;
  185| 
  186|     uint32_t Num = Data.getU32(&Offset);
  187|     for (uint32_t j = 0; j < Num; ++j)
  188|       Vec.second.push_back(Data.getU32(&Offset));
  (gdb) p/x Num
  $12 = 0x306f6f66

(gdb_7.4.1-1_amd64.deb from http://snapshot.debian.org/package/gdb/7.4.1-1/ says it uses index version 5)

Older gdb is not easy to build:

  % cd /tmp/p/gdb-7.6
  % mkdir Release; cd Release; ../configure --disable-binutils --disable-gas --disable-gdb --disable-gold --disable-gprof --disable-ld --disable-werror --enable-gdb CFLAGS=-fpermissive CXXFLAGS=-fpermissive --disable-nls && time make -j all-gdb
  ../../gdb/amd64-linux-nat.c:485:1: error: conflicting types for ‘ps_get_thread_area’                           
   ps_get_thread_area (const struct ps_prochandle *ph,


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63537/new/

https://reviews.llvm.org/D63537





More information about the llvm-commits mailing list