-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: support slices of typedefs, etc
Slices in CTF are almost totally transparent to the user, *except* that ctf_type_resolve will halt when it encounters a slice and will drill no further, since going further would lose information about the encoding of the slice. Since you can have slices of typedefs, this means you can't rely on ctf_type_resolve getting rid of all typedefs any more. This change drills through to base types where necessary. We have to do it by hand in every place it's needed, which is fairly unpleasant. I think I caught them all (most are covered by the tests added here). If we find other places where spurious errors citing bitfields which should have been treated as integral types appear, we can fix them as they crop up. Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information
1 parent
be2bd54
commit e437349
Showing
3 changed files
with
113 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at | ||
* http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
/* | ||
* ASSERTION: | ||
* Bitfields are treated as integers. | ||
* | ||
* SECTION: Types, Operators, and Expressions/Bitwise Operators | ||
*/ | ||
|
||
#pragma D option quiet | ||
|
||
/* @@runtest-opts: -e */ | ||
|
||
/* @@trigger: bogus-ioctl */ | ||
|
||
syscall::ioctl:entry / curthread->frozen == 0 / | ||
{ exit(0); } | ||
|
||
syscall::ioctl:entry / curthread->frozen != 0 / | ||
{ exit(0); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Oracle Linux DTrace. | ||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. | ||
* Licensed under the Universal Permissive License v 1.0 as shown at | ||
* http://oss.oracle.com/licenses/upl. | ||
*/ | ||
|
||
/* | ||
* Check that lookup of types in CTF that happen to be bitfields works. | ||
* (These types are represented as slices.) | ||
* We are only interested in whether they parse, so exit immediately | ||
* after that. | ||
*/ | ||
|
||
/* @@runtest-opts: -e */ | ||
|
||
#pragma D option quiet | ||
|
||
syscall::ioctl:entry | ||
{ | ||
trace(curthread->sched_reset_on_fork); | ||
} | ||
|
||
fbt::tcp_parse_options:entry | ||
{ | ||
/* dtv2: use args[2] later */ | ||
trace(((struct sk_buff *)arg2)->nohdr); | ||
} |