VirtualBox

source: vbox/trunk/src/VBox/VMM/testcase/tstAsmStructsAsm-lst.sed@ 100764

Last change on this file since 100764 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1# $Id: tstAsmStructsAsm-lst.sed 98103 2023-01-17 14:15:46Z vboxsync $
2## @file
3# For testing assembly struct when using yasm.
4#
5
6#
7# Copyright (C) 2006-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28#
29# Strip stuff lines and spaces we don't care about.
30#
31/ %line /d
32/\[section /d
33/\[bits /d
34/\[absolute /d
35/ times /d
36s/ *[[:digit:]]* //
37/^ *$/d
38s/ *$//g
39s/^ *//g
40/^\.text$/d
41/^\.data$/d
42/^\.bss$/d
43/ *\.unnamed_padding\./d
44s/[[:space:]][[:space:]]*/ /g
45
46#
47# Figure which type of line this is and process it accordingly.
48#
49/^[[:alpha:]_][[:alnum:]_]*:/b struct
50/^[[:alpha:]_][[:alnum:]_]*_size EQU \$ - .*$/b struct_equ
51/<gap>/b member
52/^\.[[:alpha:]_][[:alnum:]_.:]* res.*$/b member_two
53/^\.[[:alpha:]_][[:alnum:]_.:]* EQU .*$/b member_two
54/^\.[[:alpha:]_][[:alnum:]_.:]*:$/b member_alias
55b error
56b member_two
57
58
59#
60# Struct start / end.
61#
62:struct_equ
63s/_size EQU.*$/_size/
64:struct
65s/:$//
66h
67s/^/global /
68s/$/ ; struct/
69b end
70
71
72#
73# Struct member
74# Note: the 't' command doesn't seem to be working right with 's'.
75#
76:member
77s/[[:xdigit:]]* *//
78s/<gap> *//
79/^\.[[:alnum:]_.]*[:]* .*$/!t error
80s/\(\.[[:alnum:]_]*\)[:]* .*$/\1 /
81G
82s/^\([^ ]*\) \(.*\)$/global \2\1 ; member/
83s/\n//m
84
85b end
86
87
88#
89# Struct member, no address. yasm r1842 and later.
90#
91:member_two
92s/[:]* *res[bwdtq] .*$//
93s/[:]* *EQU .*$//
94s/$/ /
95/^\.[[:alnum:]_.]* *$/!t error
96G
97s/^\([^ ]*\) \(.*\)$/global \2\1 ; member2/
98s/\n//m
99
100b end
101
102#
103# Alias member like Host.cr0Fpu in 64-bit. Drop it.
104#
105:member_alias
106d
107b end
108
109:error
110s/^/\nSed script logic error!\nBuffer: /
111s/$/\nHold: /
112G
113q 1
114b end
115
116
117:end
118
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette