public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] pdb: Allow loading by gdb
       [not found] <20230509003247.24156-1-mark@harmstone.com>
@ 2023-05-10  0:56 ` Alan Modra
  2023-05-15  1:04   ` Mark Harmstone
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2023-05-10  0:56 UTC (permalink / raw)
  To: Mark Harmstone; +Cc: binutils, gdb-patches

On Tue, May 09, 2023 at 01:32:46AM +0100, Mark Harmstone wrote:
> Add a new bfd_flavour value, and expose PDB files as objects, so that
> they get accepted by add-symbol-file.

By equating object_p and archive_p you are going to get whichever of
bfd_archive or bfd_object is tried first as the argument of
bfd_check_format (or bfd_check_format_matches).  This seems fragile to
me.  We have multiple binary utilities, ld, and gbd all calling
bfd_check_format.  Do they all work correctly with this change, and
will they continue to work correctly with future changes?

I think you'd be better off staying with just one format, and
bfd_archive probably fits pdb files better than bfd_object.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] pdb: Allow loading by gdb
  2023-05-10  0:56 ` [PATCH 1/2] pdb: Allow loading by gdb Alan Modra
@ 2023-05-15  1:04   ` Mark Harmstone
  2023-05-15  1:26     ` Alan Modra
  2023-05-16 15:03     ` Tom Tromey
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Harmstone @ 2023-05-15  1:04 UTC (permalink / raw)
  To: Alan Modra, binutils, gdb-patches

On 10/5/23 01:56, Alan Modra wrote:
> I think you'd be better off staying with just one format, and
> bfd_archive probably fits pdb files better than bfd_object.

Thanks Alan. But `add-symbol-file` is set up to accept object
files - does this imply that I should change it to treat PDB
archives as a special case?

Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] pdb: Allow loading by gdb
  2023-05-15  1:04   ` Mark Harmstone
@ 2023-05-15  1:26     ` Alan Modra
  2023-05-16 15:03     ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Modra @ 2023-05-15  1:26 UTC (permalink / raw)
  To: Mark Harmstone; +Cc: binutils, gdb-patches

On Mon, May 15, 2023 at 02:04:29AM +0100, Mark Harmstone wrote:
> On 10/5/23 01:56, Alan Modra wrote:
> > I think you'd be better off staying with just one format, and
> > bfd_archive probably fits pdb files better than bfd_object.
> 
> Thanks Alan. But `add-symbol-file` is set up to accept object
> files - does this imply that I should change it to treat PDB
> archives as a special case?

I expect that is what should happen, but I'm not a gdb maintainer and
probably shouldn't be giving gdb advice.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] pdb: Allow loading by gdb
  2023-05-15  1:04   ` Mark Harmstone
  2023-05-15  1:26     ` Alan Modra
@ 2023-05-16 15:03     ` Tom Tromey
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2023-05-16 15:03 UTC (permalink / raw)
  To: Mark Harmstone; +Cc: Alan Modra, binutils, gdb-patches

>>>>> "Mark" == Mark Harmstone <mark@harmstone.com> writes:

Mark> On 10/5/23 01:56, Alan Modra wrote:
>> I think you'd be better off staying with just one format, and
>> bfd_archive probably fits pdb files better than bfd_object.

Mark> Thanks Alan. But `add-symbol-file` is set up to accept object
Mark> files - does this imply that I should change it to treat PDB
Mark> archives as a special case?

It seems fine to me as long as add-symbol-file doesn't end up letting
users supply ".a" files.

I guess I'd expect the usual approach to be something more automatic
though?

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-16 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230509003247.24156-1-mark@harmstone.com>
2023-05-10  0:56 ` [PATCH 1/2] pdb: Allow loading by gdb Alan Modra
2023-05-15  1:04   ` Mark Harmstone
2023-05-15  1:26     ` Alan Modra
2023-05-16 15:03     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).