[Lldb-commits] [PATCH] D78489: [lldb/DWARF] Trust CU DW_AT_low/high_pc information when building address tables

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 20 22:13:43 PDT 2020

clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

I see plenty of examples daily, from clang version 7, where this happens. The first binary I tried to verify after seeing this patch, I found this error. Dump is below. This compile unit also shows what happens when the linker sets every function that was dead stripped to address zero: we end up with many functions at address zero. What happens if address zero is a real address? Then we end up with the first function that got dead stripped that was large enough to contain the address we are trying to lookup claiming to own this address. So I would vote to NOT change LLDB.

  error: DIE has overlapping address ranges: [0x0000000000000000, 0x0000000000000008) and [0x0000000000000000, 0x000000000000001e)
  error: DIE address ranges are not contained in its parent's ranges:
  0x0002022e: DW_TAG_compile_unit
                DW_AT_producer	("Facebook clang version 7.0.0 (llvm: fa3433ee8def2a61195b46a32b44800c59bd21a1, cfe: e8d08cb2bc1f92443c1e64977d78ec6454370e01, compiler-rt: 9439182a2f29f42bd22126a1e0d967f9eba34616, lld: d83a49d30bca97c359a7d7995da6cc1468041cb1 e8d08cb2bc1f92443c1e64977d78ec6454370e01) (ssh://git-ro.vip.facebook.com/data/gitrepos/osmeta/external/llvm fa3433ee8def2a61195b46a32b44800c59bd21a1) (based on LLVM 7.0.0)")
                DW_AT_language	(DW_LANG_C_plus_plus)
                DW_AT_name	("xplat/IGL/src/igl/opengl/Device.cpp")
                DW_AT_stmt_list	(0x00004f60)
                DW_AT_comp_dir	(".")
                DW_AT_GNU_pubnames	(true)
                DW_AT_low_pc	(0x0000000000000000)
                DW_AT_ranges	(0x000010b0
                   [0x000045c4, 0x000045e8)
                   [0x000045e8, 0x00004610)
                   [0x00004610, 0x00004612)
                   [0x00000000, 0x0000001e)
                   [0x00000000, 0x00000008)
                   [0x00000000, 0x00000004)
                   [0x00004612, 0x00004660)
                   [0x00004660, 0x0000466a)
                   [0x0000466a, 0x0000469e)
                   [0x0000469e, 0x000046a6)
                   [0x000046a6, 0x000046da)
                   [0x000046da, 0x00004772)
                   [0x00004774, 0x000047a0)
                   [0x000047a0, 0x000047c8)
                   [0x000047c8, 0x000047d8)
                   [0x000047d8, 0x00004826)
                   [0x00004826, 0x00004830)
                   [0x00004830, 0x0000487e)
                   [0x0000487e, 0x00004888)
                   [0x00004888, 0x00004890)
                   [0x00004890, 0x000048f0)
                   [0x000048f0, 0x000048fc)
                   [0x000048fc, 0x0000490e)
                   [0x0000490e, 0x00004932)
                   [0x00003388, 0x00003398)
                   [0x00003398, 0x00003410)
                   [0x00003340, 0x00003350)
                   [0x00003350, 0x00003388)
                   [0x00004932, 0x0000495c)
                   [0x0000495c, 0x00004990)
                   [0x00003ea0, 0x00003eec)
                   [0x00004990, 0x00004996)
                   [0x00004996, 0x000049a8)
                   [0x000049a8, 0x000049ac)
                   [0x000049ac, 0x000049b8)
                   [0x000049b8, 0x000049bc)
                   [0x000049bc, 0x000049c0)
                   [0x000049c0, 0x00004a08)
                   [0x00004a08, 0x00004a0e)
                   [0x00004a10, 0x00004a40)
                   [0x00004a40, 0x00004a5c)
                   [0x00004a5c, 0x00004a62)
                   [0x00004a64, 0x00004a80)
                   [0x00004a80, 0x00004a82)
                   [0x00004a82, 0x00004a86)
                   [0x00004a86, 0x00004a8e)
                   [0x00004a8e, 0x00004a92)
                   [0x00004a92, 0x00004a96)
                   [0x00004a96, 0x00004aa6)
                   [0x00004288, 0x000042b0)
                   [0x000042be, 0x000042d4)
                   [0x000042d4, 0x000042e4)
                   [0x000042e4, 0x000042fa)
                   [0x00004aa6, 0x00004ace)
                   [0x00004ace, 0x00004ade)
                   [0x00004ade, 0x00004b08)
                   [0x00004b08, 0x00004b3c)
                   [0x00004b3c, 0x00004b42)
                   [0x00004b42, 0x00004b54)
                   [0x00004b54, 0x00004b56)
                   [0x00004b56, 0x00004b5a)
                   [0x00004b5a, 0x00004b66)
                   [0x00004b66, 0x00004b6a)
                   [0x00004b6a, 0x00004b6e)
                   [0x00004b6e, 0x00004ba4)
                   [0x00004ba4, 0x00004baa)
                   [0x00004bac, 0x00004bdc)
                   [0x00004bdc, 0x00004bf8)
                   [0x00004bf8, 0x00004bfe)
                   [0x00004c00, 0x00004c1c)
                   [0x00004c1c, 0x00004c1e)
                   [0x00004c1e, 0x00004c22)
                   [0x00004c22, 0x00004c2a)
                   [0x00004c2a, 0x00004c2e)
                   [0x00004c2e, 0x00004c32)
                   [0x00004c32, 0x00004c48)
                   [0x00004c48, 0x00004c8a)
                   [0x00004c8a, 0x00004c90)
                   [0x00004c90, 0x00004cc0)
                   [0x00004cc0, 0x00004cdc)
                   [0x00004cdc, 0x00004d30)
                   [0x00004d30, 0x00004d52)
                   [0x00004d52, 0x00004d6c)
                   [0x00004d6c, 0x00004d72)
                   [0x00004d74, 0x00004d90)
                   [0x00004d90, 0x00004d92)
                   [0x00004d92, 0x00004d96)
                   [0x00004d96, 0x00004d9e)
                   [0x00004d9e, 0x00004da2)
                   [0x00004da2, 0x00004da6)
                   [0x00004da6, 0x00004dbc)
                   [0x00004dbc, 0x00004dfc)
                   [0x00004dfc, 0x00004e02)
                   [0x00004e04, 0x00004e34)
                   [0x00004e34, 0x00004e50)
                   [0x00004e50, 0x00004e72)
                   [0x00004e72, 0x00004e78)
                   [0x00004e78, 0x00004e94)
                   [0x00004e94, 0x00004e96)
                   [0x00004e96, 0x00004e9a)
                   [0x00004e9a, 0x00004ea2)
                   [0x00004ea2, 0x00004ea6)
                   [0x00004ea6, 0x00004eaa)
                   [0x00004eaa, 0x00004ec0))
  0x0002f1f1:   DW_TAG_subprogram
                  DW_AT_low_pc	(0x00000000000049c0)
                  DW_AT_high_pc	(0x0000000000004a08)
                  DW_AT_frame_base	(DW_OP_reg13)
                  DW_AT_object_pointer	(0x0002f214)
                  DW_AT_linkage_name	("_ZNSt12__shared_ptrIN3igl6opengl12CommandQueueELN9__gnu_cxx12_Lock_policyE2EEC2ISaIS2_EJEEESt19_Sp_make_shared_tagRKT_DpOT0_")
                  DW_AT_specification	(0x00022eef)

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list