* RFA: Make parse_frame_specification static, remove code duplication
@ 2005-08-05 15:56 Fred Fish
2005-08-05 17:39 ` Mark Kettenis
0 siblings, 1 reply; 2+ messages in thread
From: Fred Fish @ 2005-08-05 15:56 UTC (permalink / raw)
To: gdb-patches; +Cc: fnf
This patch turns a global function, that doesn't need to be global,
into a static function, and removes a couple of lines of code duplication
in stack.c.
-Fred
============================================================================
2005-08-02 Fred Fish <fnf@specifix.com>
* defs.h (parse_frame_specification): Remove prototype.
* stack.c (parse_frame_specification): Add prototype and
make function static.
(frame_info): Move common code outside if..then..else.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.188
diff -c -p -r1.188 defs.h
*** defs.h 2 Aug 2005 03:02:05 -0000 1.188
--- defs.h 5 Aug 2005 15:52:06 -0000
*************** extern void (*deprecated_show_load_progr
*** 1099,1105 ****
extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int line, int stopline,
int noerror);
- extern struct frame_info *parse_frame_specification (char *frame_exp);
extern int (*deprecated_query_hook) (const char *, va_list)
ATTRIBUTE_FPTR_PRINTF(1,0);
extern void (*deprecated_warning_hook) (const char *, va_list)
--- 1099,1104 ----
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.134
diff -c -p -r1.134 stack.c
*** stack.c 1 Aug 2005 18:32:51 -0000 1.134
--- stack.c 5 Aug 2005 15:52:06 -0000
*************** void _initialize_stack (void);
*** 60,65 ****
--- 60,67 ----
/* Prototypes for local functions. */
+ static struct frame_info *parse_frame_specification (char *frame_exp);
+
static void down_command (char *, int);
static void down_silently_base (char *);
*************** parse_frame_specification_1 (const char
*** 844,850 ****
error (_("Too many args in frame specification"));
}
! struct frame_info *
parse_frame_specification (char *frame_exp)
{
return parse_frame_specification_1 (frame_exp, NULL, NULL);
--- 846,852 ----
error (_("Too many args in frame specification"));
}
! static struct frame_info *
parse_frame_specification (char *frame_exp)
{
return parse_frame_specification_1 (frame_exp, NULL, NULL);
*************** frame_info (char *addr_exp, int from_tty
*** 932,946 ****
{
printf_filtered (_("Stack level %d, frame at "),
frame_relative_level (fi));
- deprecated_print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
- printf_filtered (":\n");
}
else
{
printf_filtered (_("Stack frame at "));
- deprecated_print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
- printf_filtered (":\n");
}
printf_filtered (" %s = ", pc_regname);
deprecated_print_address_numeric (get_frame_pc (fi), 1, gdb_stdout);
--- 934,946 ----
{
printf_filtered (_("Stack level %d, frame at "),
frame_relative_level (fi));
}
else
{
printf_filtered (_("Stack frame at "));
}
+ deprecated_print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
+ printf_filtered (":\n");
printf_filtered (" %s = ", pc_regname);
deprecated_print_address_numeric (get_frame_pc (fi), 1, gdb_stdout);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFA: Make parse_frame_specification static, remove code duplication
2005-08-05 15:56 RFA: Make parse_frame_specification static, remove code duplication Fred Fish
@ 2005-08-05 17:39 ` Mark Kettenis
0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2005-08-05 17:39 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches, fnf
From: Fred Fish <fnf@specifix.com>
Date: Fri, 5 Aug 2005 11:56:47 -0400
This patch turns a global function, that doesn't need to be global,
into a static function, and removes a couple of lines of code duplication
in stack.c.
2005-08-02 Fred Fish <fnf@specifix.com>
* defs.h (parse_frame_specification): Remove prototype.
* stack.c (parse_frame_specification): Add prototype and
make function static.
(frame_info): Move common code outside if..then..else.
Looks good to me.
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-05 17:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-05 15:56 RFA: Make parse_frame_specification static, remove code duplication Fred Fish
2005-08-05 17:39 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox