diff options
author | Weimin Pan <weimin.pan@oracle.com> | 2021-03-05 18:31:26 -0500 |
---|---|---|
committer | Weimin Pan <weimin.pan@oracle.com> | 2021-03-05 20:46:39 -0500 |
commit | 844be3f24027a13630dc0f67e006eee2ee5c6776 (patch) | |
tree | b15161035fc1b169ce248c285e7652b0911bfd0c /gdb/testsuite/gdb.base | |
parent | 019989fdf14506c72e1e5d5ef1604ef343a44ac2 (diff) | |
download | gdb-844be3f24027a13630dc0f67e006eee2ee5c6776.zip gdb-844be3f24027a13630dc0f67e006eee2ee5c6776.tar.gz gdb-844be3f24027a13630dc0f67e006eee2ee5c6776.tar.bz2 |
CTF: set up debug info for function arguments
Added this support in read_func_kind_type after gcc started generating
CTF for function arguments.
Replaced XNEW with std::vector and NULL with nullptr.
Expanded gdb.base/ctf-ptype.exp to test function arguments. Also fixed
some typos.
gdb/ChangeLog:
* ctfread.c (read_func_kind_type): Set up function arguments.
gdb/testsuite/ChangeLog:
* gdb.base/ctf-ptype.exp: Add function tests and fix typos.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/ctf-ptype.exp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp index ffe40f1..056f712 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -63,10 +63,10 @@ gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsign # Test the equivalence between '.' and '->' for struct member references. -if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then { +if [gdb_test "ptype v_struct1.v_float_member" "type = float"]<0 then { return -1 } -if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then { +if [gdb_test "ptype v_struct1->v_float_member" "type = float"]<0 then { return -1 } if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then { @@ -211,7 +211,7 @@ gdb_test "ptype the_highest" \ gdb_test "ptype the_highest.anonymous_level_1" \ "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \ - "ptype the_highest" + "ptype the_highest.anonymous_level_1" # Print the type of the identifier ID, and check the response: # - Expect to see PROTOTYPED as the type. PROTOTYPED is not a regular @@ -255,8 +255,21 @@ proc ptype_maybe_prototyped { id prototyped plain { overprototyped "NO-MATCH" } } } +ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \ + "int (*)()" ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \ "double (*)(void)" +ptype_maybe_prototyped "new_fptr" "double (*)()" "double (*)()" +ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()" +ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \ + "int *(*)()" +ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(), int)" \ + "int (*)()" \ + "int (*)(int (*)(void), int (*)(void), int)" +ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \ + "int (*(*)())()" +ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \ + "int (*(*(*)())())()" # Test printing type of string constants and array constants, but # requires a running process. These call malloc, and can take a long |