2
$Id: gdb.pas,v 1.18 2004/03/08 22:07:46 peter Exp $
3
Copyright (c) 1998-2002 by Florian Klaempfl
5
This units contains special support for the GDB
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
****************************************************************************
41
N_STSYM = 38; {initialized const }
42
N_LCSYM = 40; {non initialized variable}
43
N_Function = $24; {function or const }
47
N_RSYM = $40; { register variable }
57
tai_stabs = class(tai)
59
constructor Create(_str : pchar);
60
destructor Destroy;override;
63
tai_stabn = class(tai)
65
constructor Create(_str : pchar);
66
destructor Destroy;override;
69
{ insert a cut to split into several smaller files }
70
tai_force_line = class(tailineinfo)
74
tai_stab_function_name = class(tai)
76
constructor create(_str : pchar);
77
destructor destroy;override;
81
DBX_counter : plongint = nil;
82
do_count_dbx : boolean = false;
89
{ to use N_EXCL we have to count the character in the stabs for
91
Code comes from stabs.c for ld
97
struct stab_link_includes_entry *incl_entry;
98
struct stab_link_includes_totals *t;
99
struct stab_excl_list *ne;
103
for (incl_sym = sym + STABSIZE;
105
incl_sym += STABSIZE)
109
incl_type = incl_sym[TYPEOFF];
112
else if (incl_type == N_EINCL)
118
else if (incl_type == N_BINCL)
124
str = ((char *) stabstrbuf
126
+ bfd_get_32 (abfd, incl_sym + STRDXOFF));
127
for (; *str != '\0'; str++)
132
Skip the file number.
134
while (isdigit ((unsigned char) *str))
143
procedure count_dbx(st : pchar);
148
if assigned(dbx_counter) then
150
{$IfDef ExtDebugDbx }
151
Comment(V_Info,'Counting '+st);
152
Comment(V_Info,'count = '+tostr(dbx_counter^));
153
Comment(V_Info,'addr = '+tostr(longint(dbx_counter)));
154
{$EndIf ExtDebugDbx }
156
while i<=strlen(st) do
159
if do_count then exit
160
else do_count := true
164
dbx_counter^ := dbx_counter^+byte(st[i]);
169
while st[i] in ['0'..'9'] do inc(i);
179
constructor tai_stabs.create(_str : pchar);
185
if current_module.modulename^='NCNV' then
186
current_module:=current_module;
195
destructor tai_stabs.destroy;
202
constructor tai_stabn.create(_str : pchar);
210
destructor tai_stabn.destroy;
217
constructor tai_force_line.create;
224
constructor tai_stab_function_name.create(_str : pchar);
228
typ:=ait_stab_function_name;
232
destructor tai_stab_function_name.destroy;
242
Revision 1.18 2004/03/08 22:07:46 peter
243
* stabs updates to write stabs for def for all implictly used
246
Revision 1.17 2003/10/22 15:22:33 peter
247
* fixed unitsym-globalsymtable relation so the uses of a unit
250
Revision 1.16 2002/11/17 16:31:56 carl
251
* memory optimization (3-4%) : cleanup of tai fields,
252
cleanup of tdef and tsym fields.
253
* make it work for m68k
255
Revision 1.15 2002/08/12 15:08:39 carl
256
+ stab register indexes for powerpc (moved from gdb to cpubase)
257
+ tprocessor enumeration moved to cpuinfo
258
+ linker in target_info is now a class
259
* many many updates for m68k (will soon start to compile)
260
- removed some ifdef or correct them for correct cpu
262
Revision 1.14 2002/07/01 18:46:22 peter
264
* reorganized aasm layer
266
Revision 1.13 2002/05/18 13:34:08 peter
267
* readded missing revisions
269
Revision 1.12 2002/05/16 19:46:36 carl
270
+ defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
271
+ try to fix temp allocation (still in ifdef)
272
+ generic constructor calls
273
+ start of tassembler / tmodulebase class cleanup
275
Revision 1.10 2002/05/06 19:49:26 carl
276
+ added more patches from Mazen for SPARC port