13.23.1. Opening a user-defined file

To save information to a user-defined file:

  1. At the RealView Debugger CLI prompt, enter the command:

    Stop> FOPEN fileid, filename

    where fileid is an integer in the range 50 to 1024 that identifies the file.

    For example:

    Stop> FOPEN 100, ‘C:\myfiles\myfile.txt’

    Alternatively, use the fopen predefined macro in a macro, for example:

    define void copyFile()
    {
      int retval;
      // Open data file to read
      retval = fopen(100,"c:\\myfiles\\data_in.txt","r");
      ...
      fclose(100);
    }
    .
    
  2. Specify the fileid in any CLI commands or predefined macros that support it.

    You can use the commands in scripts or macros, as required.

CLI commands that support user-defined file IDs

The following CLI commands support user-defined file IDs:

  • BREAKACCESS

  • BREAKEXECUTION

  • BREAKINSTRUCTION

  • BREAKREAD

  • BREAKWRITE

  • DCOMMANDS

  • DLOADERR

  • DOS_resource_list commands (for OS-aware targets)

  • DPIPEVIEW

  • DTBOARD

  • DTBREAK

  • DTFILE

  • DTRACE

  • EXPAND

  • FOPEN

  • FPRINTF

  • REGINFO

  • SHOW

  • VCLOSE

  • VMACRO.

Predefined macros that support user-defined file IDs

The following predefined macros support user-defined file IDs:

  • fclose

  • fgetc

  • fopen

  • fputc

  • fread

  • fwrite.

See also

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0153K
Non-Confidential