Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Dwarf2 Producer info
@ 2004-07-20 22:14 David Lecomber
  2004-07-20 23:18 ` Daniel Jacobowitz
  2004-07-26 20:55 ` [RFA] Dwarf2 Producer info (dwarf2read.c) David Lecomber
  0 siblings, 2 replies; 10+ messages in thread
From: David Lecomber @ 2004-07-20 22:14 UTC (permalink / raw)
  To: patches

Hi

This is an obvious extension to plug a gap. 

I've some more changes to come that make use of this (specifically to
take account of broken g77) and also fix some longstanding array issues,
but I'm getting this easy one in the source before inflicting the
complex one on the world..  if anyone has a sharper eye than me for the
code formatting rules, please feel free to shout out!

Cheers 
David

2004-07-20  David Lecomber  <dsl@sources.redhat.com>

	* dwarf2read.c (set_cu_producer): New.


Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.156
diff -p -r1.156 dwarf2read.c
*** dwarf2read.c	6 Jul 2004 19:29:30 -0000	1.156
--- dwarf2read.c	20 Jul 2004 22:12:07 -0000
*************** struct dwarf2_cu
*** 262,267 ****
--- 262,269 ----
    enum language language;
    const struct language_defn *language_defn;
  
+   const char* producer;
+ 
    /* The generic symbol table building routines have separate lists
for
       file scope symbols and all all other scopes (local scopes).  So
       we need to select the right one to pass to add_symbol_to_list().
*************** static char *skip_leb128 (bfd *, char *)
*** 739,744 ****
--- 741,748 ----
  
  static void set_cu_language (unsigned int, struct dwarf2_cu *);
  
+ static void set_cu_producer (const char*, struct dwarf2_cu *);
+ 
  static struct attribute *dwarf2_attr (struct die_info *, unsigned int,
  				      struct dwarf2_cu *);
  
*************** read_file_scope (struct die_info *die, s
*** 2362,2367 ****
--- 2366,2378 ----
        set_cu_language (DW_UNSND (attr), cu);
      }
  
+   attr = dwarf2_attr (die, DW_AT_producer, cu);
+   if (attr)
+     set_cu_producer (DW_STRING (attr), cu);
+   else 
+     set_cu_producer(NULL, cu);
+       
+   
    /* We assume that we're processing GCC output. */
    processing_gcc_compilation = 2;
  #if 0
*************** skip_leb128 (bfd *abfd, char *buf)
*** 5560,5565 ****
--- 5571,5582 ----
  }
  
  static void
+ set_cu_producer (const char* producer, struct dwarf2_cu *cu)
+ {
+   cu->producer = producer;
+ }
+ 
+ static void
  set_cu_language (unsigned int lang, struct dwarf2_cu *cu)
  {
    switch (lang)



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

* Re: Dwarf2 Producer info
  2004-07-20 22:14 Dwarf2 Producer info David Lecomber
@ 2004-07-20 23:18 ` Daniel Jacobowitz
  2004-07-20 23:40   ` David Lecomber
  2004-07-26 20:55 ` [RFA] Dwarf2 Producer info (dwarf2read.c) David Lecomber
  1 sibling, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-07-20 23:18 UTC (permalink / raw)
  To: David Lecomber; +Cc: patches

On Tue, Jul 20, 2004 at 11:29:58PM +0100, David Lecomber wrote:
> Hi
> 
> This is an obvious extension to plug a gap. 
> 
> I've some more changes to come that make use of this (specifically to
> take account of broken g77) and also fix some longstanding array issues,
> but I'm getting this easy one in the source before inflicting the
> complex one on the world..  if anyone has a sharper eye than me for the
> code formatting rules, please feel free to shout out!

I guess changing behavior based on producer is less gross than a lot of
our existing hacks...
> +   const char* producer;
> + 

"const char *"

>     /* The generic symbol table building routines have separate lists
> for

Please use a mailer which does not line wrap patches.
> + static void set_cu_producer (const char*, struct dwarf2_cu *);

"const char *"

> +   if (attr)
> +     set_cu_producer (DW_STRING (attr), cu);
> +   else 
> +     set_cu_producer(NULL, cu);

set_cu_producer (NULL, cu);

Is set_cu_producer going to do anything else?  Otherwise I don't see
the point of the wrapper function.

-- 
Daniel Jacobowitz


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

* Re: Dwarf2 Producer info
  2004-07-20 23:18 ` Daniel Jacobowitz
@ 2004-07-20 23:40   ` David Lecomber
  2004-07-21  0:09     ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: David Lecomber @ 2004-07-20 23:40 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: patches


> Is set_cu_producer going to do anything else?  Otherwise I don't see
> the point of the wrapper function.

Hi Dan,

Not in the immediately foreseeable future, but I can imagine a situation
where the producer is matched with some known producer strings and an
enumerated constant is stored instead; if that ever happens, it will be
better if there's one setter.

BTW, there's also a processing_gcc_compilation in dwarf2read which is
not taking any notice of producers; I've not changed that but someone
might want to, maybe..

Cheers
David


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

* Re: Dwarf2 Producer info
  2004-07-20 23:40   ` David Lecomber
@ 2004-07-21  0:09     ` Daniel Jacobowitz
  2004-07-21  7:12       ` David Lecomber
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-07-21  0:09 UTC (permalink / raw)
  To: David Lecomber; +Cc: patches

On Wed, Jul 21, 2004 at 12:56:07AM +0100, David Lecomber wrote:
> 
> > Is set_cu_producer going to do anything else?  Otherwise I don't see
> > the point of the wrapper function.
> 
> Hi Dan,
> 
> Not in the immediately foreseeable future, but I can imagine a situation
> where the producer is matched with some known producer strings and an
> enumerated constant is stored instead; if that ever happens, it will be
> better if there's one setter.

There will still be only one setter; let's drop the useless wrapper,
unless one of the dwarf2 maintainers feels otherwise.

-- 
Daniel Jacobowitz


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

* Re: Dwarf2 Producer info
  2004-07-21  0:09     ` Daniel Jacobowitz
@ 2004-07-21  7:12       ` David Lecomber
  2004-07-21 13:25         ` Daniel Jacobowitz
  2004-07-28 19:05         ` Jim Blandy
  0 siblings, 2 replies; 10+ messages in thread
From: David Lecomber @ 2004-07-21  7:12 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: patches


Fine by me -- in fact, even the null setting isn't needed now I've found
the bit that ensures the cu is cleared during allocation (do you
agree?).

So here goes:

2004-07-20  David Lecomber  <dsl@sources.redhat.com>

	* dwarf2read.c (read_file_scope): Set producer if attribute 
	present.


Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.156
diff -p -r1.156 dwarf2read.c
*** dwarf2read.c	6 Jul 2004 19:29:30 -0000	1.156
--- dwarf2read.c	21 Jul 2004 07:07:03 -0000
*************** struct dwarf2_cu
*** 262,267 ****
--- 262,269 ----
    enum language language;
    const struct language_defn *language_defn;
  
+   const char* producer;
+ 
    /* The generic symbol table building routines have separate lists
for
       file scope symbols and all all other scopes (local scopes).  So
       we need to select the right one to pass to add_symbol_to_list().
*************** read_file_scope (struct die_info *die, s
*** 2362,2367 ****
--- 2364,2373 ----
        set_cu_language (DW_UNSND (attr), cu);
      }
  
+   attr = dwarf2_attr (die, DW_AT_producer, cu);
+   if (attr) 
+     cu->producer = DW_STRING (attr);
+   
    /* We assume that we're processing GCC output. */
    processing_gcc_compilation = 2;
  #if 0

On Wed, 2004-07-21 at 01:08, Daniel Jacobowitz wrote:
> On Wed, Jul 21, 2004 at 12:56:07AM +0100, David Lecomber wrote:
> > 
> > > Is set_cu_producer going to do anything else?  Otherwise I don't see
> > > the point of the wrapper function.
> > 
> > Hi Dan,
> > 
> > Not in the immediately foreseeable future, but I can imagine a situation
> > where the producer is matched with some known producer strings and an
> > enumerated constant is stored instead; if that ever happens, it will be
> > better if there's one setter.
> 
> There will still be only one setter; let's drop the useless wrapper,
> unless one of the dwarf2 maintainers feels otherwise.


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

* Re: Dwarf2 Producer info
  2004-07-21  7:12       ` David Lecomber
@ 2004-07-21 13:25         ` Daniel Jacobowitz
  2004-07-28 19:05         ` Jim Blandy
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-07-21 13:25 UTC (permalink / raw)
  To: David Lecomber; +Cc: patches

On Wed, Jul 21, 2004 at 08:28:05AM +0100, David Lecomber wrote:
> +   const char* producer;
> + 

"const char *".


Otherwise you'll have to get the opinion of one of the dwarf2
maintainers.

-- 
Daniel Jacobowitz


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

* [RFA] Dwarf2 Producer info (dwarf2read.c)
  2004-07-20 22:14 Dwarf2 Producer info David Lecomber
  2004-07-20 23:18 ` Daniel Jacobowitz
@ 2004-07-26 20:55 ` David Lecomber
  2004-07-29 10:28   ` David Lecomber
  1 sibling, 1 reply; 10+ messages in thread
From: David Lecomber @ 2004-07-26 20:55 UTC (permalink / raw)
  To: patches

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

Can someone give the final aye or nay for this patch please?

Apologies in advance for the wrapping of lines that Evolution will do in
the comment..

Cheers
David


2004-07-20  David Lecomber  <dsl@sources.redhat.com>

        * dwarf2read.c (read_file_scope): Set producer if attribute
        present.



Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.156
diff -p -r1.156 dwarf2read.c
*** dwarf2read.c	6 Jul 2004 19:29:30 -0000	1.156
--- dwarf2read.c	21 Jul 2004 07:07:03 -0000
*************** struct dwarf2_cu
*** 262,267 ****
--- 262,269 ----
    enum language language;
    const struct language_defn *language_defn;
  
+   const char *producer;
+ 
    /* The generic symbol table building routines have separate lists
for
       file scope symbols and all all other scopes (local scopes).  So
       we need to select the right one to pass to add_symbol_to_list().
*************** read_file_scope (struct die_info *die, s
*** 2362,2367 ****
--- 2364,2373 ----
        set_cu_language (DW_UNSND (attr), cu);
      }
  
+   attr = dwarf2_attr (die, DW_AT_producer, cu);
+   if (attr) 
+     cu->producer = DW_STRING (attr);
+   
    /* We assume that we're processing GCC output. */
    processing_gcc_compilation = 2;
  #if 0


[-- Attachment #2: dwarf2.patch1 --]
[-- Type: text/x-patch, Size: 1029 bytes --]

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.156
diff -p -r1.156 dwarf2read.c
*** dwarf2read.c	6 Jul 2004 19:29:30 -0000	1.156
--- dwarf2read.c	21 Jul 2004 07:07:03 -0000
*************** struct dwarf2_cu
*** 262,267 ****
--- 262,269 ----
    enum language language;
    const struct language_defn *language_defn;
  
+   const char *producer;
+ 
    /* The generic symbol table building routines have separate lists for
       file scope symbols and all all other scopes (local scopes).  So
       we need to select the right one to pass to add_symbol_to_list().
*************** read_file_scope (struct die_info *die, s
*** 2362,2367 ****
--- 2364,2373 ----
        set_cu_language (DW_UNSND (attr), cu);
      }
  
+   attr = dwarf2_attr (die, DW_AT_producer, cu);
+   if (attr) 
+     cu->producer = DW_STRING (attr);
+   
    /* We assume that we're processing GCC output. */
    processing_gcc_compilation = 2;
  #if 0

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

* Re: Dwarf2 Producer info
  2004-07-21  7:12       ` David Lecomber
  2004-07-21 13:25         ` Daniel Jacobowitz
@ 2004-07-28 19:05         ` Jim Blandy
  1 sibling, 0 replies; 10+ messages in thread
From: Jim Blandy @ 2004-07-28 19:05 UTC (permalink / raw)
  To: David Lecomber; +Cc: Daniel Jacobowitz, patches


David Lecomber <david@streamline-computing.com> writes:
> Fine by me -- in fact, even the null setting isn't needed now I've found
> the bit that ensures the cu is cleared during allocation (do you
> agree?).

Looks fine --- but you need a ChangeLog entry for the change to
'struct dwarf2_cu', as well as the change to read_file_scope.
With that change, this is okay.


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

* Re: [RFA] Dwarf2 Producer info (dwarf2read.c)
  2004-07-26 20:55 ` [RFA] Dwarf2 Producer info (dwarf2read.c) David Lecomber
@ 2004-07-29 10:28   ` David Lecomber
  2004-07-29 19:25     ` Jim Blandy
  0 siblings, 1 reply; 10+ messages in thread
From: David Lecomber @ 2004-07-29 10:28 UTC (permalink / raw)
  To: patches

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]


> Apologies in advance for the wrapping of lines that Evolution will do in
> the comment..

Reposting with final suggested changes from Jim B to ChangeLog plus the
patch is now an attachment.  

d.

2004-07-29  David Lecomber  <dsl@sources.redhat.com>

        * dwarf2read.c (read_file_scope): Set producer if attribute
        present.
        (struct dwarf2_cu): Added new member producer.



[-- Attachment #2: dwarf2read.c.patch --]
[-- Type: text/x-patch, Size: 1032 bytes --]

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.156
diff -c -p -r1.156 dwarf2read.c
*** dwarf2read.c	6 Jul 2004 19:29:30 -0000	1.156
--- dwarf2read.c	29 Jul 2004 10:20:20 -0000
*************** struct dwarf2_cu
*** 262,267 ****
--- 262,269 ----
    enum language language;
    const struct language_defn *language_defn;
  
+   const char *producer;
+ 
    /* The generic symbol table building routines have separate lists for
       file scope symbols and all all other scopes (local scopes).  So
       we need to select the right one to pass to add_symbol_to_list().
*************** read_file_scope (struct die_info *die, s
*** 2362,2367 ****
--- 2364,2373 ----
        set_cu_language (DW_UNSND (attr), cu);
      }
  
+   attr = dwarf2_attr (die, DW_AT_producer, cu);
+   if (attr) 
+     cu->producer = DW_STRING (attr);
+   
    /* We assume that we're processing GCC output. */
    processing_gcc_compilation = 2;
  #if 0

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

* Re: [RFA] Dwarf2 Producer info (dwarf2read.c)
  2004-07-29 10:28   ` David Lecomber
@ 2004-07-29 19:25     ` Jim Blandy
  0 siblings, 0 replies; 10+ messages in thread
From: Jim Blandy @ 2004-07-29 19:25 UTC (permalink / raw)
  To: David Lecomber; +Cc: patches


David Lecomber <david@streamline-computing.com> writes:
> > Apologies in advance for the wrapping of lines that Evolution will do in
> > the comment..
> 
> Reposting with final suggested changes from Jim B to ChangeLog plus the
> patch is now an attachment.  

Looks great --- thanks.  Please commit.


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

end of thread, other threads:[~2004-07-29 19:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20 22:14 Dwarf2 Producer info David Lecomber
2004-07-20 23:18 ` Daniel Jacobowitz
2004-07-20 23:40   ` David Lecomber
2004-07-21  0:09     ` Daniel Jacobowitz
2004-07-21  7:12       ` David Lecomber
2004-07-21 13:25         ` Daniel Jacobowitz
2004-07-28 19:05         ` Jim Blandy
2004-07-26 20:55 ` [RFA] Dwarf2 Producer info (dwarf2read.c) David Lecomber
2004-07-29 10:28   ` David Lecomber
2004-07-29 19:25     ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox