* [rfc] Remove default_gcore_mach from gcore.c
@ 2008-01-17 9:20 Markus Deuling
2008-01-17 14:47 ` Ulrich Weigand
2008-01-17 21:48 ` Michael Snyder
0 siblings, 2 replies; 3+ messages in thread
From: Markus Deuling @ 2008-01-17 9:20 UTC (permalink / raw)
To: GDB Patches; +Cc: Ulrich Weigand
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
Hi,
this patch remvoes default_gcore_mach as it seems to be useless (always returns 0). I tested it on x86 and testsuite showed no
regressions. What do you think? Is this funtion still useful?
Ok to commit?
ChangeLog:
* gcore.c (default_gcore_mach): Remove.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-gcore --]
[-- Type: text/plain, Size: 1317 bytes --]
diff -urpN src/gdb/gcore.c dev/gdb/gcore.c
--- src/gdb/gcore.c 2008-01-01 23:53:09.000000000 +0100
+++ dev/gdb/gcore.c 2008-01-17 09:38:48.000000000 +0100
@@ -37,7 +37,6 @@
static char *default_gcore_target (void);
static enum bfd_architecture default_gcore_arch (void);
-static unsigned long default_gcore_mach (void);
static int gcore_memory_sections (bfd *);
/* Generate a core file from the inferior process. */
@@ -78,7 +77,6 @@ gcore_command (char *args, int from_tty)
old_chain = make_cleanup_bfd_close (obfd);
bfd_set_format (obfd, bfd_core);
- bfd_set_arch_mach (obfd, default_gcore_arch (), default_gcore_mach ());
/* An external target method must build the notes section. */
note_data = target_make_corefile_notes (obfd, ¬e_size);
@@ -118,24 +116,6 @@ gcore_command (char *args, int from_tty)
return;
}
-static unsigned long
-default_gcore_mach (void)
-{
-#if 1 /* See if this even matters... */
- return 0;
-#else
-
- const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (current_gdbarch);
-
- if (bfdarch != NULL)
- return bfdarch->mach;
- if (exec_bfd == NULL)
- error (_("Can't find default bfd machine type (need execfile)."));
-
- return bfd_get_mach (exec_bfd);
-#endif /* 1 */
-}
-
static enum bfd_architecture
default_gcore_arch (void)
{
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [rfc] Remove default_gcore_mach from gcore.c
2008-01-17 9:20 [rfc] Remove default_gcore_mach from gcore.c Markus Deuling
@ 2008-01-17 14:47 ` Ulrich Weigand
2008-01-17 21:48 ` Michael Snyder
1 sibling, 0 replies; 3+ messages in thread
From: Ulrich Weigand @ 2008-01-17 14:47 UTC (permalink / raw)
To: Markus Deuling; +Cc: GDB Patches
Markus Deuling wrote:
> bfd_set_format (obfd, bfd_core);
> - bfd_set_arch_mach (obfd, default_gcore_arch (), default_gcore_mach ());
This doesn't look right -- you're removing the whole call, which means
that not even the *arch* is now set in the generated core file ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfc] Remove default_gcore_mach from gcore.c
2008-01-17 9:20 [rfc] Remove default_gcore_mach from gcore.c Markus Deuling
2008-01-17 14:47 ` Ulrich Weigand
@ 2008-01-17 21:48 ` Michael Snyder
1 sibling, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2008-01-17 21:48 UTC (permalink / raw)
To: Markus Deuling; +Cc: GDB Patches, Ulrich Weigand
On Thu, 2008-01-17 at 10:15 +0100, Markus Deuling wrote:
> Hi,
>
> this patch remvoes default_gcore_mach as it seems to be useless (always returns 0). I tested it on x86 and testsuite showed no
> regressions. What do you think? Is this funtion still useful?
>
> Ok to commit?
I'd prefer you didn't remove it. It's a bit of unfinished
infrastructure, a place holder if you will.
The idea is to someday get the gcore command working on
more generic targets such as "target remote", so that
gdb can suck a corefile image out of them without any
particular help from the native system.
>
>
> ChangeLog:
>
> * gcore.c (default_gcore_mach): Remove.
>
>
> plain text document attachment (diff-gcore)
> diff -urpN src/gdb/gcore.c dev/gdb/gcore.c
> --- src/gdb/gcore.c 2008-01-01 23:53:09.000000000 +0100
> +++ dev/gdb/gcore.c 2008-01-17 09:38:48.000000000 +0100
> @@ -37,7 +37,6 @@
>
> static char *default_gcore_target (void);
> static enum bfd_architecture default_gcore_arch (void);
> -static unsigned long default_gcore_mach (void);
> static int gcore_memory_sections (bfd *);
>
> /* Generate a core file from the inferior process. */
> @@ -78,7 +77,6 @@ gcore_command (char *args, int from_tty)
> old_chain = make_cleanup_bfd_close (obfd);
>
> bfd_set_format (obfd, bfd_core);
> - bfd_set_arch_mach (obfd, default_gcore_arch (), default_gcore_mach ());
>
> /* An external target method must build the notes section. */
> note_data = target_make_corefile_notes (obfd, ¬e_size);
> @@ -118,24 +116,6 @@ gcore_command (char *args, int from_tty)
> return;
> }
>
> -static unsigned long
> -default_gcore_mach (void)
> -{
> -#if 1 /* See if this even matters... */
> - return 0;
> -#else
> -
> - const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (current_gdbarch);
> -
> - if (bfdarch != NULL)
> - return bfdarch->mach;
> - if (exec_bfd == NULL)
> - error (_("Can't find default bfd machine type (need execfile)."));
> -
> - return bfd_get_mach (exec_bfd);
> -#endif /* 1 */
> -}
> -
> static enum bfd_architecture
> default_gcore_arch (void)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-17 21:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-17 9:20 [rfc] Remove default_gcore_mach from gcore.c Markus Deuling
2008-01-17 14:47 ` Ulrich Weigand
2008-01-17 21:48 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox