• Aucun résultat trouvé

BS - Block of Memory Search

Dans le document User’s ManualPart 1 and 2 (Page 94-99)

Command Input

BS RANGE TEXT [;B|H|W]

or

BS RANGE data [mask] [;B|H|W [,N] [,V]]

Arguments

Options

Description

The BS command searches the specified range of memory for a match with a an ASCII text string or a data pattern. This command has three modes.

String Search

In the string search mode, a search is carried out for the TEXT argument. The size option field indicates whether the COUNT field of RANGE refers to bytes, half-words, or words. If RANGE is not specified using a COUNT, then no options are allowed. If a match is found, then the address of the first byte of the match is output.

TEXT An ASCII text string that is matched against a range of memory data Data pattern that is matched against a range of memory

mask A string that indicates which bit positions in data to compare to memory (a one is compared, a zero is not). The default is all ones.

B Byte

H Half-word

W Word

N Non-aligned. The search is conducted on a byte-by-byte basis, rather than by half-words or words, regardless of the size of data.

V Verify. Addresses and data are displayed only when the memory contents do not match data.

Debugger Commands

3

Data Search

In the Data Search mode, a data pattern (data) is matched against a range of memory. The size option indicates whether the COUNT field in RANGE refers to bytes, half-words, or words (the default is word).

The following actions occur during a data search:

1. data is right-justified and leading bits are truncated or leading zeros are added as necessary to make the data pattern the specified size.

2. A compare is made with successive bytes, half-words, or words (depending on the size in effect) within the range for a match with data.

Comparison is made only on those bits at bit positions

corresponding to a one in mask. If mask is not specified, the default is all ones (all bits are compared). The size of the mask is taken to be the same size as the data.

If the N (non-aligned) option is selected, data is searched for on a byte-by-byte basis, rather than by half-words or words, regardless of the size of data. This is useful if a half-word (or word) pattern is being searched for, but is not expected to lie on a half-word (or word) boundary.

3. If a match is found, then the address of the first byte of the match is output along with the memory contents. If a mask was in use, then the actual data at the memory location is displayed, rather than the data with the mask applied.

Data Verification

If the V (verify) option has been selected, the addresses and data are

3

to display. To resume output, you should simply press any character key.

To cancel the output and exit the command, you should press the BREAK key.

If a match is found (or, in the case of Mode 3, a mismatch) with a series of bytes of memory whose beginning is within the range but whose end is outside of the range, then that match is output and a message is output stating that the last match does not lie entirely within the range. You may search non-contiguous memory with this command without causing a Bus Error.

For the examples below, assume the following data is in memory.

00030000 0000 0045 7272 6F72 2053 7461 7475 733D ...Error Status=

00030010 3446 2F2F 436F 6E66 6967 5461 626C 6553 4F//ConfigTableS 00030020 7461 7274 3A00 0000 0000 0000 0000 0000 tart:...

Examples

Example 1: Mode 1: The string is not found, so a message is output.

PPC1-Bug>BS 30000 3002F ’Task Status’ <Return>

Effective address: 00030000 Effective address: 0003002F -not

found-PPC1-Bug>

Example 2: Mode 1: The string is found, and the address of its first byte is output.

PPC1-Bug>BS 30000 3002F ’Error Status’ <Return>

Effective address: 00030000 Effective address: 0003002F 00030003

PPC1-Bug>

Example 3: Mode 1: The string is found, but it ends outside of the range, so the address of its first byte and a message are output.

PPC1-Bug>BS 30000 3001F ’ConfigTableStart’ <Return>

Effective address: 00030000 Effective address: 0003001F 00030014

-last match extends over range boundary-PPC1-Bug>

Debugger Commands

3

Example 4: Mode 1, using RANGE with COUNT and size option: COUNT is displayed in decimal, and address of each occurrence of the string is output.

PPC1-Bug>BS 30000:30 ’t’;B <Return>

Effective address: 00030000 Effective count : &48

0003000A 0003000C 00030020 00030023 PPC1-Bug>

Example 5: Mode 2, using RANGE with COUNT: COUNT is displayed in decimal bytes, and the data pattern is found and displayed.

PPC1-Bug>BS 30000:18,2F2F;H <Return>

Effective address: 00030000 Effective count : &48 00030012|2F2F

PPC1-Bug>

Example 6: Mode 2, the default size is word and the data pattern is not found, so a message is output.

PPC1-Bug>BS 30000,3002F 3D34 <Return>

Effective address: 00030000 Effective address: 0003002F -not

found-PPC1-Bug>

Example 7: Mode 2, the size is half-word and non-aligned option is used, so the data pattern is found and displayed.

PPC1-Bug>BS 30000,3002F 3D34;HN <Return>

Effective address: 00030000 Effective Address: 0003002F 0003000F|3D34

PPC1-Bug>

3

Example 8: Mode 2, using RANGE with COUNT, mask option, and size option: COUNT is displayed in decimal, and the actual unmasked data patterns found are displayed.

PPC1-Bug>BS 30000:30 60,F0;B <Return>

Effective address: 00030000 Effective count : &48

00030006|6F 0003000B|61 00030015|6F 00030016|6E 00030017|66 00030018|69 00030019|67 0003001B|61 0003001C|62 0003001D|6C 0003001E|65 00030021|61 PPC1-Bug>

Example 9: Mode 3, on a different block of memory, mask option, scan for words with low nibble nonzero: two locations failed to verify.

PPC1-Bug>BS 3000 1FFFF 0000 000F;VH <Return>

Effective address: 00003000 Effective address: 0001FFFF 0000C000|E501 0001E224|A30E PPC1-Bug>

Debugger Commands

3

Dans le document User’s ManualPart 1 and 2 (Page 94-99)