|
61 | 61 |
|
62 | 62 | def test():
|
63 | 63 | # define some useful constants
|
64 |
| - main_start = 216 |
| 64 | + main_start = 221 |
65 | 65 | main_noinline = main_start + 17
|
66 | 66 | main_inlinefrom = main_start + 18
|
67 | 67 | match = match_gdb_version()
|
@@ -237,15 +237,15 @@ def test():
|
237 | 237 | # print the hub of the array and check it has a name field
|
238 | 238 | exec_string = execute("print /x *args->hub")
|
239 | 239 | rexp = [fr"{wildcard_pattern} = {{",
|
240 |
| - fr"{spaces_pattern}<java.lang.Class> = {{" if isolates else None, |
| 240 | + fr"{spaces_pattern}<java.lang.Class> = {{", |
241 | 241 | fr"{spaces_pattern}<java.lang.Object> = {{",
|
242 | 242 | fr"{spaces_pattern}<_objhdr> = {{",
|
243 | 243 | fr"{spaces_pattern}hub = {address_pattern}",
|
244 | 244 | fr"{spaces_pattern}idHash = {address_pattern}" if fixed_idhash_field else None,
|
245 | 245 | fr"{spaces_pattern}}}, <No data fields>}},",
|
246 | 246 | fr"{spaces_pattern}members of java\.lang\.Class:",
|
247 | 247 | fr"{spaces_pattern}name = {address_pattern},",
|
248 |
| - fr"{spaces_pattern}}}, <No data fields>}}" if isolates else "}"] |
| 248 | + fr"{spaces_pattern}}}, <No data fields>}}"] |
249 | 249 |
|
250 | 250 | checker = Checker("print String[] hub", rexp)
|
251 | 251 |
|
@@ -381,7 +381,7 @@ def test():
|
381 | 381 |
|
382 | 382 | exec_string = execute("ptype _objhdr")
|
383 | 383 | rexp = [r"type = struct _objhdr {",
|
384 |
| - fr"{spaces_pattern}{compressed_pattern if isolates else ''}java\.lang\.Class \*hub;", |
| 384 | + fr"{spaces_pattern}Encoded\$Dynamic\$Hub \*hub;", |
385 | 385 | fr"{spaces_pattern}int idHash;" if fixed_idhash_field else None,
|
386 | 386 | r"}"]
|
387 | 387 |
|
@@ -872,13 +872,56 @@ def test():
|
872 | 872 | exec_string = execute("backtrace 3")
|
873 | 873 | rexp = [
|
874 | 874 | fr"#0{spaces_pattern}hello\.Hello::lambda\$(static\$)?0{no_param_types_pattern} {no_arg_values_pattern} at hello/Hello\.java:210",
|
875 |
| - fr"#1{spaces_pattern}{address_pattern} in hello\.Hello\$\$Lambda((\${digits_pattern}/0x)|(\$)|(\.0x|/0x))?{hex_digits_pattern}::get{wildcard_pattern} at hello/Hello\.java:238", |
876 |
| - fr"#2{spaces_pattern}hello\.Hello::main{param_types_pattern} {arg_values_pattern} at hello/Hello\.java:238"] |
| 875 | + fr"#1{spaces_pattern}{address_pattern} in hello\.Hello\$\$Lambda((\${digits_pattern}/0x)|(\$)|(\.0x|/0x))?{hex_digits_pattern}::get{wildcard_pattern} at hello/Hello\.java:243", |
| 876 | + fr"#2{spaces_pattern}hello\.Hello::main{param_types_pattern} {arg_values_pattern} at hello/Hello\.java:243"] |
877 | 877 | checker = Checker('backtrace in lambda', rexp)
|
878 | 878 | checker.check(exec_string, skip_fails=False)
|
879 | 879 |
|
880 | 880 | execute("delete breakpoints")
|
881 | 881 |
|
| 882 | + # check if java.lang.Class and the hub field is resolved correctly |
| 883 | + exec_string = execute(f"break hello.Hello::checkClassType") |
| 884 | + rexp = fr"Breakpoint {digits_pattern} at {address_pattern}: file hello/Hello\.java, line 216\." |
| 885 | + checker = Checker(fr"break hello.Hello::checkClassType", rexp) |
| 886 | + checker.check(exec_string) |
| 887 | + |
| 888 | + execute("continue") |
| 889 | + exec_string = execute("print *clazz.name.value") |
| 890 | + rexp = [fr"{wildcard_pattern} = {{", |
| 891 | + fr"{spaces_pattern}<java\.lang\.Object> = {{", |
| 892 | + fr"{spaces_pattern}<_objhdr> = {{", |
| 893 | + fr"{spaces_pattern}hub = {address_pattern}", |
| 894 | + fr"{spaces_pattern}}}, <No data fields>}},", |
| 895 | + fr"{spaces_pattern}members of byte \[\]", |
| 896 | + fr"{spaces_pattern}len = 16,", |
| 897 | + fr"{spaces_pattern}data = {address_pattern}"] |
| 898 | + checker = Checker('print *clazz.name.value', rexp) |
| 899 | + checker.check(exec_string) |
| 900 | + |
| 901 | + exec_string = execute("ptype clazz") |
| 902 | + rexp = [r"type = class java\.lang\.Class : public java\.lang\.Object {"] |
| 903 | + checker = Checker('ptype clazz', rexp) |
| 904 | + checker.check(exec_string) |
| 905 | + |
| 906 | + exec_string = execute("print *clazz.hub.name.value") |
| 907 | + rexp = [fr"{wildcard_pattern} = {{", |
| 908 | + fr"{spaces_pattern}<java\.lang\.Object> = {{", |
| 909 | + fr"{spaces_pattern}<_objhdr> = {{", |
| 910 | + fr"{spaces_pattern}hub = {address_pattern}", |
| 911 | + fr"{spaces_pattern}}}, <No data fields>}},", |
| 912 | + fr"{spaces_pattern}members of byte \[\]", |
| 913 | + fr"{spaces_pattern}len = 15,", |
| 914 | + fr"{spaces_pattern}data = {address_pattern}"] |
| 915 | + checker = Checker('print *clazz.hub.name.value', rexp) |
| 916 | + checker.check(exec_string) |
| 917 | + |
| 918 | + exec_string = execute("ptype clazz.hub") |
| 919 | + rexp = [r"type = class Encoded\$Dynamic\$Hub : public java\.lang\.Class {"] |
| 920 | + checker = Checker('ptype clazz.hub', rexp) |
| 921 | + checker.check(exec_string) |
| 922 | + |
| 923 | + execute("delete breakpoints") |
| 924 | + |
882 | 925 | ### Now check foreign debug type info
|
883 | 926 |
|
884 | 927 | # check type information is reported correctly
|
|
0 commit comments