From: "André Pönitz" <apoenitz@trolltech.com>
To: drow@false.org
Cc: gdb-patches@sources.redhat.com
Subject: Re: gdb sources
Date: Fri, 19 Sep 2008 15:21:00 -0000 [thread overview]
Message-ID: <200809191720.17336.apoenitz@trolltech.com> (raw)
In-Reply-To: <20080919144422.GA32108@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]
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'
[-- Attachment #2: 2 --]
[-- Type: text/x-diff, Size: 5115 bytes --]
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 <apoenitz@trolltech.com>
+
+ * 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 <jan.kratochvil@redhat.com>
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 */
next prev parent reply other threads:[~2008-09-19 15:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200809121713.09226.apoenitz@trolltech.com>
[not found] ` <20080912153534.GA13672@caradoc.them.org>
2008-09-19 14:13 ` André Pönitz
2008-09-19 14:45 ` Daniel Jacobowitz
2008-09-19 15:21 ` André Pönitz [this message]
2008-09-19 15:26 ` Daniel Jacobowitz
2008-09-19 15:46 ` André Pönitz
2008-09-19 16:25 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809191720.17336.apoenitz@trolltech.com \
--to=apoenitz@trolltech.com \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox