Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] New maintenance print typechain command.
@ 2007-04-04 14:37 lode lathouwers
  2007-04-07 17:39 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: lode lathouwers @ 2007-04-04 14:37 UTC (permalink / raw)
  To: gdb-patches

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

hi
this is my first patch ever to an open source project , so probably I am doing some things wrong here ...
Anyway attached you find some changes to add an extra print typechain command, which is like typechain, but instead of printing the internal nodes in the raw format it prints them in c-format.
This is handy when we want to extract some type declarations from a series of headerfiles, and generate a header file only containing the declarations for those types. Afterwards, we could for example use the file in swig to generate interfaces towards other programming languages.


		
___________________________________________________________ 
What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 

[-- Attachment #2: patch_print_type_chain.gz --]
[-- Type: application/x-gzip-compressed, Size: 2688 bytes --]

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

* Re: [PATCH] New maintenance print typechain command.
  2007-04-04 14:37 [PATCH] New maintenance print typechain command lode lathouwers
@ 2007-04-07 17:39 ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-04-07 17:39 UTC (permalink / raw)
  To: lode lathouwers; +Cc: gdb-patches

On Wed, Apr 04, 2007 at 02:37:18PM +0000, lode lathouwers wrote:
> hi
> this is my first patch ever to an open source project , so probably I am doing some things wrong here ...
> Anyway attached you find some changes to add an extra print typechain command, which is like typechain, but instead of printing the internal nodes in the raw format it prints them in c-format.
> This is handy when we want to extract some type declarations from a series of headerfiles, and generate a header file only containing the declarations for those types. Afterwards, we could for example use the file in swig to generate interfaces towards other programming languages.

Do you mean you're parsing the output of the maintenance command
to create your header?  I think that's a bad idea; the maint commands
are intended for GDB developers to use while debugging GDB.

Why can't you get what you need from 'info types'?

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [PATCH] New maintenance print typechain command.
  2007-04-08 18:51 lode lathouwers
@ 2007-04-10 14:03 ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-04-10 14:03 UTC (permalink / raw)
  To: lode lathouwers; +Cc: gdb-patches

On Sun, Apr 08, 2007 at 06:51:46PM +0000, lode lathouwers wrote:
> Why can't you get what you need from 'info types'? 
>     Info types does not show complete struct declarations (fields are not shown) Also it gives ALL type names, 
>     while I only want to explore/print a few + their downward dependancies.
> 

So what you want is the output of ptype for a bunch of different
types, but you don't know in advance which.  I think we should wait a
little while; our plan for this year (well, my plan anyway) is to add
Python scripting support to GDB, and that will be powerful enough to
do this.  I don't think the command will be widely enough useful to
implement it in GDB proper.

Once we have Python support, though, we should include a directory of
contributed and example scripts - this would be a great start for that.

(I'm planning to work on this starting in a month or so.)

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [PATCH] New maintenance print typechain command.
@ 2007-04-08 18:51 lode lathouwers
  2007-04-10 14:03 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: lode lathouwers @ 2007-04-08 18:51 UTC (permalink / raw)
  To: gdb-patches

On Wed, Apr 04, 2007 at 02:37:18PM +0000, lode lathouwers wrote: 
> hi 
> this is my first patch ever to an open source project , so probably I am doing some things wrong here ... 
> Anyway attached you find some changes to add an extra print typechain command, which is like typechain, but instead of printing the internal nodes in the raw format it prints them in c-format. 
> This is handy when we want to extract some type declarations from a series of headerfiles, and generate a header file only containing the declarations for those types. Afterwards, we could for example use the file in swig to generate interfaces towards other programming languages. 

Do you mean you're parsing the output of the maintenance command 
to create your header? 
     No, the output of the ,maintenance command is directly (via copypaste) used in the header; i.e. the output is a series of pure c(++) declarations, 
     so no parsing is needed.

I think that's a bad idea; the maint commands 
are intended for GDB developers to use while debugging GDB. 
    Indeed maybe the maintenance group ,might not be the best position to place this command. Maybe something like info typechain might 
   be better ?

Why can't you get what you need from 'info types'? 
    Info types does not show complete struct declarations (fields are not shown) Also it gives ALL type names, 
    while I only want to explore/print a few + their downward dependancies.

-- 
Daniel Jacobowitz 
CodeSourcery


		
___________________________________________________________ 
All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html


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

end of thread, other threads:[~2007-04-10 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-04 14:37 [PATCH] New maintenance print typechain command lode lathouwers
2007-04-07 17:39 ` Daniel Jacobowitz
2007-04-08 18:51 lode lathouwers
2007-04-10 14:03 ` Daniel Jacobowitz

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