* [patch] Shorten lines of >= 80 columns.
@ 2011-01-04 19:10 Michael Snyder
2011-01-04 19:19 ` Pierre Muller
2011-01-04 19:27 ` Mark Kettenis
0 siblings, 2 replies; 9+ messages in thread
From: Michael Snyder @ 2011-01-04 19:10 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 76 bytes --]
I would like to propose that this type of change be regarded as "obvious".
[-- Attachment #2: 80col1.txt --]
[-- Type: text/plain, Size: 10551 bytes --]
2011-01-04 Michael Snyder <msnyder@vmware.com>
* addrmap.c: Shorten lines of >= 80 columns.
* arch-utils.c: Ditto.
* arch-utils.h: Ditto.
* ax-gdb.c: Ditto.
* ax-general.c: Ditto.
Index: addrmap.c
===================================================================
RCS file: /cvs/src/src/gdb/addrmap.c,v
retrieving revision 1.10
diff -u -p -r1.10 addrmap.c
--- addrmap.c 1 Jan 2011 15:32:56 -0000 1.10
+++ addrmap.c 4 Jan 2011 19:06:08 -0000
@@ -307,7 +307,8 @@ addrmap_node_set_value (splay_tree_node
static void
-addrmap_splay_tree_insert (struct addrmap_mutable *map, CORE_ADDR key, void *value)
+addrmap_splay_tree_insert (struct addrmap_mutable *map,
+ CORE_ADDR key, void *value)
{
splay_tree_insert (map->tree,
allocate_key (map, key),
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.191
diff -u -p -r1.191 arch-utils.c
--- arch-utils.c 1 Jan 2011 15:32:57 -0000 1.191
+++ arch-utils.c 4 Jan 2011 19:06:08 -0000
@@ -788,7 +788,8 @@ default_remote_breakpoint_from_pc (struc
/* */
-extern initialize_file_ftype _initialize_gdbarch_utils; /* -Wmissing-prototypes */
+/* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_gdbarch_utils;
void
_initialize_gdbarch_utils (void)
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.112
diff -u -p -r1.112 arch-utils.h
--- arch-utils.h 1 Jan 2011 15:32:57 -0000 1.112
+++ arch-utils.h 4 Jan 2011 19:06:08 -0000
@@ -51,8 +51,8 @@ extern void
/* Default implementation of gdbarch_displaced_hw_singlestep. */
extern int
- default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
- struct displaced_step_closure *closure);
+ default_displaced_step_hw_singlestep (struct gdbarch *,
+ struct displaced_step_closure *);
/* Possible value for gdbarch_displaced_step_location:
Place displaced instructions at the program's entry point,
@@ -74,7 +74,8 @@ extern int no_op_reg_to_regnum (struct g
/* Do nothing version of elf_make_msymbol_special. */
-void default_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym);
+void default_elf_make_msymbol_special (asymbol *sym,
+ struct minimal_symbol *msym);
/* Do nothing version of coff_make_msymbol_special. */
@@ -100,7 +101,8 @@ extern CORE_ADDR generic_skip_solib_reso
extern int generic_in_solib_return_trampoline (struct gdbarch *gdbarch,
CORE_ADDR pc, char *name);
-extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch,
+ CORE_ADDR pc);
/* By default, registers are not convertible. */
extern int generic_convert_register_p (struct gdbarch *gdbarch, int regnum,
Index: ax-gdb.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-gdb.c,v
retrieving revision 1.81
diff -u -p -r1.81 ax-gdb.c
--- ax-gdb.c 1 Jan 2011 15:32:57 -0000 1.81
+++ ax-gdb.c 4 Jan 2011 19:06:08 -0000
@@ -70,7 +70,8 @@ static struct value *const_var_ref (stru
static struct value *const_expr (union exp_element **pc);
static struct value *maybe_const_expr (union exp_element **pc);
-static void gen_traced_pop (struct gdbarch *, struct agent_expr *, struct axs_value *);
+static void gen_traced_pop (struct gdbarch *, struct agent_expr *,
+ struct axs_value *);
static void gen_sign_extend (struct agent_expr *, struct type *);
static void gen_extend (struct agent_expr *, struct type *);
@@ -632,8 +633,8 @@ gen_var_ref (struct gdbarch *gdbarch, st
break;
case LOC_CONST_BYTES:
- internal_error (__FILE__, __LINE__,
- _("gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
+ internal_error (__FILE__, __LINE__, _("\
+gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
/* Variable at a fixed location in memory. Easy. */
case LOC_STATIC:
@@ -1138,8 +1139,9 @@ gen_less (struct agent_expr *ax, struct
operator, used in error messages */
static void
gen_binop (struct agent_expr *ax, struct axs_value *value,
- struct axs_value *value1, struct axs_value *value2, enum agent_op op,
- enum agent_op op_unsigned, int may_carry, char *name)
+ struct axs_value *value1, struct axs_value *value2,
+ enum agent_op op, enum agent_op op_unsigned,
+ int may_carry, char *name)
{
/* We only handle INT op INT. */
if ((TYPE_CODE (value1->type) != TYPE_CODE_INT)
@@ -1447,7 +1449,8 @@ gen_struct_ref_recursive (struct express
{
gen_static_field (exp->gdbarch, ax, value, type, i);
if (value->optimized_out)
- error (_("static field `%s' has been optimized out, cannot use"),
+ error (_("\
+static field `%s' has been optimized out, cannot use"),
field);
return 1;
}
@@ -1469,7 +1472,8 @@ gen_struct_ref_recursive (struct express
struct type *basetype = check_typedef (TYPE_BASECLASS (type, i));
rslt = gen_struct_ref_recursive (exp, ax, value, field,
- offset + TYPE_BASECLASS_BITPOS (type, i) / TARGET_CHAR_BIT,
+ offset + TYPE_BASECLASS_BITPOS (type, i)
+ / TARGET_CHAR_BIT,
basetype);
if (rslt)
return 1;
@@ -1587,7 +1591,8 @@ gen_struct_elt_for_reference (struct exp
{
gen_static_field (exp->gdbarch, ax, value, t, i);
if (value->optimized_out)
- error (_("static field `%s' has been optimized out, cannot use"),
+ error (_("\
+static field `%s' has been optimized out, cannot use"),
fieldname);
return 1;
}
@@ -1706,7 +1711,8 @@ gen_repeat (struct expression *exp, unio
int length;
if (!v)
- error (_("Right operand of `@' must be a constant, in agent expressions."));
+ error (_("\
+Right operand of `@' must be a constant, in agent expressions."));
if (TYPE_CODE (value_type (v)) != TYPE_CODE_INT)
error (_("Right operand of `@' must be an integer."));
length = value_as_long (v);
@@ -1890,7 +1896,8 @@ gen_expr (struct expression *exp, union
ax_tsv (ax, aop_tracev, tsv->number);
}
else
- error (_("$%s is not a trace state variable, may not assign to it"), name);
+ error (_("\
+$%s is not a trace state variable, may not assign to it"), name);
}
else
error (_("May only assign to trace state variables"));
@@ -1925,7 +1932,8 @@ gen_expr (struct expression *exp, union
ax_tsv (ax, aop_tracev, tsv->number);
}
else
- error (_("$%s is not a trace state variable, may not assign to it"), name);
+ error (_("\
+$%s is not a trace state variable, may not assign to it"), name);
}
else
error (_("May only assign to trace state variables"));
@@ -2007,7 +2015,8 @@ gen_expr (struct expression *exp, union
value->type = builtin_type (exp->gdbarch)->builtin_long_long;
}
else
- error (_("$%s is not a trace state variable; GDB agent expressions cannot use convenience variables."), name);
+ error (_("$%s is not a trace state variable; GDB agent "
+ "expressions cannot use convenience variables."), name);
}
break;
@@ -2268,7 +2277,8 @@ cannot subscript requested type: cannot
}
if (!is_integral_type (value2->type))
- error (_("Argument to arithmetic operation not a number or boolean."));
+ error (_("\
+Argument to arithmetic operation not a number or boolean."));
gen_ptradd (ax, value, value1, value2);
gen_deref (ax, value);
@@ -2510,11 +2520,11 @@ void _initialize_ax_gdb (void);
void
_initialize_ax_gdb (void)
{
- add_cmd ("agent", class_maintenance, agent_command,
- _("Translate an expression into remote agent bytecode for tracing."),
+ add_cmd ("agent", class_maintenance, agent_command, _("\
+Translate an expression into remote agent bytecode for tracing."),
&maintenancelist);
- add_cmd ("agent-eval", class_maintenance, agent_eval_command,
- _("Translate an expression into remote agent bytecode for evaluation."),
+ add_cmd ("agent-eval", class_maintenance, agent_eval_command, _("\
+Translate an expression into remote agent bytecode for evaluation."),
&maintenancelist);
}
Index: ax-general.c
===================================================================
RCS file: /cvs/src/src/gdb/ax-general.c,v
retrieving revision 1.22
diff -u -p -r1.22 ax-general.c
--- ax-general.c 1 Jan 2011 15:32:57 -0000 1.22
+++ ax-general.c 4 Jan 2011 19:06:08 -0000
@@ -154,7 +154,8 @@ generic_ext (struct agent_expr *x, enum
error (_("GDB bug: ax-general.c (generic_ext): bit count out of range"));
/* That had better be enough range. */
if (sizeof (LONGEST) * 8 > 255)
- error (_("GDB bug: ax-general.c (generic_ext): opcode has inadequate range"));
+ error (_("\
+GDB bug: ax-general.c (generic_ext): opcode has inadequate range"));
grow_expr (x, 2);
x->buf[x->len++] = op;
@@ -184,7 +185,8 @@ ax_trace_quick (struct agent_expr *x, in
{
/* N must fit in a byte. */
if (n < 0 || n > 255)
- error (_("GDB bug: ax-general.c (ax_trace_quick): size out of range for trace_quick"));
+ error (_("\
+GDB bug: ax-general.c (ax_trace_quick): size out of range for trace_quick"));
grow_expr (x, 2);
x->buf[x->len++] = aop_trace_quick;
@@ -265,7 +267,8 @@ void
ax_const_d (struct agent_expr *x, LONGEST d)
{
/* FIXME: floating-point support not present yet. */
- error (_("GDB bug: ax-general.c (ax_const_d): floating point not supported yet"));
+ error (_("\
+GDB bug: ax-general.c (ax_const_d): floating point not supported yet"));
}
@@ -289,7 +292,8 @@ ax_reg (struct agent_expr *x, int reg)
{
/* Make sure the register number is in range. */
if (reg < 0 || reg > 0xffff)
- error (_("GDB bug: ax-general.c (ax_reg): register number out of range"));
+ error (_("\
+GDB bug: ax-general.c (ax_reg): register number out of range"));
grow_expr (x, 3);
x->buf[x->len] = aop_reg;
x->buf[x->len + 1] = (reg >> 8) & 0xff;
@@ -305,7 +309,8 @@ ax_tsv (struct agent_expr *x, enum agent
{
/* Make sure the tsv number is in range. */
if (num < 0 || num > 0xffff)
- internal_error (__FILE__, __LINE__, _("ax-general.c (ax_tsv): variable number is %d, out of range"), num);
+ internal_error (__FILE__, __LINE__, _("\
+ax-general.c (ax_tsv): variable number is %d, out of range"), num);
grow_expr (x, 3);
x->buf[x->len] = op;
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [patch] Shorten lines of >= 80 columns.
2011-01-04 19:10 [patch] Shorten lines of >= 80 columns Michael Snyder
@ 2011-01-04 19:19 ` Pierre Muller
2011-01-04 20:00 ` Michael Snyder
2011-01-04 19:27 ` Mark Kettenis
1 sibling, 1 reply; 9+ messages in thread
From: Pierre Muller @ 2011-01-04 19:19 UTC (permalink / raw)
To: 'Michael Snyder', gdb-patches
I thought that they were already considered as obvious,
but I still have a remark about one of your
changes:
@@ -632,8 +633,8 @@ gen_var_ref (struct gdbarch *gdbarch, st
break;
case LOC_CONST_BYTES:
- internal_error (__FILE__, __LINE__,
- _("gen_var_ref: LOC_CONST_BYTES symbols are not
supported"));
+ internal_error (__FILE__, __LINE__, _("\
+gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
I think this kind of changes confuses cvs
for the 'cvs diff -u -p':
it might regard the new line
+gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
as a new starting function line and
report a wrong function name...
Of course not really for your example here,
as the start of the line is
the name of the function itself...
But I remember having seen
wrong function name reported with 'cvs -u -p'
due to the use of '_("\'
construct which force starting next line without
spaces...
Pierre Muller
GDB pascal language maintainer
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Michael Snyder
> Envoyé : mardi 4 janvier 2011 20:10
> À : gdb-patches@sourceware.org
> Objet : [patch] Shorten lines of >= 80 columns.
>
> I would like to propose that this type of change be regarded as
> "obvious".
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch] Shorten lines of >= 80 columns.
2011-01-04 19:19 ` Pierre Muller
@ 2011-01-04 20:00 ` Michael Snyder
2011-01-05 9:02 ` Pierre Muller
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2011-01-04 20:00 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
Pierre Muller wrote:
> I thought that they were already considered as obvious,
> but I still have a remark about one of your
> changes:
>
> @@ -632,8 +633,8 @@ gen_var_ref (struct gdbarch *gdbarch, st
> break;
>
> case LOC_CONST_BYTES:
> - internal_error (__FILE__, __LINE__,
> - _("gen_var_ref: LOC_CONST_BYTES symbols are not
> supported"));
> + internal_error (__FILE__, __LINE__, _("\
> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>
> I think this kind of changes confuses cvs
> for the 'cvs diff -u -p':
> it might regard the new line
> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
> as a new starting function line and
> report a wrong function name...
> Of course not really for your example here,
> as the start of the line is
> the name of the function itself...
> But I remember having seen
> wrong function name reported with 'cvs -u -p'
> due to the use of '_("\'
> construct which force starting next line without
> spaces...
>
> Pierre Muller
> GDB pascal language maintainer
Hmmm... well, we already have tons of similar constructs in the tree.
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [patch] Shorten lines of >= 80 columns.
2011-01-04 20:00 ` Michael Snyder
@ 2011-01-05 9:02 ` Pierre Muller
2011-01-05 18:25 ` Michael Snyder
0 siblings, 1 reply; 9+ messages in thread
From: Pierre Muller @ 2011-01-05 9:02 UTC (permalink / raw)
To: 'Michael Snyder'; +Cc: gdb-patches
> > case LOC_CONST_BYTES:
> > - internal_error (__FILE__, __LINE__,
> > - _("gen_var_ref: LOC_CONST_BYTES symbols are not
> > supported"));
> > + internal_error (__FILE__, __LINE__, _("\
> > +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
> >
> > I think this kind of changes confuses cvs
> > for the 'cvs diff -u -p':
> > it might regard the new line
> > +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
> > as a new starting function line and
> > report a wrong function name...
> > Of course not really for your example here,
> > as the start of the line is
> > the name of the function itself...
> > But I remember having seen
> > wrong function name reported with 'cvs -u -p'
> > due to the use of '_("\'
> > construct which force starting next line without
> > spaces...
> >
> > Pierre Muller
> > GDB pascal language maintainer
>
>
> Hmmm... well, we already have tons of similar constructs in the tree.
Yes, I know, and it should of course not
retard your commit.
I was just wondering if we could try to avoid
those construct in the future, but I am not sure there is a
simple solution...
In general, I was wondering if we could use
,_(
"gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
instead of
,_("\
gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
at least for case that are shorter than 80 - 5(2'"'+2')'+1';') chars?
But this might be against GNU coding style.
Pierre Muller
GDB pascal language maintainer
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch] Shorten lines of >= 80 columns.
2011-01-05 9:02 ` Pierre Muller
@ 2011-01-05 18:25 ` Michael Snyder
2011-01-05 21:38 ` Michael Snyder
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2011-01-05 18:25 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
Pierre Muller wrote:
>>> case LOC_CONST_BYTES:
>>> - internal_error (__FILE__, __LINE__,
>>> - _("gen_var_ref: LOC_CONST_BYTES symbols are not
>>> supported"));
>>> + internal_error (__FILE__, __LINE__, _("\
>>> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>>>
>>> I think this kind of changes confuses cvs
>>> for the 'cvs diff -u -p':
>>> it might regard the new line
>>> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>>> as a new starting function line and
>>> report a wrong function name...
>>> Of course not really for your example here,
>>> as the start of the line is
>>> the name of the function itself...
>>> But I remember having seen
>>> wrong function name reported with 'cvs -u -p'
>>> due to the use of '_("\'
>>> construct which force starting next line without
>>> spaces...
>>>
>>> Pierre Muller
>>> GDB pascal language maintainer
>>
>> Hmmm... well, we already have tons of similar constructs in the tree.
>
> Yes, I know, and it should of course not
> retard your commit.
No, I'm concerned about it. If I can see a "nice" solution, I will
make changes.
> I was just wondering if we could try to avoid
> those construct in the future, but I am not sure there is a
> simple solution...
>
> In general, I was wondering if we could use
> ,_(
> "gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
> instead of
> ,_("\
> gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>
> at least for case that are shorter than 80 - 5(2'"'+2')'+1';') chars?
> But this might be against GNU coding style.
The trouble with that is that emacs will not indent it that way.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch] Shorten lines of >= 80 columns.
2011-01-05 18:25 ` Michael Snyder
@ 2011-01-05 21:38 ` Michael Snyder
2011-01-06 4:32 ` Joel Brobecker
0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2011-01-05 21:38 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
Michael Snyder wrote:
> Pierre Muller wrote:
>>>> case LOC_CONST_BYTES:
>>>> - internal_error (__FILE__, __LINE__,
>>>> - _("gen_var_ref: LOC_CONST_BYTES symbols are not
>>>> supported"));
>>>> + internal_error (__FILE__, __LINE__, _("\
>>>> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>>>>
>>>> I think this kind of changes confuses cvs
>>>> for the 'cvs diff -u -p':
>>>> it might regard the new line
>>>> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>>>> as a new starting function line and
>>>> report a wrong function name...
>>>> Of course not really for your example here,
>>>> as the start of the line is
>>>> the name of the function itself...
>>>> But I remember having seen
>>>> wrong function name reported with 'cvs -u -p'
>>>> due to the use of '_("\'
>>>> construct which force starting next line without
>>>> spaces...
>>>>
>>>> Pierre Muller
>>>> GDB pascal language maintainer
>>> Hmmm... well, we already have tons of similar constructs in the tree.
>> Yes, I know, and it should of course not
>> retard your commit.
>
> No, I'm concerned about it. If I can see a "nice" solution, I will
> make changes.
>
>> I was just wondering if we could try to avoid
>> those construct in the future, but I am not sure there is a
>> simple solution...
>>
>> In general, I was wondering if we could use
>> ,_(
>> "gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>> instead of
>> ,_("\
>> gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>>
>> at least for case that are shorter than 80 - 5(2'"'+2')'+1';') chars?
>> But this might be against GNU coding style.
>
> The trouble with that is that emacs will not indent it that way.
Got it. I can split this up like this:
internal_error (__FILE__, __LINE__,
_("gen_var_ref: LOC_CONST_BYTES "
"symbols are not supported"));
Submission to follow after final regression test.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch] Shorten lines of >= 80 columns.
2011-01-05 21:38 ` Michael Snyder
@ 2011-01-06 4:32 ` Joel Brobecker
2011-01-06 18:05 ` Michael Snyder
0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2011-01-06 4:32 UTC (permalink / raw)
To: Michael Snyder; +Cc: Pierre Muller, gdb-patches
> internal_error (__FILE__, __LINE__,
> _("gen_var_ref: LOC_CONST_BYTES "
> "symbols are not supported"));
For one-line strings, I think that's an acceptable solution. In fact,
this might be a better solution, making the code as a whole more
readable (because it avoids the misindentation of the string that breaks
the formatting of the code as a whole).
For multi-line strings, such as help strings, etc, I think it will be
easier to still use the style that you originally chose. For instance:
| warning (_("\
| Private mapping of shared library text was not specified\n\
| by the executable; setting a breakpoint in a shared library which\n\
| is not privately mapped will not work. See the HP-UX 11i v3 chatr\n\
| manpage for methods to privately map shared library text."));
I think that, for multi-line strings, this makes easier to read the
entire text, and it also makes it easier to make sure that the string
is of reasonable size (ie, under 80, or 76, or 74).
The typical case where these are used are the _init routines, where
we create new commands. The help strings can easily need to have
more than one line (if it was me, I would put as much information
in the help command as in the manual).
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [patch] Shorten lines of >= 80 columns.
2011-01-06 4:32 ` Joel Brobecker
@ 2011-01-06 18:05 ` Michael Snyder
0 siblings, 0 replies; 9+ messages in thread
From: Michael Snyder @ 2011-01-06 18:05 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Pierre Muller, gdb-patches
Joel Brobecker wrote:
>> internal_error (__FILE__, __LINE__,
>> _("gen_var_ref: LOC_CONST_BYTES "
>> "symbols are not supported"));
>
> For one-line strings, I think that's an acceptable solution. In fact,
> this might be a better solution, making the code as a whole more
> readable (because it avoids the misindentation of the string that breaks
> the formatting of the code as a whole).
>
> For multi-line strings, such as help strings, etc, I think it will be
> easier to still use the style that you originally chose. For instance:
>
> | warning (_("\
> | Private mapping of shared library text was not specified\n\
> | by the executable; setting a breakpoint in a shared library which\n\
> | is not privately mapped will not work. See the HP-UX 11i v3 chatr\n\
> | manpage for methods to privately map shared library text."));
>
> I think that, for multi-line strings, this makes easier to read the
> entire text, and it also makes it easier to make sure that the string
> is of reasonable size (ie, under 80, or 76, or 74).
>
> The typical case where these are used are the _init routines, where
> we create new commands. The help strings can easily need to have
> more than one line (if it was me, I would put as much information
> in the help command as in the manual).
Yeah, you're right. I'll try to put some of them back.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [patch] Shorten lines of >= 80 columns.
2011-01-04 19:10 [patch] Shorten lines of >= 80 columns Michael Snyder
2011-01-04 19:19 ` Pierre Muller
@ 2011-01-04 19:27 ` Mark Kettenis
1 sibling, 0 replies; 9+ messages in thread
From: Mark Kettenis @ 2011-01-04 19:27 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches
> Date: Tue, 04 Jan 2011 11:10:01 -0800
> From: Michael Snyder <msnyder@vmware.com>
>
> I would like to propose that this type of change be regarded as "obvious".
yes ;)
> 2011-01-04 Michael Snyder <msnyder@vmware.com>
>
> * addrmap.c: Shorten lines of >= 80 columns.
> * arch-utils.c: Ditto.
> * arch-utils.h: Ditto.
> * ax-gdb.c: Ditto.
> * ax-general.c: Ditto.
>
> Index: addrmap.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/addrmap.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 addrmap.c
> --- addrmap.c 1 Jan 2011 15:32:56 -0000 1.10
> +++ addrmap.c 4 Jan 2011 19:06:08 -0000
> @@ -307,7 +307,8 @@ addrmap_node_set_value (splay_tree_node
>
>
> static void
> -addrmap_splay_tree_insert (struct addrmap_mutable *map, CORE_ADDR key, void *value)
> +addrmap_splay_tree_insert (struct addrmap_mutable *map,
> + CORE_ADDR key, void *value)
> {
> splay_tree_insert (map->tree,
> allocate_key (map, key),
> Index: arch-utils.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/arch-utils.c,v
> retrieving revision 1.191
> diff -u -p -r1.191 arch-utils.c
> --- arch-utils.c 1 Jan 2011 15:32:57 -0000 1.191
> +++ arch-utils.c 4 Jan 2011 19:06:08 -0000
> @@ -788,7 +788,8 @@ default_remote_breakpoint_from_pc (struc
>
> /* */
>
> -extern initialize_file_ftype _initialize_gdbarch_utils; /* -Wmissing-prototypes */
> +/* -Wmissing-prototypes */
> +extern initialize_file_ftype _initialize_gdbarch_utils;
>
> void
> _initialize_gdbarch_utils (void)
> Index: arch-utils.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/arch-utils.h,v
> retrieving revision 1.112
> diff -u -p -r1.112 arch-utils.h
> --- arch-utils.h 1 Jan 2011 15:32:57 -0000 1.112
> +++ arch-utils.h 4 Jan 2011 19:06:08 -0000
> @@ -51,8 +51,8 @@ extern void
>
> /* Default implementation of gdbarch_displaced_hw_singlestep. */
> extern int
> - default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
> - struct displaced_step_closure *closure);
> + default_displaced_step_hw_singlestep (struct gdbarch *,
> + struct displaced_step_closure *);
>
> /* Possible value for gdbarch_displaced_step_location:
> Place displaced instructions at the program's entry point,
> @@ -74,7 +74,8 @@ extern int no_op_reg_to_regnum (struct g
>
> /* Do nothing version of elf_make_msymbol_special. */
>
> -void default_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym);
> +void default_elf_make_msymbol_special (asymbol *sym,
> + struct minimal_symbol *msym);
>
> /* Do nothing version of coff_make_msymbol_special. */
>
> @@ -100,7 +101,8 @@ extern CORE_ADDR generic_skip_solib_reso
> extern int generic_in_solib_return_trampoline (struct gdbarch *gdbarch,
> CORE_ADDR pc, char *name);
>
> -extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc);
> +extern int generic_in_function_epilogue_p (struct gdbarch *gdbarch,
> + CORE_ADDR pc);
>
> /* By default, registers are not convertible. */
> extern int generic_convert_register_p (struct gdbarch *gdbarch, int regnum,
> Index: ax-gdb.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ax-gdb.c,v
> retrieving revision 1.81
> diff -u -p -r1.81 ax-gdb.c
> --- ax-gdb.c 1 Jan 2011 15:32:57 -0000 1.81
> +++ ax-gdb.c 4 Jan 2011 19:06:08 -0000
> @@ -70,7 +70,8 @@ static struct value *const_var_ref (stru
> static struct value *const_expr (union exp_element **pc);
> static struct value *maybe_const_expr (union exp_element **pc);
>
> -static void gen_traced_pop (struct gdbarch *, struct agent_expr *, struct axs_value *);
> +static void gen_traced_pop (struct gdbarch *, struct agent_expr *,
> + struct axs_value *);
>
> static void gen_sign_extend (struct agent_expr *, struct type *);
> static void gen_extend (struct agent_expr *, struct type *);
> @@ -632,8 +633,8 @@ gen_var_ref (struct gdbarch *gdbarch, st
> break;
>
> case LOC_CONST_BYTES:
> - internal_error (__FILE__, __LINE__,
> - _("gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
> + internal_error (__FILE__, __LINE__, _("\
> +gen_var_ref: LOC_CONST_BYTES symbols are not supported"));
>
> /* Variable at a fixed location in memory. Easy. */
> case LOC_STATIC:
> @@ -1138,8 +1139,9 @@ gen_less (struct agent_expr *ax, struct
> operator, used in error messages */
> static void
> gen_binop (struct agent_expr *ax, struct axs_value *value,
> - struct axs_value *value1, struct axs_value *value2, enum agent_op op,
> - enum agent_op op_unsigned, int may_carry, char *name)
> + struct axs_value *value1, struct axs_value *value2,
> + enum agent_op op, enum agent_op op_unsigned,
> + int may_carry, char *name)
> {
> /* We only handle INT op INT. */
> if ((TYPE_CODE (value1->type) != TYPE_CODE_INT)
> @@ -1447,7 +1449,8 @@ gen_struct_ref_recursive (struct express
> {
> gen_static_field (exp->gdbarch, ax, value, type, i);
> if (value->optimized_out)
> - error (_("static field `%s' has been optimized out, cannot use"),
> + error (_("\
> +static field `%s' has been optimized out, cannot use"),
> field);
> return 1;
> }
> @@ -1469,7 +1472,8 @@ gen_struct_ref_recursive (struct express
> struct type *basetype = check_typedef (TYPE_BASECLASS (type, i));
>
> rslt = gen_struct_ref_recursive (exp, ax, value, field,
> - offset + TYPE_BASECLASS_BITPOS (type, i) / TARGET_CHAR_BIT,
> + offset + TYPE_BASECLASS_BITPOS (type, i)
> + / TARGET_CHAR_BIT,
> basetype);
> if (rslt)
> return 1;
> @@ -1587,7 +1591,8 @@ gen_struct_elt_for_reference (struct exp
> {
> gen_static_field (exp->gdbarch, ax, value, t, i);
> if (value->optimized_out)
> - error (_("static field `%s' has been optimized out, cannot use"),
> + error (_("\
> +static field `%s' has been optimized out, cannot use"),
> fieldname);
> return 1;
> }
> @@ -1706,7 +1711,8 @@ gen_repeat (struct expression *exp, unio
> int length;
>
> if (!v)
> - error (_("Right operand of `@' must be a constant, in agent expressions."));
> + error (_("\
> +Right operand of `@' must be a constant, in agent expressions."));
> if (TYPE_CODE (value_type (v)) != TYPE_CODE_INT)
> error (_("Right operand of `@' must be an integer."));
> length = value_as_long (v);
> @@ -1890,7 +1896,8 @@ gen_expr (struct expression *exp, union
> ax_tsv (ax, aop_tracev, tsv->number);
> }
> else
> - error (_("$%s is not a trace state variable, may not assign to it"), name);
> + error (_("\
> +$%s is not a trace state variable, may not assign to it"), name);
> }
> else
> error (_("May only assign to trace state variables"));
> @@ -1925,7 +1932,8 @@ gen_expr (struct expression *exp, union
> ax_tsv (ax, aop_tracev, tsv->number);
> }
> else
> - error (_("$%s is not a trace state variable, may not assign to it"), name);
> + error (_("\
> +$%s is not a trace state variable, may not assign to it"), name);
> }
> else
> error (_("May only assign to trace state variables"));
> @@ -2007,7 +2015,8 @@ gen_expr (struct expression *exp, union
> value->type = builtin_type (exp->gdbarch)->builtin_long_long;
> }
> else
> - error (_("$%s is not a trace state variable; GDB agent expressions cannot use convenience variables."), name);
> + error (_("$%s is not a trace state variable; GDB agent "
> + "expressions cannot use convenience variables."), name);
> }
> break;
>
> @@ -2268,7 +2277,8 @@ cannot subscript requested type: cannot
> }
>
> if (!is_integral_type (value2->type))
> - error (_("Argument to arithmetic operation not a number or boolean."));
> + error (_("\
> +Argument to arithmetic operation not a number or boolean."));
>
> gen_ptradd (ax, value, value1, value2);
> gen_deref (ax, value);
> @@ -2510,11 +2520,11 @@ void _initialize_ax_gdb (void);
> void
> _initialize_ax_gdb (void)
> {
> - add_cmd ("agent", class_maintenance, agent_command,
> - _("Translate an expression into remote agent bytecode for tracing."),
> + add_cmd ("agent", class_maintenance, agent_command, _("\
> +Translate an expression into remote agent bytecode for tracing."),
> &maintenancelist);
>
> - add_cmd ("agent-eval", class_maintenance, agent_eval_command,
> - _("Translate an expression into remote agent bytecode for evaluation."),
> + add_cmd ("agent-eval", class_maintenance, agent_eval_command, _("\
> +Translate an expression into remote agent bytecode for evaluation."),
> &maintenancelist);
> }
> Index: ax-general.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ax-general.c,v
> retrieving revision 1.22
> diff -u -p -r1.22 ax-general.c
> --- ax-general.c 1 Jan 2011 15:32:57 -0000 1.22
> +++ ax-general.c 4 Jan 2011 19:06:08 -0000
> @@ -154,7 +154,8 @@ generic_ext (struct agent_expr *x, enum
> error (_("GDB bug: ax-general.c (generic_ext): bit count out of range"));
> /* That had better be enough range. */
> if (sizeof (LONGEST) * 8 > 255)
> - error (_("GDB bug: ax-general.c (generic_ext): opcode has inadequate range"));
> + error (_("\
> +GDB bug: ax-general.c (generic_ext): opcode has inadequate range"));
>
> grow_expr (x, 2);
> x->buf[x->len++] = op;
> @@ -184,7 +185,8 @@ ax_trace_quick (struct agent_expr *x, in
> {
> /* N must fit in a byte. */
> if (n < 0 || n > 255)
> - error (_("GDB bug: ax-general.c (ax_trace_quick): size out of range for trace_quick"));
> + error (_("\
> +GDB bug: ax-general.c (ax_trace_quick): size out of range for trace_quick"));
>
> grow_expr (x, 2);
> x->buf[x->len++] = aop_trace_quick;
> @@ -265,7 +267,8 @@ void
> ax_const_d (struct agent_expr *x, LONGEST d)
> {
> /* FIXME: floating-point support not present yet. */
> - error (_("GDB bug: ax-general.c (ax_const_d): floating point not supported yet"));
> + error (_("\
> +GDB bug: ax-general.c (ax_const_d): floating point not supported yet"));
> }
>
>
> @@ -289,7 +292,8 @@ ax_reg (struct agent_expr *x, int reg)
> {
> /* Make sure the register number is in range. */
> if (reg < 0 || reg > 0xffff)
> - error (_("GDB bug: ax-general.c (ax_reg): register number out of range"));
> + error (_("\
> +GDB bug: ax-general.c (ax_reg): register number out of range"));
> grow_expr (x, 3);
> x->buf[x->len] = aop_reg;
> x->buf[x->len + 1] = (reg >> 8) & 0xff;
> @@ -305,7 +309,8 @@ ax_tsv (struct agent_expr *x, enum agent
> {
> /* Make sure the tsv number is in range. */
> if (num < 0 || num > 0xffff)
> - internal_error (__FILE__, __LINE__, _("ax-general.c (ax_tsv): variable number is %d, out of range"), num);
> + internal_error (__FILE__, __LINE__, _("\
> +ax-general.c (ax_tsv): variable number is %d, out of range"), num);
>
> grow_expr (x, 3);
> x->buf[x->len] = op;
>
> --------------040907020103030700010102--
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-01-06 18:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-04 19:10 [patch] Shorten lines of >= 80 columns Michael Snyder
2011-01-04 19:19 ` Pierre Muller
2011-01-04 20:00 ` Michael Snyder
2011-01-05 9:02 ` Pierre Muller
2011-01-05 18:25 ` Michael Snyder
2011-01-05 21:38 ` Michael Snyder
2011-01-06 4:32 ` Joel Brobecker
2011-01-06 18:05 ` Michael Snyder
2011-01-04 19:27 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox