aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-01-05 13:25:56 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-01-05 14:53:39 +0000
commit91e7ce2fd7b82f3982b453d1c6f4576621bc1c2d (patch)
tree62dcc9d77cb96f81c943367fec427b5c550639c9 /ld
parent57f97d0e6dd4dfbb54f2f39c5e59d5860040d0b6 (diff)
downloadgdb-91e7ce2fd7b82f3982b453d1c6f4576621bc1c2d.zip
gdb-91e7ce2fd7b82f3982b453d1c6f4576621bc1c2d.tar.gz
gdb-91e7ce2fd7b82f3982b453d1c6f4576621bc1c2d.tar.bz2
libctf, ld: more dumper improvements
Dump more details about the types found in data object and function info sections (the type ID and recursive info on the type itself, but not on its members). Before now, this was being dumped for entries in the variable section, but not for the closely-related function info and data object sections, which is inconsistent and makes finding the corresponding types in the type section unnecessarily hard. (This also gets rid of code in which bugs have already been found in favour of the same code everything else in the dumper uses to dump types.) While we're doing that, change the recursive type dumper in question to recursively dump info on arrays' element type, just as we do for all types that reference other types. (Arrays are not a kind of reference type in libctf, but perhaps we should change that in future and make ctf_type_reference return the element type.) ld/ChangeLog 2021-01-05 Nick Alcock <nick.alcock@oracle.com> * testsuite/ld-ctf/array.d: Adjust for dumper changes. * testsuite/ld-ctf/data-func-conflicted.d: Likewise. * testsuite/ld-ctf/diag-cttname-null.d: Likewise. * testsuite/ld-ctf/diag-cuname.d: Likewise. * testsuite/ld-ctf/diag-parlabel.d: Likewise. * testsuite/ld-ctf/function.d: Likewise. * testsuite/ld-ctf/slice.d: Likewise. libctf/ChangeLog 2021-01-05 Nick Alcock <nick.alcock@oracle.com> * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type. (ctf_dump_format_type): Don't emit the size for function objects. Dump the element type of arrays like we dump the pointed-to type of pointers, etc.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/testsuite/ld-ctf/array.d4
-rw-r--r--ld/testsuite/ld-ctf/data-func-conflicted.d22
-rw-r--r--ld/testsuite/ld-ctf/diag-cttname-null.d2
-rw-r--r--ld/testsuite/ld-ctf/diag-cuname.d2
-rw-r--r--ld/testsuite/ld-ctf/diag-parlabel.d2
-rw-r--r--ld/testsuite/ld-ctf/function.d4
-rw-r--r--ld/testsuite/ld-ctf/slice.d2
8 files changed, 29 insertions, 19 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 21ba58a..a130c6c 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,6 +1,16 @@
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
* testsuite/ld-ctf/array.d: Adjust for dumper changes.
+ * testsuite/ld-ctf/data-func-conflicted.d: Likewise.
+ * testsuite/ld-ctf/diag-cttname-null.d: Likewise.
+ * testsuite/ld-ctf/diag-cuname.d: Likewise.
+ * testsuite/ld-ctf/diag-parlabel.d: Likewise.
+ * testsuite/ld-ctf/function.d: Likewise.
+ * testsuite/ld-ctf/slice.d: Likewise.
+
+2021-01-05 Nick Alcock <nick.alcock@oracle.com>
+
+ * testsuite/ld-ctf/array.d: Adjust for dumper changes.
* testsuite/ld-ctf/conflicting-cycle-1.B-1.d: Likewise.
* testsuite/ld-ctf/conflicting-cycle-1.B-2.d: Likewise.
* testsuite/ld-ctf/conflicting-cycle-1.parent.d: Likewise.
diff --git a/ld/testsuite/ld-ctf/array.d b/ld/testsuite/ld-ctf/array.d
index e07d63e..6c3915a 100644
--- a/ld/testsuite/ld-ctf/array.d
+++ b/ld/testsuite/ld-ctf/array.d
@@ -20,8 +20,8 @@ Contents of CTF section .ctf:
Labels:
Data objects:
- digits -> int \[10\]
- digits_names -> char \*\[10\]
+ digits -> 0x[0-9a-f]*: int \[10\] .*
+ digits_names -> 0x[0-9a-f]*: char \*\[10\] .*
Function objects:
diff --git a/ld/testsuite/ld-ctf/data-func-conflicted.d b/ld/testsuite/ld-ctf/data-func-conflicted.d
index 62855f8..e51bb76 100644
--- a/ld/testsuite/ld-ctf/data-func-conflicted.d
+++ b/ld/testsuite/ld-ctf/data-func-conflicted.d
@@ -20,12 +20,12 @@ Contents of CTF section \.ctf:
String section: .*
#...
Data objects:
- bar -> struct var_3
- var_1 -> foo_t
- var_666 -> foo_t \*
+ bar -> 0x[0-9a-f]*: struct var_3 \(size 0x[0-9a-f]*\)
+ var_1 -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_666 -> 0x[0-9a-f]*: foo_t \* \(size 0x[0-9a-f]*\) -> .*
Function objects:
- func_[0-9]* -> void \*\(\*\) \(const char \*restrict, int \(\*\)\(\*\) \(const char \*\)\)
+ func_[0-9]* -> 0x[0-9a-f]*: void \*\(\*\) \(const char \*restrict, int \(\*\)\(\*\) \(const char \*\)\)
#...
Types:
#...
@@ -46,13 +46,13 @@ CTF archive member: .*/data-func-1\.c:
Labels:
Data objects:
- var_[0-9]* -> foo_t
- var_[0-9]* -> foo_t
- var_[0-9]* -> foo_t
- var_[0-9]* -> foo_t
- var_[0-9]* -> foo_t
- var_[0-9]* -> foo_t
- var_[0-9]* -> foo_t
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
+ var_[0-9]* -> 0x[0-9a-f]*: foo_t \(size 0x[0-9a-f]*\) -> .*
#...
Function objects:
diff --git a/ld/testsuite/ld-ctf/diag-cttname-null.d b/ld/testsuite/ld-ctf/diag-cttname-null.d
index 00db425..86a7fd1 100644
--- a/ld/testsuite/ld-ctf/diag-cttname-null.d
+++ b/ld/testsuite/ld-ctf/diag-cttname-null.d
@@ -13,7 +13,7 @@ Contents of CTF section .ctf:
Version: 4 \(CTF_VERSION_3\)
#...
Data objects:
- a -> struct
+ a -> 0x[0-9a-f]*: struct \(size 0x[0-9a-f]*\)
#...
Types:
#...
diff --git a/ld/testsuite/ld-ctf/diag-cuname.d b/ld/testsuite/ld-ctf/diag-cuname.d
index 19a4bfd..20624fd 100644
--- a/ld/testsuite/ld-ctf/diag-cuname.d
+++ b/ld/testsuite/ld-ctf/diag-cuname.d
@@ -21,7 +21,7 @@ Contents of CTF section .ctf:
Labels:
Data objects:
- a -> struct A
+ a -> 0x[0-9a-f]*: struct A \(size 0x[0-9a-f]*\)
#...
Function objects:
diff --git a/ld/testsuite/ld-ctf/diag-parlabel.d b/ld/testsuite/ld-ctf/diag-parlabel.d
index b2b047c..5ad5870 100644
--- a/ld/testsuite/ld-ctf/diag-parlabel.d
+++ b/ld/testsuite/ld-ctf/diag-parlabel.d
@@ -20,7 +20,7 @@ Contents of CTF section .ctf:
Labels:
Data objects:
- a -> struct A
+ a -> 0x[0-9a-f]*: struct A \(size 0x[0-9a-f]*\)
#...
Function objects:
diff --git a/ld/testsuite/ld-ctf/function.d b/ld/testsuite/ld-ctf/function.d
index 241adc2..9bf26a4 100644
--- a/ld/testsuite/ld-ctf/function.d
+++ b/ld/testsuite/ld-ctf/function.d
@@ -18,10 +18,10 @@ Contents of CTF section .ctf:
String section: .*
#...
Function objects:
- foo -> int \(\*\) \(char, int, float, void \*, void \(\*\)\(\*\) \(int\)\)
+ foo -> 0x[0-9a-f]*: int \(\*\) \(char, int, float, void \*, void \(\*\)\(\*\) \(int\)\)
#...
Types:
#...
- 0x[0-9a-f]*: int \(\*\) \(char, int, float, void \*, void \(\*\)\(\*\) \(int\)\) \(size 0x0\)
+ 0x[0-9a-f]*: int \(\*\) \(char, int, float, void \*, void \(\*\)\(\*\) \(int\)\)
*\[0x0\] \(ID 0x[0-9a-f]*\) \(kind 5\) int \(\*\) \(char, int[0-9]*, float, void \*, void \(\*\)\(\*\) \(int\)\) \(aligned at 0x[0-9a-f]*\)
#...
diff --git a/ld/testsuite/ld-ctf/slice.d b/ld/testsuite/ld-ctf/slice.d
index e42ffdf..3967a2d 100644
--- a/ld/testsuite/ld-ctf/slice.d
+++ b/ld/testsuite/ld-ctf/slice.d
@@ -19,7 +19,7 @@ Contents of CTF section .ctf:
String section: .*
#...
Data objects:
- slices -> struct slices
+ slices -> 0x[0-9a-f]*: struct slices \(size 0x[0-9a-f]*\)
#...
Types:
#...