|
1 | 1 | /* |
2 | | - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
@@ -1359,3 +1359,90 @@ eventFilterRestricted_deinstall(HandlerNode *node) |
1359 | 1359 |
|
1360 | 1360 | return error1 != JVMTI_ERROR_NONE? error1 : error2; |
1361 | 1361 | } |
| 1362 | + |
| 1363 | +/***** debugging *****/ |
| 1364 | + |
| 1365 | +#ifdef DEBUG |
| 1366 | + |
| 1367 | +void |
| 1368 | +eventFilter_dumpHandlerFilters(HandlerNode *node) |
| 1369 | +{ |
| 1370 | + int i; |
| 1371 | + Filter *filter = FILTERS_ARRAY(node); |
| 1372 | + |
| 1373 | + for (i = 0; i < FILTER_COUNT(node); ++i, ++filter) { |
| 1374 | + switch (filter->modifier) { |
| 1375 | + case JDWP_REQUEST_MODIFIER(ThreadOnly): |
| 1376 | + tty_message("ThreadOnly: thread(%p)", |
| 1377 | + filter->u.ThreadOnly.thread); |
| 1378 | + break; |
| 1379 | + case JDWP_REQUEST_MODIFIER(ClassOnly): { |
| 1380 | + char *class_name; |
| 1381 | + classSignature(filter->u.ClassOnly.clazz, &class_name, NULL); |
| 1382 | + tty_message("ClassOnly: clazz(%s)", |
| 1383 | + class_name); |
| 1384 | + break; |
| 1385 | + } |
| 1386 | + case JDWP_REQUEST_MODIFIER(LocationOnly): { |
| 1387 | + char *method_name; |
| 1388 | + char *class_name; |
| 1389 | + methodSignature(filter->u.LocationOnly.method, &method_name, NULL, NULL); |
| 1390 | + classSignature(filter->u.LocationOnly.clazz, &class_name, NULL); |
| 1391 | + tty_message("LocationOnly: clazz(%s), method(%s) location(%d)", |
| 1392 | + class_name, |
| 1393 | + method_name, |
| 1394 | + filter->u.LocationOnly.location); |
| 1395 | + break; |
| 1396 | + } |
| 1397 | + case JDWP_REQUEST_MODIFIER(FieldOnly): { |
| 1398 | + char *class_name; |
| 1399 | + classSignature(filter->u.FieldOnly.clazz, &class_name, NULL); |
| 1400 | + tty_message("FieldOnly: clazz(%p), field(%d)", |
| 1401 | + class_name, |
| 1402 | + filter->u.FieldOnly.field); |
| 1403 | + break; |
| 1404 | + } |
| 1405 | + case JDWP_REQUEST_MODIFIER(ExceptionOnly): |
| 1406 | + tty_message("ExceptionOnly: clazz(%p), caught(%d) uncaught(%d)", |
| 1407 | + filter->u.ExceptionOnly.exception, |
| 1408 | + filter->u.ExceptionOnly.caught, |
| 1409 | + filter->u.ExceptionOnly.uncaught); |
| 1410 | + break; |
| 1411 | + case JDWP_REQUEST_MODIFIER(InstanceOnly): |
| 1412 | + tty_message("InstanceOnly: instance(%p)", |
| 1413 | + filter->u.InstanceOnly.instance); |
| 1414 | + break; |
| 1415 | + case JDWP_REQUEST_MODIFIER(Count): |
| 1416 | + tty_message("Count: count(%d)", |
| 1417 | + filter->u.Count.count); |
| 1418 | + break; |
| 1419 | + case JDWP_REQUEST_MODIFIER(Conditional): |
| 1420 | + tty_message("Conditional: exprID(%d)", |
| 1421 | + filter->u.Conditional.exprID); |
| 1422 | + break; |
| 1423 | + case JDWP_REQUEST_MODIFIER(ClassMatch): |
| 1424 | + tty_message("ClassMatch: classPattern(%s)", |
| 1425 | + filter->u.ClassMatch.classPattern); |
| 1426 | + break; |
| 1427 | + case JDWP_REQUEST_MODIFIER(ClassExclude): |
| 1428 | + tty_message("ClassExclude: classPattern(%s)", |
| 1429 | + filter->u.ClassExclude.classPattern); |
| 1430 | + break; |
| 1431 | + case JDWP_REQUEST_MODIFIER(Step): |
| 1432 | + tty_message("Step: size(%d) depth(%d) thread(%p)", |
| 1433 | + filter->u.Step.size, |
| 1434 | + filter->u.Step.depth, |
| 1435 | + filter->u.Step.thread); |
| 1436 | + break; |
| 1437 | + case JDWP_REQUEST_MODIFIER(SourceNameMatch): |
| 1438 | + tty_message("SourceNameMatch: sourceNamePattern(%s)", |
| 1439 | + filter->u.SourceNameOnly.sourceNamePattern); |
| 1440 | + break; |
| 1441 | + default: |
| 1442 | + EXIT_ERROR(AGENT_ERROR_ILLEGAL_ARGUMENT, "Invalid filter modifier"); |
| 1443 | + return; |
| 1444 | + } |
| 1445 | + } |
| 1446 | +} |
| 1447 | + |
| 1448 | +#endif /* DEBUG */ |
0 commit comments