This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

RE: [PATCH 0/3] remove-symbol-file


Thanks Tom, Pedro for your feedback. 

I'll try to respond to both of you in this email.

This implementation only removes files that were added via the add-symbol-file command.
The add-symbol-file command takes as parameter the address of the text session. In this
context I think the text address is the most appropriate way to remove a file because:
  1) the user knows exactly where the .text section was loaded,
  2) an application can load shared libraries several times at different addresses (it's a requirement for me), and
  3) I can't think of a good reason why someone would add a second symbol file at the same address.
     Most likely this is a user error that should have been reported by add-symbol-file.

Note that currently in Option 4 below ADDR is in fact "objf->addr_low", but the command could be more generous
by searching first which file corresponds to ADDR and then removing it. This would be more flexible and an
alternative to Option 3, for instance.

1) remove-symbol-file FILE
2) remove-symbol-file FILE ADDR
3) remove-symbol-file -s .data DATA_ADDR
4) remove-symbol-file ADDR

As a matter of taste I prefer the options where FILE is not mandatory because this can easily be more
ambiguous.

Now as suggested by Tom, the scope of the command could also be broaden to allow removing any
symbol file. I could try to lift this restriction if you think there is more general need for removing
arbitrary symbol files.

What are your preferences?

Best Regards,

Nicolas




Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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