This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: add-symbol-file syntax


On Thu, 06 Apr 2000, Elena Zannoni wrote:
> I am trying to fix the command add-symbol-file for the case in which
> .text, .data, .bss, etc. addresses are provided by the user.
>=20
> I ran in a lot of separate issues while fixing this.
>=20
> First of all: the syntax of the command is not the best, in my
> opinion.
> You can provide arguments in different, inconsistent ways. At the momen=
t:
>=20
> (gdb) help add-symbol-file
> Usage: add-symbol-file FILE ADDR [DATA_ADDR [BSS_ADDR]]
> or:    add-symbol-file FILE -T<SECT> <SECT_ADDR> -T<SECT> <SECT_ADDR> .=
=2E.
> Load the symbols from FILE, assuming FILE has been dynamically loaded.
> ADDR is the starting address of the file's text.
> The optional arguments, DATA_ADDR and BSS_ADDR, should be specified
> if the data and bss segments are not contiguous with the text.
> For complicated cases, SECT is a section name to be loaded at SECT_ADDR=
=2E
>=20
> Would it be simpler to just have the second form of the command?=20
> I mean something of the form:
>=20
> add-symbol-file FILE -s SEC_NAME SECT_ADDR -s SEC_NAME SECT_ADDR ...
>=20
> This would simplify the argument processing code quite a lot, and also
> simplify the section_addr_info structure, which treats .text, .data,
> .bss in a special way.
>=20
> BTW, how are people using the command in general? I assume (almost)
> nobody uses the command to specify addresses for more than .text,=20
> given that that doesn't work.

That's because it doesn't work. I tried to solve it sometime back but fai=
led.
I use gdb for linux kernel, module debugging. I get around this problem b=
y using
ld to make a relocated (module) file and then using a gdb patch to
disable relocation while adding the module file.

If you can get add-symbol-file with text, data, bss addresses specified
seperately, it would be of great help to linux kernel programmers who nee=
d to
debug modules using gdb.

Thanks.

>=20
> Other issues are related to the use of indexes from BFD vs. indexes
> from GDB to access section info, but I will talk about that in
> separate e-mails.
>=20
> Thanks
>=20
> Elena
--=20
Amit Kale
Veritas Software ( http://www.veritas.com )

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]