From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14626 invoked by alias); 19 Sep 2008 15:21:11 -0000 Received: (qmail 14615 invoked by uid 22791); 19 Sep 2008 15:21:10 -0000 X-Spam-Check-By: sourceware.org Received: from smtp.nokia.com (HELO mgw-mx06.nokia.com) (192.100.122.233) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 19 Sep 2008 15:20:35 +0000 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx06.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id m8JFK1I3017029; Fri, 19 Sep 2008 18:20:28 +0300 Received: from vaebh102.NOE.Nokia.com ([10.160.244.23]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Sep 2008 18:20:26 +0300 Received: from vaebh101.NOE.Nokia.com ([10.160.244.22]) by vaebh102.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Sep 2008 18:20:03 +0300 Received: from gar.local ([172.25.167.168]) by vaebh101.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Sep 2008 18:20:03 +0300 From: =?iso-8859-1?q?Andr=E9_P=F6nitz?= To: drow@false.org Subject: Re: gdb sources Date: Fri, 19 Sep 2008 15:21:00 -0000 User-Agent: KMail/1.9.9 References: <200809121713.09226.apoenitz@trolltech.com> <200809191612.23617.apoenitz@trolltech.com> <20080919144422.GA32108@caradoc.them.org> In-Reply-To: <20080919144422.GA32108@caradoc.them.org> Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_xM80I3/yvq/zLEO" Message-Id: <200809191720.17336.apoenitz@trolltech.com> X-Nokia-AV: Clean X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00411.txt.bz2 --Boundary-00=_xM80I3/yvq/zLEO Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 2034 On Friday 19 September 2008 16:44:22 Daniel Jacobowitz wrote: > It looks like you don't have a copyright assignment or employer > disclaimer on file. Is that correct? If so, we should sort it out > now before you contribute anything larger. Working on that already. Might take a while, though. The stuff in question is certainly well below any reasonable threshold of "original art", though, but I see the problem. > > I hope this is uncontroversial, but before going further into this > > direction I have two related questions: > > > > 1. How would the prefered way to call, say, xfree on a 'conceptionally const > > char *' item look like? Are casts to non-const (void *) acceptable > > here? > > Probably acceptable, but if you know it is allocated by xfree, should > it really be returned as const? The problem will come up with "char *" struct members pointing to "names" of all sorts. They could arguably be "const char *" as they usually aren't touched between construction and destruction to get a compiler warning if something tries to modify them nevertheless. But then, those members could stay non-const... > > the work. Are there any shortcuts available/acceptable? > > If you have to update the call sites, you can say "all callers > updated" or something like that in the changelog entry, though if any > of the changes are more than mechanical then it's better to list > the complicated ones explicitly. But for just a change to a prototype > and a definition, I think the changelog entry is still appropriate. > > BTW, your changelog is too verbose in another way; there is normally > only one starred entry for a file and you can combine similar changes. > Like this: > > * symfile.c (allocate_symtab, allocate_psymtab, free_named_symtabs) > (deduce_language_from_filename): Accept a const argument. Ok. > Please use diff -up for patches; with the default diff arguments, it's > impossible to see what you've changed. I intented to do that but I somehow fumbled. Next try attached. Andre' --Boundary-00=_xM80I3/yvq/zLEO Content-Type: text/x-diff; charset="iso-8859-1"; name="2" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2" Content-length: 5115 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.9826 diff -u -p -r1.9826 ChangeLog --- ChangeLog 17 Sep 2008 21:48:48 -0000 1.9826 +++ ChangeLog 19 Sep 2008 15:11:01 -0000 @@ -1,3 +1,18 @@ + +2008-09-19 Andre Poenitz + + * symfile.c (allocate_symtab,allocate_psymtab): Accept a const argument. + (allocate_psymtab): Likewise. + (free_named_symtabs): Likewise. + (deduce_language_from_filename): Likewise. + + * symfile.h (allocate_symtab): Update prototype. + (allocate_psymtab): Likewise. + (free_named_symtabs): Likewise. + * symtab.h (deduce_language_from_filename): Likewise. + + * i386-tdep.c (i386_analyze_stack_align): Fix typo in comment. + 2008-09-17 Jan Kratochvil Fix a crash on uninitialized ECS->EVENT_THREAD for a newly found thread. Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.266 diff -u -p -r1.266 i386-tdep.c --- i386-tdep.c 11 Sep 2008 14:23:15 -0000 1.266 +++ i386-tdep.c 19 Sep 2008 15:11:15 -0000 @@ -784,7 +784,7 @@ i386_analyze_stack_align (CORE_ADDR pc, offset = 5; } - /* Rigister can't be %esp nor %ebp. */ + /* Register can't be %esp nor %ebp. */ if (reg == 4 || reg == 5) return pc; Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.215 diff -u -p -r1.215 symfile.c --- symfile.c 13 Sep 2008 17:28:56 -0000 1.215 +++ symfile.c 19 Sep 2008 15:11:30 -0000 @@ -1544,7 +1544,7 @@ set_initial_language (void) if (lang == language_unknown) { - /* Make C the default language */ + /* Make C the default language. */ lang = language_c; } @@ -2685,10 +2685,10 @@ init_filename_language_table (void) } enum language -deduce_language_from_filename (char *filename) +deduce_language_from_filename (const char *filename) { int i; - char *cp; + const char *cp; if (filename != NULL) if ((cp = strrchr (filename, '.')) != NULL) @@ -2714,7 +2714,7 @@ deduce_language_from_filename (char *fil */ struct symtab * -allocate_symtab (char *filename, struct objfile *objfile) +allocate_symtab (const char *filename, struct objfile *objfile) { struct symtab *symtab; @@ -2738,7 +2738,7 @@ allocate_symtab (char *filename, struct } struct partial_symtab * -allocate_psymtab (char *filename, struct objfile *objfile) +allocate_psymtab (const char *filename, struct objfile *objfile) { struct partial_symtab *psymtab; @@ -2946,7 +2946,7 @@ cashier_psymtab (struct partial_symtab * all stray pointers into the freed symtab. */ int -free_named_symtabs (char *name) +free_named_symtabs (const char *name) { #if 0 /* FIXME: With the new method of each objfile having it's own @@ -3052,7 +3052,7 @@ again2: struct partial_symtab * start_psymtab_common (struct objfile *objfile, - struct section_offsets *section_offsets, char *filename, + struct section_offsets *section_offsets, const char *filename, CORE_ADDR textlow, struct partial_symbol **global_syms, struct partial_symbol **static_syms) { Index: symfile.h =================================================================== RCS file: /cvs/src/src/gdb/symfile.h,v retrieving revision 1.48 diff -u -p -r1.48 symfile.h --- symfile.h 5 Sep 2008 11:37:17 -0000 1.48 +++ symfile.h 19 Sep 2008 15:11:30 -0000 @@ -203,9 +203,9 @@ extern void init_psymbol_list (struct ob extern void sort_pst_symbols (struct partial_symtab *); -extern struct symtab *allocate_symtab (char *, struct objfile *); +extern struct symtab *allocate_symtab (const char *, struct objfile *); -extern int free_named_symtabs (char *); +extern int free_named_symtabs (const char *); extern void add_symtab_fns (struct sym_fns *); @@ -249,7 +249,7 @@ extern void free_section_addr_info (stru extern struct partial_symtab *start_psymtab_common (struct objfile *, struct section_offsets *, - char *, CORE_ADDR, + const char *, CORE_ADDR, struct partial_symbol **, struct partial_symbol **); @@ -299,7 +299,7 @@ extern int auto_solib_limit; extern void set_initial_language (void); -extern struct partial_symtab *allocate_psymtab (char *, struct objfile *); +extern struct partial_symtab *allocate_psymtab (const char *, struct objfile *); extern void discard_psymtab (struct partial_symtab *); Index: symtab.h =================================================================== RCS file: /cvs/src/src/gdb/symtab.h,v retrieving revision 1.131 diff -u -p -r1.131 symtab.h --- symtab.h 5 Sep 2008 11:37:17 -0000 1.131 +++ symtab.h 19 Sep 2008 15:11:30 -0000 @@ -1274,7 +1274,7 @@ extern struct symtab_and_line find_funct extern void clear_symtab_users (void); -extern enum language deduce_language_from_filename (char *); +extern enum language deduce_language_from_filename (const char *); /* symtab.c */ --Boundary-00=_xM80I3/yvq/zLEO--