Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Fwd: gcore for netbsd]
@ 2002-08-04 11:02 Andrew Cagney
  2002-08-05 16:13 ` Michael Snyder
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2002-08-04 11:02 UTC (permalink / raw)
  To: gdb-patches, Michael Snyder; +Cc: lha

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

Hello,

This patch has made me wonder why gcore even includes <sys/procfs.h>.
Can anyone think of a reason for not simply removing the include?

--

I'm also wondering what the function preempt_derive_stack_segment() is 
for.  I can't find any callers.

Andrew

[-- Attachment #2: gcore for netbsd --]
[-- Type: message/rfc822, Size: 3086 bytes --]

From: Love <lha@stacken.kth.se>
To: gdb@sources.redhat.com
Subject: gcore for netbsd
Date: 16 Jul 2002 03:35:47 +0200
Message-ID: <amd6totpxo.fsf@sul.e.kth.se>


Hi

I've added gcore support for netbsd, the core writing support need some
more work (like adding more stuff to the elf notes in the netbsd core file)

One simple thing you can do for me is to protect the <sys/procfs.h> in
gcore.c like its done in other files so its possible to include gcore.c on
platforms that doesn't have <sys/procfs.h>.

Love

Index: gcore.c
===================================================================
RCS file: /cvs/src/src/gdb/gcore.c,v
retrieving revision 1.5
diff -u -u -w -r1.5 gcore.c
--- gcore.c	12 Apr 2002 23:09:48 -0000	1.5
+++ gcore.c	16 Jul 2002 01:30:03 -0000
@@ -23,7 +23,9 @@
 #include "inferior.h"
 #include "gdbcore.h"
 #include "elf-bfd.h"
+#ifdef HAVE_SYS_PROCFS_H
 #include <sys/procfs.h>
+#endif
 #include "symfile.h"
 #include "objfiles.h"
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Fwd: gcore for netbsd]
  2002-08-04 11:02 [Fwd: gcore for netbsd] Andrew Cagney
@ 2002-08-05 16:13 ` Michael Snyder
  2002-08-05 21:19   ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2002-08-05 16:13 UTC (permalink / raw)
  To: gdb-patches, cagney

Andrew Cagney wrote:
> 
> Hello,
> 
> This patch has made me wonder why gcore even includes <sys/procfs.h>.

I'm guessing it went in before I split some code out into linux-proc.c.


> Can anyone think of a reason for not simply removing the include?
	
Try it and see...

> I'm also wondering what the function preempt_derive_stack_segment() is
> for.  I can't find any callers.

Probably for future use -- for systems where the default method didn't 
work, or where there was a more efficient method available.


>   ------------------------------------------------------------------------
> 
> Subject: gcore for netbsd
> Date: 16 Jul 2002 03:35:47 +0200
> From: Love <lha@stacken.kth.se>
> To: gdb@sources.redhat.com
> 
> Hi
> 
> I've added gcore support for netbsd, the core writing support need some
> more work (like adding more stuff to the elf notes in the netbsd core file)
> 
> One simple thing you can do for me is to protect the <sys/procfs.h> in
> gcore.c like its done in other files so its possible to include gcore.c on
> platforms that doesn't have <sys/procfs.h>.
> 
> Love
> 
> Index: gcore.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gcore.c,v
> retrieving revision 1.5
> diff -u -u -w -r1.5 gcore.c
> --- gcore.c     12 Apr 2002 23:09:48 -0000      1.5
> +++ gcore.c     16 Jul 2002 01:30:03 -0000
> @@ -23,7 +23,9 @@
>  #include "inferior.h"
>  #include "gdbcore.h"
>  #include "elf-bfd.h"
> +#ifdef HAVE_SYS_PROCFS_H
>  #include <sys/procfs.h>
> +#endif
>  #include "symfile.h"
>  #include "objfiles.h"
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Fwd: gcore for netbsd]
  2002-08-05 16:13 ` Michael Snyder
@ 2002-08-05 21:19   ` Andrew Cagney
  2002-08-05 21:39     ` Michael Snyder
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2002-08-05 21:19 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches, cagney

> Andrew Cagney wrote:
> 
>> 
>> Hello,
>> 
>> This patch has made me wonder why gcore even includes <sys/procfs.h>.
> 
> 
> I'm guessing it went in before I split some code out into linux-proc.c.
> 
> 
> 
>> Can anyone think of a reason for not simply removing the include?
> 
> 	
> Try it and see...

Going going ....

>> I'm also wondering what the function preempt_derive_stack_segment() is
>> for.  I can't find any callers.
> 
> 
> Probably for future use -- for systems where the default method didn't 
> work, or where there was a more efficient method available.

It can't be a global though.  That is going to be very multi-arch / 
multi-target unfriendly.

Mind if that gets removed as well?  As it is, it is wrong.

Andrew


>>   ------------------------------------------------------------------------
>> 
>> Subject: gcore for netbsd
>> Date: 16 Jul 2002 03:35:47 +0200
>> From: Love <lha@stacken.kth.se>
>> To: gdb@sources.redhat.com
>> 
>> Hi
>> 
>> I've added gcore support for netbsd, the core writing support need some
>> more work (like adding more stuff to the elf notes in the netbsd core file)
>> 
>> One simple thing you can do for me is to protect the <sys/procfs.h> in
>> gcore.c like its done in other files so its possible to include gcore.c on
>> platforms that doesn't have <sys/procfs.h>.
>> 
>> Love
>> 
>> Index: gcore.c
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/gcore.c,v
>> retrieving revision 1.5
>> diff -u -u -w -r1.5 gcore.c
>> --- gcore.c     12 Apr 2002 23:09:48 -0000      1.5
>> +++ gcore.c     16 Jul 2002 01:30:03 -0000
>> @@ -23,7 +23,9 @@
>>  #include "inferior.h"
>>  #include "gdbcore.h"
>>  #include "elf-bfd.h"
>> +#ifdef HAVE_SYS_PROCFS_H
>>  #include <sys/procfs.h>
>> +#endif
>>  #include "symfile.h"
>>  #include "objfiles.h"
>>
> 
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Fwd: gcore for netbsd]
  2002-08-05 21:19   ` Andrew Cagney
@ 2002-08-05 21:39     ` Michael Snyder
  2002-08-06  8:53       ` Andrew Cagney
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2002-08-05 21:39 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney wrote:
> 
> > Andrew Cagney wrote:
> >
> >>
> >> Hello,
> >>
> >> This patch has made me wonder why gcore even includes <sys/procfs.h>.
> >
> >
> > I'm guessing it went in before I split some code out into linux-proc.c.
> >
> >
> >
> >> Can anyone think of a reason for not simply removing the include?
> >
> >
> > Try it and see...
> 
> Going going ....
> 
> >> I'm also wondering what the function preempt_derive_stack_segment() is
> >> for.  I can't find any callers.
> >
> >
> > Probably for future use -- for systems where the default method didn't
> > work, or where there was a more efficient method available.
> 
> It can't be a global though.  That is going to be very multi-arch /
> multi-target unfriendly.
> 
> Mind if that gets removed as well?  As it is, it is wrong.

Sure, go ahead.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Fwd: gcore for netbsd]
  2002-08-05 21:39     ` Michael Snyder
@ 2002-08-06  8:53       ` Andrew Cagney
  2002-08-06 10:39         ` Love
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cagney @ 2002-08-06  8:53 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 53 bytes --]

I've checked the attached in (first bit :-).

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1354 bytes --]

2002-08-06  Andrew Cagney  <ac131313@redhat.com>

	* gcore.c: Do not include <sys/procfs.h>.
	* Makefile.in (gcore.o): Update dependencies.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.233
diff -u -r1.233 Makefile.in
--- Makefile.in	5 Aug 2002 16:17:41 -0000	1.233
+++ Makefile.in	6 Aug 2002 15:51:34 -0000
@@ -1404,8 +1404,8 @@
 corelow.o: corelow.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
 	$(target_h) $(gdbthread_h) $(gdb_string_h) $(regcache_h)
 
-gcore.o: gcore.c $(defs_h) $(command_h) $(inferior_h) $(gdbcore_h) \
-	$(BFD_SRC)/elf-bfd.h $(symfile_h) $(objfiles_h) 
+gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
+	$(elf_bfd_h) $(symfile_h) $(objfiles_h)
 
 linux-proc.o: linux-proc.c $(defs_h) $(inferior_h) $(regcache_h) $(gregset_h) \
 	$(gdbcore_h) $(gdbthread_h) $(elf_bfd_h) $(cli_decode_h) \
Index: gcore.c
===================================================================
RCS file: /cvs/src/src/gdb/gcore.c,v
retrieving revision 1.5
diff -u -r1.5 gcore.c
--- gcore.c	12 Apr 2002 23:09:48 -0000	1.5
+++ gcore.c	6 Aug 2002 15:51:34 -0000
@@ -23,7 +23,6 @@
 #include "inferior.h"
 #include "gdbcore.h"
 #include "elf-bfd.h"
-#include <sys/procfs.h>
 #include "symfile.h"
 #include "objfiles.h"
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Fwd: gcore for netbsd]
  2002-08-06  8:53       ` Andrew Cagney
@ 2002-08-06 10:39         ` Love
  0 siblings, 0 replies; 6+ messages in thread
From: Love @ 2002-08-06 10:39 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney <ac131313@ges.redhat.com> writes:

> I've checked the attached in (first bit :-).
> 
> Andrew
> 2002-08-06  Andrew Cagney  <ac131313@redhat.com>
> 
> 	* gcore.c: Do not include <sys/procfs.h>.
> 	* Makefile.in (gcore.o): Update dependencies.

Thanks,

There are three pieces of code left then. The memory dumper
(nbsd_find_memory_regions), the corefile elf-note writer
(nbsd_make_corefile_notes) and a optimation (start to use PT_IO).

The first patch is somewhat iffy since I've not yet commited the ptrace
PT_MEMMAP interface to netbsd what will make it work.

I think I need some help where I should put the stuff right now I've put
all in nbsd-nat.c, but I'm not sure that the elf-note stuff should live
there. Dump core-file from a netbsd machine over gdbserver ?

Also, should I just add #ifdef PT_IO and use that if it exists. Using PT_IO
is about 7-10 times faster the using PT_READ_[ID], make large diffrence
when writing large core-files.

The patches are in http://www.e.kth.se/~lha/patches/netbsd/gdb-core/

Also, do I need to do dead tree work ?

Love


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-08-06 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-04 11:02 [Fwd: gcore for netbsd] Andrew Cagney
2002-08-05 16:13 ` Michael Snyder
2002-08-05 21:19   ` Andrew Cagney
2002-08-05 21:39     ` Michael Snyder
2002-08-06  8:53       ` Andrew Cagney
2002-08-06 10:39         ` Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox