1.1.4 Built-in functions within DS-5 expressions

In a DS-5 Debugger expression, you can use built-in functions to provide more functionality.

You can use the following built-in functions within DS-5 debugger expressions:

int strcmp(const char *str1, const char *str2);

Compares two strings and returns an integer.

Return values are:

<0

Indicates that the second argument string value comes after the first argument string value in the machine collating sequences, str1 < str2.

0

Indicates that the two strings are identical in content.

>0

Indicates that the first argument string value comes after the second argument string value in the machine collating sequences, str2 < str1.

int strncmp(const char *str1, const char *str2, size_t n);

Compares at most n characters of two strings and returns an integer.

Return values are:

<0

Indicates that the second argument string value comes after the first argument string value in the machine collating sequences, str1 < str2.

0

Indicates that the two strings are identical in content.

>0

Indicates that the first argument string value comes after the second argument string value in the machine collating sequences, str2 < str1.

char *strcpy(char *str1, const char *str2);

Copies str2 to str1 including "\0" and returns str1.

char *strncpy(char *str1, const char *str2, size_t n);

Copies at most n characters of str2 to str1 including "\0" and returns str1. If str2 has fewer than n characters then fill with "\0".

void *memcpy(void *s, const void *cs, size_t n);

Copies at most n characters from cs to s and returns s.

Example 1-1 Examples

break main.c:45 if strcmp(myVar, "10") == 0     # Set conditional breakpoint that stops
                                                # when strings are identical 
Non-ConfidentialPDF file icon PDF versionARM DUI0452Z
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.