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]

add-symbol-file syntax



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.

I ran in a lot of separate issues while fixing this.

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 moment:

(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> ...
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.

Would it be simpler to just have the second form of the command? 
I mean something of the form:

add-symbol-file FILE -s SEC_NAME SECT_ADDR -s SEC_NAME SECT_ADDR ...

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.

BTW, how are people using the command in general? I assume (almost)
nobody uses the command to specify addresses for more than .text, 
given that that doesn't work.

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.

Thanks

Elena

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