|
1 // |
|
2 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 ////////////////////////////////////////////////////////////////////////////// |
|
17 // |
|
18 // Autoload script, called by TRACE32 if symbols are to be loaded. |
|
19 // |
|
20 // Change History: |
|
21 // |
|
22 // 03/08/2004 0.1 : Initial symbian version |
|
23 // 06/08/2004 2.0 : Rolled version to 2.0 for release |
|
24 // 04/05/2005 4.0 : Rolled version to 4.0 for release |
|
25 // 12/05/2009 4.1 : Tidied up in readiness for putting into Nokia's distribution system |
|
26 // 12/08/2009 4.2 : Added support for loading SBSv2 generated symbol files |
|
27 // 14/10/2009 4.3 : When manually loading .sym files, file dialog now displays sensible wildcards |
|
28 ////////////////////////////////////////////////////////////////////////////// |
|
29 |
|
30 &scriptversion=4.3 |
|
31 |
|
32 ; define local macros |
|
33 local &_FILENAME &basename &progname &filepath &code &data &space &databsslinear &symfilename &wildcard |
|
34 |
|
35 ; get _FILENAME and relocation information |
|
36 ; these parameters are passed when calling this skript |
|
37 entry &_FILENAME &code &data &databsslinear &space |
|
38 |
|
39 ; &_FILENAME: name of process/file |
|
40 ; &code: text segment address |
|
41 ; &data: data segment address (not used in Symbian OS) |
|
42 ; &databsslinear: combined data & bss segment address |
|
43 ; &space: space id of process (not used here) |
|
44 |
|
45 ;area.select ramdl |
|
46 print "Symbolics request: &_FILENAME &code &data &databsslinear &space" |
|
47 ; get symbol file name and program name |
|
48 &basename=string.cut(&_FILENAME,-string.len(os.file.extension(&_FILENAME))) |
|
49 &progname=os.file.name("&basename") |
|
50 |
|
51 ; delete program if it already exists or other code is already there |
|
52 y.delete &code |
|
53 if y.exist("\\&progname") |
|
54 y.delete \\&progname |
|
55 |
|
56 ; Determine whether to use SBSv1 or SBSv2 symbol file |
|
57 do checksymbols.cmm &_FILENAME |
|
58 |
|
59 ; We've decided which symbol file to use so go ahead and try to load it |
|
60 if !os.file("&filepath") |
|
61 ( |
|
62 local &file |
|
63 &file=os.file.path(&_FILENAME) |
|
64 winpos ,,,,,, filebox normal "Searching symbols for &_FILENAME" |
|
65 &wildcard="&file"+"\*.sym" |
|
66 dialog.file "&wildcard" |
|
67 entry %line &filepath |
|
68 &symfilename="&filepath" |
|
69 if "&filepath"=="" |
|
70 enddo |
|
71 ) |
|
72 |
|
73 ; load symbol file (options for sourcepath, e.g. /STRIPPART may need to be added when required) |
|
74 if string.scan(string.lwr("&_FILENAME"),"arm4",0)!=-1 |
|
75 ( |
|
76 print "Symbolics found ARM4: &symfilename" |
|
77 data.load.exe "&filepath" /noclear /cpp /nocode /strippart 3 /reloc .text at &code /reloc .data at &databsslinear /reloc .bss after .data |
|
78 ) |
|
79 else if string.scan(string.lwr("&_FILENAME"),"armv5",0)!=-1 |
|
80 ( |
|
81 print "Symbolics found ARMV5: &symfilename" |
|
82 ; Idea from baseporting database 2/8/2004 |
|
83 ; data.load.elf <sym file> .. /reloc ER_RO at XXXX |
|
84 ; data.load.elf "&filepath" &newcode /noclear /cpp /nocode /dwarf /rvct /strippart 3 |
|
85 ; autoload5.cmm: d.load.elf "&filepath" /noclear /cpp /nocode /rvct /dwarf /reloc ER_RO at &code |
|
86 ; BSS/global pointers aren't being setup properly |
|
87 ; My best attempt |
|
88 ;data.load.elf "&filepath" /noclear /cpp /nocode /rvct /dwarf /strippart 3 /reloc ER_RO at &code /reloc .data at &databsslinear /reloc .bss after .data |
|
89 ; From Rudi (04/03/05) |
|
90 data.load.elf "&filepath" /noclear /cpp /nocode /strippart 3 /reloc ER_RO at &code /reloc ER_RW at &databsslinear /reloc ER_ZI after ER_RW |
|
91 ) |
|
92 else |
|
93 ( |
|
94 print "Symbolics defaulting to ARMV5: &symfilename" |
|
95 data.load.elf "&filepath" /noclear /cpp /nocode /rvct /dwarf /strippart 3 /reloc ER_RO at &code /reloc .data at &databsslinear /reloc .bss after .data |
|
96 ) |
|
97 |
|
98 enddo |