public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [VMS/committed] Handle DSF and STB files
@ 2010-05-14  7:44 Tristan Gingold
  2010-05-14 19:05 ` h.becker
  0 siblings, 1 reply; 3+ messages in thread
From: Tristan Gingold @ 2010-05-14  7:44 UTC (permalink / raw)
  To: binutils

Hi,

in order to handle (well, to read them) DSF (Debug Symbol File) and STB (Symbol Table File), vms-alpha.c
required two minor fixes.  One of them fixes in fact a real bug that could appear also with object files.

Tristan.

bfd/
2010-05-14  Tristan Gingold  <gingold@adacore.com>

	* vms-alpha.c (alpha_vms_object_p): Accept header size of 0.
	(_bfd_vms_get_object_record): Handle align byte only in the
	foreign case.

diff -c -r1.6 vms-alpha.c
*** vms-alpha.c	3 May 2010 16:04:31 -0000	1.6
--- vms-alpha.c	14 May 2010 07:28:24 -0000
***************
*** 759,765 ****
    vms_debug2 ((8, "_bfd_vms_get_obj_record\n"));
  
    /* Skip alignment byte if the current position is odd.  */
!   if (bfd_tell (abfd) & 1)
      {
        if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
          {
--- 759,765 ----
    vms_debug2 ((8, "_bfd_vms_get_obj_record\n"));
  
    /* Skip alignment byte if the current position is odd.  */
!   if (PRIV (recrd.file_format) == FF_FOREIGN && (bfd_tell (abfd) & 1))
      {
        if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
          {
***************
*** 2450,2455 ****
--- 2450,2459 ----
        /* Extract the header size.  */
        PRIV (recrd.rec_size) = bfd_getl32 (buf + EIHD__L_SIZE);
  
+       /* The header size is 0 for DSF files.  */
+       if (PRIV (recrd.rec_size) == 0)
+         PRIV (recrd.rec_size) = sizeof (struct vms_eihd);
+ 
        if (PRIV (recrd.rec_size) > PRIV (recrd.buf_size))
          {
            buf = bfd_realloc_or_free (buf, PRIV (recrd.rec_size));

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

* Re: [VMS/committed] Handle DSF and STB files
  2010-05-14  7:44 [VMS/committed] Handle DSF and STB files Tristan Gingold
@ 2010-05-14 19:05 ` h.becker
  2010-05-17  7:19   ` Tristan Gingold
  0 siblings, 1 reply; 3+ messages in thread
From: h.becker @ 2010-05-14 19:05 UTC (permalink / raw)
  To: Tristan Gingold, binutils

Tristan Gingold wrote:
> in order to handle (well, to read them) DSF (Debug Symbol File) and STB (Symbol Table File), vms-alpha.c
> required two minor fixes.  One of them fixes in fact a real bug that could appear also with object files.

DSFs have image file format, which is an unstructured (binary) file - 
disk blocks aka fixed size records of 512 bytes. They have an image 
header, which points to the debug information. STB files have object 
file format, which is an record structured (binary) file.

Reading with alpha_vms_object_p seems OK for the STB files but looks 
strange for the DSFs.

Hartmut

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

* Re: [VMS/committed] Handle DSF and STB files
  2010-05-14 19:05 ` h.becker
@ 2010-05-17  7:19   ` Tristan Gingold
  0 siblings, 0 replies; 3+ messages in thread
From: Tristan Gingold @ 2010-05-17  7:19 UTC (permalink / raw)
  To: h.becker; +Cc: binutils


On May 14, 2010, at 9:04 PM, h.becker wrote:

> Tristan Gingold wrote:
>> in order to handle (well, to read them) DSF (Debug Symbol File) and STB (Symbol Table File), vms-alpha.c
>> required two minor fixes.  One of them fixes in fact a real bug that could appear also with object files.
> 
> DSFs have image file format, which is an unstructured (binary) file - disk blocks aka fixed size records of 512 bytes. They have an image header, which points to the debug information. STB files have object file format, which is an record structured (binary) file.

Yes.

> Reading with alpha_vms_object_p seems OK for the STB files but looks strange for the DSFs.

Well, alpha_vms_object_p handles both object and executable files as there is only one entry points
for these both kinds of files.

Tristan.

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

end of thread, other threads:[~2010-05-17  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-14  7:44 [VMS/committed] Handle DSF and STB files Tristan Gingold
2010-05-14 19:05 ` h.becker
2010-05-17  7:19   ` Tristan Gingold

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