set semihosting

This command controls the semihosting settings in the debugger. Semihosting is used to communicate input/output requests from application code to the host workstation running the debugger.

Note

These settings only apply if the target supports semihosting and they cannot be changed while the target is running.

Show/hideSyntax

set semihosting option

Where:

option

Specifies additional options:

args arguments

Specifies the command-line arguments that are passed to the main() function in the application using the argv parameter. The name of the image is always implicitly passed in argv[0] and it is not necessary to pass this as an argument.

file-base directory

Specifies the base directory where the files that the application opens are relative to.

stderr "stderr" | filename

Specifies either console streams or a file to write stderr for semihosting operations.

stdin "stdin" | filename

Specifies either console streams or a file to read stdin for semihosting operations.

stdout "stdout" | filename

Specifies either console streams or a file to write stdout for semihosting operations.

top-of-memory address

Specifies the top of memory.

stack_heap_options

Specifies finer controls to manually configure the base address and limits for the stack and heap. If you use stack_heap_options, then these settings take precedence over the top-of-memory and all of the following options must be specified:

stack-base address

The base address of the stack.

stack-limit address

The end address of the stack.

heap-base address

The base address of the heap.

heap-limit address

The end address of the heap.

enabled
auto

Automatically enables semihosting operations if appropriate when an image is loaded. This is the default.

off

Disables all semihosting operations.

on

Enables all semihosting operations.

Note

You must configure semihosting addresses before you enable semihosting.

For example:

set semihosting top-of-memory address
set semihosting enabled on

Show/hideExample

Example 111. set semihosting

set semihosting args 500                  # Set 500 as command-line argument
set semihosting stdout output.log         # Write stdout to output.log
set semihosting enabled on                # Enable semihosting operations

Show/hideSee also

Copyright © 2010, 2011 ARM. All rights reserved.ARM DUI 0452H
Non-ConfidentialID111711