VirtualBox

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

Last change on this file since 78260 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1# $Id: tstAsmStructsAsm-lst.sed 76553 2019-01-01 01:45:53Z vboxsync $
2## @file
3# For testing assembly struct when using yasm.
4#
5
6#
7# Copyright (C) 2006-2019 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18#
19# Strip stuff lines and spaces we don't care about.
20#
21/ %line /d
22/\[section /d
23/\[bits /d
24/\[absolute /d
25/ times /d
26s/ *[[:digit:]]* //
27/^ *$/d
28s/ *$//g
29s/^ *//g
30/^\.text$/d
31/^\.data$/d
32/^\.bss$/d
33s/[[:space:]][[:space:]]*/ /g
34
35#
36# Figure which type of line this is and process it accordingly.
37#
38/^[[:alpha:]_][[:alnum:]_]*:/b struct
39/^[[:alpha:]_][[:alnum:]_]*_size EQU \$ - .*$/b struct_equ
40/<gap>/b member
41/^\.[[:alpha:]_][[:alnum:]_.:]* res.*$/b member_two
42/^\.[[:alpha:]_][[:alnum:]_.:]*:$/b member_alias
43b error
44b member_two
45
46
47#
48# Struct start / end.
49#
50:struct_equ
51s/_size EQU.*$/_size/
52:struct
53s/:$//
54h
55s/^/global /
56s/$/ ; struct/
57b end
58
59
60#
61# Struct member
62# Note: the 't' command doesn't seem to be working right with 's'.
63#
64:member
65s/[[:xdigit:]]* *//
66s/<gap> *//
67/^\.[[:alnum:]_.]*[:]* .*$/!t error
68s/\(\.[[:alnum:]_]*\)[:]* .*$/\1 /
69G
70s/^\([^ ]*\) \(.*\)$/global \2\1 ; member/
71s/\n//m
72
73b end
74
75
76#
77# Struct member, no address. yasm r1842 and later.
78#
79:member_two
80s/[:]* *res[bwdtq] .*$//
81s/$/ /
82/^\.[[:alnum:]_.]* *$/!t error
83G
84s/^\([^ ]*\) \(.*\)$/global \2\1 ; member2/
85s/\n//m
86
87b end
88
89#
90# Alias member like Host.cr0Fpu in 64-bit. Drop it.
91#
92:member_alias
93d
94b end
95
96:error
97s/^/\nSed script logic error!\nBuffer: /
98s/$/\nHold: /
99G
100q 1
101b end
102
103
104:end
105
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