Tamas Berghammer c8fd130a2c Merge dwarf and dsym tests
Currently most of the test files have a separate dwarf and a separate
dsym test with almost identical content (only the build step is
different). With adding dwo symbol file handling to the test suit it
would increase this to a 3-way duplication. The purpose of this change
is to eliminate this redundancy with generating 2 test case (one dwarf
and one dsym) for each test function specified (dwo handling will be
added at a later commit).

Main design goals:
* There should be no boilerplate code in each test file to support the
  multiple debug info in most of the tests (custom scenarios are
  acceptable in special cases) so adding a new test case is easier and
  we can't miss one of the debug info type.
* In case of a test failure, the debug symbols used during the test run
  have to be cleanly visible from the output of dotest.py to make
  debugging easier both from build bot logs and from local test runs
* Each test case should have a unique, fully qualified name so we can
  run exactly 1 test with "-f <test-case>.<test-function>" syntax
* Test output should be grouped based on test files the same way as it
  happens now (displaying dwarf/dsym results separately isn't
  preferable)

Proposed solution (main logic in lldbtest.py, rest of them are test
cases fixed up for the new style):
* Have only 1 test fuction in the test files what will run for all
  debug info separately and this test function should call just
  "self.build(...)" to build an inferior with the right debug info
* When a class is created by python (the class object, not the class
  instance), we will generate a new test method for each debug info
  format in the test class with the name "<test-function>_<debug-info>"
  and remove the original test method. This way unittest2 see multiple
  test methods (1 for each debug info, pretty much as of now) and will
  handle the test selection and the failure reporting correctly (the
  debug info will be visible from the end of the test name)
* Add new annotation @no_debug_info_test to disable the generation of
  multiple tests for each debug info format when the test don't have an
  inferior

Differential revision: http://reviews.llvm.org/D13028

llvm-svn: 248883
2015-09-30 10:12:40 +00:00
..
a.c
b.c
2015-09-30 10:12:40 +00:00

a.out file refers to libfoo.a for a.o and b.o, which is what we want to accomplish for
this test case.

[16:17:44] johnny:/Volumes/data/lldb/svn/latest/test/functionalities/archives $ dsymutil -s a.out 
----------------------------------------------------------------------
Symbol table for: 'a.out' (x86_64)
----------------------------------------------------------------------
Index    n_strx   n_type             n_sect n_desc n_value
======== -------- ------------------ ------ ------ ----------------
[     0] 00000002 64 (N_SO         ) 00     0000   0000000000000000 '/Volumes/data/lldb/svn/latest/test/functionalities/archives/'
[     1] 0000003f 64 (N_SO         ) 00     0000   0000000000000000 'main.c'
[     2] 00000046 66 (N_OSO        ) 03     0001   000000004f0f780c '/Volumes/data/lldb/svn/latest/test/functionalities/archives/main.o'
[     3] 00000001 2e (N_BNSYM      ) 01     0000   0000000100000d70
[     4] 00000089 24 (N_FUN        ) 01     0000   0000000100000d70 '_main'
[     5] 00000001 24 (N_FUN        ) 00     0000   000000000000005d
[     6] 00000001 4e (N_ENSYM      ) 01     0000   000000000000005d
[     7] 00000001 64 (N_SO         ) 01     0000   0000000000000000
[     8] 00000002 64 (N_SO         ) 00     0000   0000000000000000 '/Volumes/data/lldb/svn/latest/test/functionalities/archives/'
[     9] 0000008f 64 (N_SO         ) 00     0000   0000000000000000 'a.c'
[    10] 00000093 66 (N_OSO        ) 03     0001   000000004f0f780c '/Volumes/data/lldb/svn/latest/test/functionalities/archives/libfoo.a(a.o)'
[    11] 00000001 2e (N_BNSYM      ) 01     0000   0000000100000dd0
[    12] 000000dd 24 (N_FUN        ) 01     0000   0000000100000dd0 '_a'
[    13] 00000001 24 (N_FUN        ) 00     0000   0000000000000020
[    14] 00000001 4e (N_ENSYM      ) 01     0000   0000000000000020
[    15] 00000001 2e (N_BNSYM      ) 01     0000   0000000100000df0
[    16] 000000e0 24 (N_FUN        ) 01     0000   0000000100000df0 '_aa'
[    17] 00000001 24 (N_FUN        ) 00     0000   0000000000000018
[    18] 00000001 4e (N_ENSYM      ) 01     0000   0000000000000018
[    19] 000000e4 20 (N_GSYM       ) 00     0000   0000000000000000 '___a_global'
[    20] 00000001 64 (N_SO         ) 01     0000   0000000000000000
[    21] 00000002 64 (N_SO         ) 00     0000   0000000000000000 '/Volumes/data/lldb/svn/latest/test/functionalities/archives/'
[    22] 000000f0 64 (N_SO         ) 00     0000   0000000000000000 'b.c'
[    23] 000000f4 66 (N_OSO        ) 03     0001   000000004f0f780c '/Volumes/data/lldb/svn/latest/test/functionalities/archives/libfoo.a(b.o)'
[    24] 00000001 2e (N_BNSYM      ) 01     0000   0000000100000e10
[    25] 0000013e 24 (N_FUN        ) 01     0000   0000000100000e10 '_b'
[    26] 00000001 24 (N_FUN        ) 00     0000   0000000000000020
[    27] 00000001 4e (N_ENSYM      ) 01     0000   0000000000000020
[    28] 00000001 2e (N_BNSYM      ) 01     0000   0000000100000e30
[    29] 00000141 24 (N_FUN        ) 01     0000   0000000100000e30 '_bb'
[    30] 00000001 24 (N_FUN        ) 00     0000   0000000000000018
[    31] 00000001 4e (N_ENSYM      ) 01     0000   0000000000000018
[    32] 00000145 26 (N_STSYM      ) 0a     0000   000000010000104c '___b_global'
[    33] 00000001 64 (N_SO         ) 01     0000   0000000000000000
[    34] 00000151 0e (     SECT    ) 07     0000   0000000100001000 '_pvars'
[    35] 00000158 0e (     SECT    ) 0a     0000   000000010000104c '___b_global'
[    36] 00000164 0f (     SECT EXT) 0b     0000   0000000100001050 '_NXArgc'
[    37] 0000016c 0f (     SECT EXT) 0b     0000   0000000100001058 '_NXArgv'
[    38] 00000174 0f (     SECT EXT) 0a     0000   0000000100001048 '___a_global'
[    39] 00000180 0f (     SECT EXT) 0b     0000   0000000100001068 '___progname'
[    40] 0000018c 03 (     ABS  EXT) 01     0010   0000000100000000 '__mh_execute_header'
[    41] 000001a0 0f (     SECT EXT) 01     0000   0000000100000dd0 '_a'
[    42] 000001a3 0f (     SECT EXT) 01     0000   0000000100000df0 '_aa'
[    43] 000001a7 0f (     SECT EXT) 01     0000   0000000100000e10 '_b'
[    44] 000001aa 0f (     SECT EXT) 01     0000   0000000100000e30 '_bb'
[    45] 000001ae 0f (     SECT EXT) 0b     0000   0000000100001060 '_environ'
[    46] 000001b7 0f (     SECT EXT) 01     0000   0000000100000d70 '_main'
[    47] 000001bd 0f (     SECT EXT) 01     0000   0000000100000d30 'start'
[    48] 000001c3 01 (     UNDF EXT) 00     0100   0000000000000000 '_exit'
[    49] 000001c9 01 (     UNDF EXT) 00     0100   0000000000000000 '_printf'
[    50] 000001d1 01 (     UNDF EXT) 00     0100   0000000000000000 'dyld_stub_binder'