4 # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 # Gdb will set $_exitcode when the program exits. Pre-init it to an unlikely
23 # Gdb will call hook-stop on each break. Check to see if $_exitcode was
24 # changed from the value we pre-initialized it to. If so, the program
25 # had exited, so gdb should now quit.
36 # We keep track of the number of symbol files we have loaded via gdb
37 # scripts in the $SymbolFilesAdded variable
39 set $SymbolFileChangesCount = 0
42 # This macro adds a symbols file for gdb
44 # @param $arg0 - Symbol file changes number
45 # @param $arg1 - Symbol file name
46 # @param $arg2 - Image address
48 define AddFirmwareSymbolFile
49 if $SymbolFileChangesCount < $arg0
50 add-symbol-file $arg1 $arg2
51 set $SymbolFileChangesCount = $arg0
56 # This macro removes a symbols file for gdb
58 # @param $arg0 - Symbol file changes number
59 # @param $arg1 - Symbol file name
61 define RemoveFirmwareSymbolFile
62 if $SymbolFileChangesCount < $arg0
64 # Currently there is not a method to remove a single symbol file
66 set $SymbolFileChangesCount = $arg0
71 # in Xcode the program is already runing. Issuing a run command
72 # will cause a fatal debugger error. The break point sciprt that
73 # is used to source this script sets gInCode to 1.
76 # Start the program running