Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2020-12-10 Thread Kamil Rytarowski
On 10.12.2020 08:14, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Thu Dec 10 07:14:58 UTC 2020
> 
> Modified Files:
>   src/external/gpl3/gdb/dist/gdb: nbsd-nat.c
> 
> Log Message:
> Fix arm, for which PT_STEP is defined but unimplemented.
> 
> XXX
> Stop exposing PT_STEP to userland for arm?
> 


Yes, please remove it from headers for arm. This was a hack for DTrace
as far as I recall, to expose PT_STEP that way and get DTrace building.

Then, please restore nbsd-nat.c to the previous state.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-14 Thread Christos Zoulas
Thanks for fixing it!

christos


signature.asc
Description: Message signed with OpenPGP


Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-14 Thread Kamil Rytarowski
On 13.10.2020 11:14, Leonardo Taccari wrote:
> Hello Kamil,
> 
> Kamil Rytarowski writes:
>> Module Name: src
>> Committed By:kamil
>> Date:Tue Oct  6 23:14:47 UTC 2020
>>
>> Modified Files:
>>  src/external/gpl3/gdb/dist/gdb: inf-ptrace.c nbsd-nat.c
>>
>> Log Message:
>> Undo local patches
>>
>> They are no longer needed (and are wrong).
>> [...]
> 
> This seems to break gdb, e.g. by starting debugging sleep(1):
> 
>  | % gdb sleep
>  | Reading symbols from sleep...
>  | Reading symbols from /usr/libdata/debug//bin/sleep.debug...
>  | (gdb) r
>  | Starting program: /bin/sleep
>  | /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309: 
> internal-error: void switch_to_thread(thread_info*): Assertion `thr != NULL' 
> failed.
>  | A problem internal to GDB has been detected,
>  | further debugging may prove unreliable.
>  | Quit this debugging session? (y or n) y
>  | 
>  | This is a bug, please report it.  For instructions, see:
>  | .
>  | 
>  | /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309: 
> internal-error: void switch_to_thread(thread_info*): Assertion `thr != NULL' 
> failed.
>  | A problem internal to GDB has been detected,
>  | further debugging may prove unreliable.
>  | Create a core file of GDB? (y or n) y
>  | [ 240.7909538] sorry, pid 2675 was killed: orphaned traced process
>  | Abort (core dumped)
>  | Exit 134
>  | % gdb -core gdb.core gdb
>  | Reading symbols from gdb...
>  | Reading symbols from /usr/libdata/debug//usr/bin/gdb.debug...
>  | [New process 1687]
>  | [New process 2908]
>  | [New process 2801]
>  | [New process 1688]
>  | [New process 1668]
>  | Core was generated by `gdb'.
>  | Program terminated with signal SIGABRT, Aborted.
>  | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
>  | [Current thread is 1 (process 1687)]
>  | (gdb) bt
>  | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
>  | #1  0x76efa3983879 in abort () at /usr/src/lib/libc/stdlib/abort.c:74
>  | #2  0xd83814e9 in dump_core () at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:204
>  | #3  0xd8386315 in internal_vproblem(internal_problem *, const char 
> *, int, const char *, typedef __va_list_tag __va_list_tag *) (
>  | problem=problem@entry=0xd8bf05e0 , 
> file=, line=, fmt=, 
> ap=ap@entry=0x7f7fff084bc8)
>  | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:414
>  | #4  0xd83864fb in internal_verror (file=, 
> line=, fmt=, ap=ap@entry=0x7f7fff084bc8)
>  | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:439
>  | #5  0xd862e40a in internal_error (file=file@entry=0xd8758578 
> "/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c", 
> line=line@entry=1309, fmt=)
>  | at 
> /usr/src/external/gpl3/gdb/lib/libgdbsupport/../../dist/gdbsupport/errors.cc:55
>  | #6  0xd83a96f5 in switch_to_thread (thr=0x0) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309
>  | #7  switch_to_thread (thr=) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1307
>  | #8  0xd854e02e in startup_inferior 
> (proc_target=proc_target@entry=0xd8bf1c50 , 
> pid=pid@entry=2675, ntraps=ntraps@entry=1,
>  | last_waitstatus=last_waitstatus@entry=0x0, 
> last_ptid=last_ptid@entry=0x0) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/nat/fork-inferior.c:539
>  | #9  0xd854ef07 in gdb_startup_inferior (pid=pid@entry=2675, 
> num_traps=num_traps@entry=1) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/fork-child.c:129
>  | #10 0xd84f8592 in inf_ptrace_target::create_inferior 
> (this=this@entry=0xd8bf1c50 , 
> exec_file=exec_file@entry=0x76efa67946f0 "/bin/sleep", allargs=...,
>  | env=env@entry=0x76efa6b1e400, from_tty=from_tty@entry=1) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/inf-ptrace.c:117
>  | #11 0xd82b98e0 in run_command_1 (args=, from_tty=1, 
> run_how=RUN_NORMAL) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/infcmd.c:493
>  | #12 0xd83663d2 in cmd_func (cmd=, args= out>, from_tty=) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/cli/cli-decode.c:2181
>  | #13 0xd83a402d in execute_command (p=, 
> p@entry=0x76efa6b5c020 "", from_tty=1) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/top.c:668
>  | #14 0xd82d726c in command_handler (command=0x76efa6b5c020 "") at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:588
>  | #15 0xd82d81ad in command_line_handler (rl=...) at 
> /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:773
>  | #16 0xd82d7ad5 in gdb_rl_callback_handler (rl=0x76efa6b5c200 "r") 
> at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:219
>  | #17 0xd864f85e in rl_callback_read_char () at 
> 

Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2020-10-13 Thread Leonardo Taccari
Hello Kamil,

Kamil Rytarowski writes:
> Module Name:  src
> Committed By: kamil
> Date: Tue Oct  6 23:14:47 UTC 2020
>
> Modified Files:
>   src/external/gpl3/gdb/dist/gdb: inf-ptrace.c nbsd-nat.c
>
> Log Message:
> Undo local patches
>
> They are no longer needed (and are wrong).
> [...]

This seems to break gdb, e.g. by starting debugging sleep(1):

 | % gdb sleep
 | Reading symbols from sleep...
 | Reading symbols from /usr/libdata/debug//bin/sleep.debug...
 | (gdb) r
 | Starting program: /bin/sleep
 | /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309: 
internal-error: void switch_to_thread(thread_info*): Assertion `thr != NULL' 
failed.
 | A problem internal to GDB has been detected,
 | further debugging may prove unreliable.
 | Quit this debugging session? (y or n) y
 | 
 | This is a bug, please report it.  For instructions, see:
 | .
 | 
 | /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309: 
internal-error: void switch_to_thread(thread_info*): Assertion `thr != NULL' 
failed.
 | A problem internal to GDB has been detected,
 | further debugging may prove unreliable.
 | Create a core file of GDB? (y or n) y
 | [ 240.7909538] sorry, pid 2675 was killed: orphaned traced process
 | Abort (core dumped)
 | Exit 134
 | % gdb -core gdb.core gdb
 | Reading symbols from gdb...
 | Reading symbols from /usr/libdata/debug//usr/bin/gdb.debug...
 | [New process 1687]
 | [New process 2908]
 | [New process 2801]
 | [New process 1688]
 | [New process 1668]
 | Core was generated by `gdb'.
 | Program terminated with signal SIGABRT, Aborted.
 | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
 | [Current thread is 1 (process 1687)]
 | (gdb) bt
 | #0  0x76efa39833ba in _lwp_kill () from /usr/lib/libc.so.12
 | #1  0x76efa3983879 in abort () at /usr/src/lib/libc/stdlib/abort.c:74
 | #2  0xd83814e9 in dump_core () at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:204
 | #3  0xd8386315 in internal_vproblem(internal_problem *, const char 
*, int, const char *, typedef __va_list_tag __va_list_tag *) (
 | problem=problem@entry=0xd8bf05e0 , 
file=, line=, fmt=, 
ap=ap@entry=0x7f7fff084bc8)
 | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:414
 | #4  0xd83864fb in internal_verror (file=, 
line=, fmt=, ap=ap@entry=0x7f7fff084bc8)
 | at /usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/utils.c:439
 | #5  0xd862e40a in internal_error (file=file@entry=0xd8758578 
"/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c", 
line=line@entry=1309, fmt=)
 | at 
/usr/src/external/gpl3/gdb/lib/libgdbsupport/../../dist/gdbsupport/errors.cc:55
 | #6  0xd83a96f5 in switch_to_thread (thr=0x0) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1309
 | #7  switch_to_thread (thr=) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1307
 | #8  0xd854e02e in startup_inferior 
(proc_target=proc_target@entry=0xd8bf1c50 , 
pid=pid@entry=2675, ntraps=ntraps@entry=1,
 | last_waitstatus=last_waitstatus@entry=0x0, 
last_ptid=last_ptid@entry=0x0) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/nat/fork-inferior.c:539
 | #9  0xd854ef07 in gdb_startup_inferior (pid=pid@entry=2675, 
num_traps=num_traps@entry=1) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/fork-child.c:129
 | #10 0xd84f8592 in inf_ptrace_target::create_inferior 
(this=this@entry=0xd8bf1c50 , 
exec_file=exec_file@entry=0x76efa67946f0 "/bin/sleep", allargs=...,
 | env=env@entry=0x76efa6b1e400, from_tty=from_tty@entry=1) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/inf-ptrace.c:117
 | #11 0xd82b98e0 in run_command_1 (args=, from_tty=1, 
run_how=RUN_NORMAL) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/infcmd.c:493
 | #12 0xd83663d2 in cmd_func (cmd=, args=, from_tty=) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/cli/cli-decode.c:2181
 | #13 0xd83a402d in execute_command (p=, 
p@entry=0x76efa6b5c020 "", from_tty=1) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/top.c:668
 | #14 0xd82d726c in command_handler (command=0x76efa6b5c020 "") at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:588
 | #15 0xd82d81ad in command_line_handler (rl=...) at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:773
 | #16 0xd82d7ad5 in gdb_rl_callback_handler (rl=0x76efa6b5c200 "r") at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:219
 | #17 0xd864f85e in rl_callback_read_char () at 
/usr/src/external/gpl3/gdb/dist/readline/readline/callback.c:281
 | #18 0xd82d6c5e in gdb_rl_callback_read_char_wrapper_noexcept () at 
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/event-top.c:177
 | #19 0xd82d78e0 in gdb_rl_callback_read_char_wrapper 
(client_data=) at 

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:49:20 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
add missing files for 32 bit debugging on 64 bit host.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.23 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.24
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.23	Fri Jul 12 18:44:11 2019
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Thu Nov 21 20:49:20 2019
@@ -771,7 +771,8 @@ x86_64-*-mingw* | x86_64-*-cygwin*)
 ;;
 x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu)
 	# Target: NetBSD/amd64
-	gdb_target_obs="amd64-nbsd-tdep.o ${i386_tobjs}"
+	gdb_target_obs="amd64-nbsd-tdep.o ${i386_tobjs} \
+			i386-bsd-tdep.o i386-nbsd-tdep.o"
 	;;
 x86_64-*-openbsd*)
 	# Target: OpenBSD/amd64



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:49:20 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
add missing files for 32 bit debugging on 64 bit host.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:48:50 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: solib.c

Log Message:
Support for compat-32 type shared library paths.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/solib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/solib.c
diff -u src/external/gpl3/gdb/dist/gdb/solib.c:1.7 src/external/gpl3/gdb/dist/gdb/solib.c:1.8
--- src/external/gpl3/gdb/dist/gdb/solib.c:1.7	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/solib.c	Thu Nov 21 20:48:50 2019
@@ -507,10 +507,27 @@ solib_bfd_open (const char *pathname)
   /* Check bfd arch.  */
   b = gdbarch_bfd_arch_info (target_gdbarch ());
   if (!b->compatible (b, bfd_get_arch_info (abfd.get (
-warning (_("`%s': Shared library architecture %s is not compatible "
-   "with target architecture %s."), bfd_get_filename (abfd),
+{
+  char buf[SO_NAME_MAX_PATH_SIZE];
+  char *slash = strrchr(pathname, '/');
+  if (slash)
+{
+  struct stat st;
+
+	  snprintf(buf, sizeof(buf), "%.*s/%s/%s", 
+	(int)(slash - pathname), pathname, b->printable_name, slash + 1);
+	  if (stat(buf, ) == 0)
+	return solib_bfd_open(buf);
+	  snprintf(buf, sizeof(buf), "%s-%s", 
+	pathname, b->printable_name);
+	  if (stat(buf, ) == 0)
+	return solib_bfd_open(buf);
+	}
+  warning (_("`%s': Shared library architecture %s is not compatible "
+ "with target architecture %s."), bfd_get_filename (abfd),
  bfd_get_arch_info (abfd.get ())->printable_name,
 	 b->printable_name);
+}
 
   return abfd;
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 22 01:48:50 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: solib.c

Log Message:
Support for compat-32 type shared library paths.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/solib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-10-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  2 15:15:09 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-tdep.c

Log Message:
Fix core-dump register fetching.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-10-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  2 15:15:09 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-tdep.c

Log Message:
Fix core-dump register fetching.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c:1.4 src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c:1.5
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c:1.4	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-tdep.c	Wed Oct  2 11:15:09 2019
@@ -19,6 +19,8 @@
 
 #include "defs.h"
 #include "osabi.h"
+#include "gdbcore.h"
+#include "regset.h"
 
 #include "arch/arm.h"
 #include "arm-tdep.h"
@@ -36,6 +38,64 @@ static const gdb_byte arm_nbsd_arm_be_br
 static const gdb_byte arm_nbsd_thumb_le_breakpoint[] = {0xfe, 0xde};
 static const gdb_byte arm_nbsd_thumb_be_breakpoint[] = {0xde, 0xfe};
 
+/* Register maps.  */
+
+static const struct regcache_map_entry arm_nbsd_gregmap[] =
+  {
+{ 13, ARM_A1_REGNUM, 4 }, /* r0 ... r12 */
+{ 1, ARM_SP_REGNUM, 4 },
+{ 1, ARM_LR_REGNUM, 4 },
+{ 1, ARM_PC_REGNUM, 4 },
+{ 1, ARM_PS_REGNUM, 4 },
+{ 0 }
+  };
+
+static const struct regcache_map_entry arm_nbsd_vfpregmap[] =
+  {
+{ 1, ARM_FPS_REGNUM, 4 },		/* fpexc */
+{ 1, ARM_FPSCR_REGNUM, 4 },		/* fpscr */
+{ 1, REGCACHE_MAP_SKIP, 4 },	/* fpinst */
+{ 1, REGCACHE_MAP_SKIP, 4 },	/* fpinst2 */
+{ 32, ARM_D0_REGNUM, 8 }, /* d0 ... d31 */	/* really 33, not 32 */
+{ 1, REGCACHE_MAP_SKIP, 8 },	/* fstmx format */
+{ 0 }
+  };
+
+/* Register set definitions.  */
+
+const struct regset arm_nbsd_gregset =
+  {
+arm_nbsd_gregmap,
+regcache_supply_regset, regcache_collect_regset
+  };
+
+const struct regset arm_nbsd_vfpregset =
+  {
+arm_nbsd_vfpregmap,
+regcache_supply_regset, regcache_collect_regset
+  };
+
+/* Implement the "regset_from_core_section" gdbarch method.  */
+
+#define ARM_NBSD_SIZEOF_GREGSET (17 * 4)
+#define ARM_NBSD_SIZEOF_VFPREGSET (4 * 4 + 33 * 8)
+
+static void
+arm_nbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+   iterate_over_regset_sections_cb *cb,
+   void *cb_data,
+   const struct regcache *regcache)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  cb (".reg", ARM_NBSD_SIZEOF_GREGSET, ARM_NBSD_SIZEOF_GREGSET,
+  _nbsd_gregset, NULL, cb_data);
+
+  // XXX: Don't see it in core.
+  if (tdep->vfp_register_count > 0)
+cb (".reg2", ARM_NBSD_SIZEOF_VFPREGSET, ARM_NBSD_SIZEOF_VFPREGSET,
+	_nbsd_vfpregset, "VFP floating-point", cb_data);
+}
 static void
 arm_netbsd_init_abi_common (struct gdbarch_info info,
 			struct gdbarch *gdbarch)
@@ -71,7 +131,7 @@ arm_netbsd_init_abi_common (struct gdbar
   set_gdbarch_software_single_step (gdbarch, arm_software_single_step);
   /* Core support */
   set_gdbarch_iterate_over_regset_sections
-(gdbarch, armbsd_iterate_over_regset_sections);
+(gdbarch, arm_nbsd_iterate_over_regset_sections);
 
 }
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-09-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 20:11:10 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-nat.c

Log Message:
Validate register number before fetching/storing it (Gopikrishnan Sidhardhan)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-09-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 20:11:10 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-nat.c

Log Message:
Validate register number before fetching/storing it (Gopikrishnan Sidhardhan)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.12 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.13
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.12	Sat Aug 31 16:16:25 2019
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c	Thu Sep 26 16:11:10 2019
@@ -49,6 +49,24 @@ public:
 
 static arm_nbsd_nat_target the_arm_nbsd_nat_target;
 
+/* Determine if PT_GETREGS fetches REGNUM.  */
+
+static bool
+getregs_supplies (int regnum)
+{
+  return ((regnum >= ARM_A1_REGNUM && regnum <= ARM_PC_REGNUM)
+	  || regnum == ARM_PS_REGNUM);
+}
+
+/* Determine if PT_GETFPREGS fetches REGNUM.  */
+
+static bool
+getfpregs_supplies (int regnum)
+{
+  return ((regnum >= ARM_D0_REGNUM && regnum <= ARM_D31_REGNUM)
+	  || regnum == ARM_FPSCR_REGNUM);
+}
+
 extern int arm_apcs_32;
 
 #define FPSCR(r) ((char *) &(r)->fpr_vfp.vfp_fpscr)
@@ -256,10 +274,12 @@ arm_nbsd_nat_target::fetch_registers (st
 {
   if (regno >= 0)
 {
-  if (regno >= ARM_D0_REGNUM && regno <= ARM_FPSCR_REGNUM)
+  if (getregs_supplies (regno))
+	fetch_register (regcache, regno);
+  else if (getfpregs_supplies (regno))
 	fetch_fp_register (regcache, regno);
   else
-	fetch_register (regcache, regno);
+warning (_("unable to fetch register %d"), regno);
 }
   else
 {
@@ -442,10 +462,12 @@ arm_nbsd_nat_target::store_registers (st
 {
   if (regno >= 0)
 {
-  if (regno >= ARM_D0_REGNUM && regno <= ARM_FPSCR_REGNUM)
+  if (getregs_supplies (regno))
+	store_register (regcache, regno);
+  else if (getfpregs_supplies (regno))
 	store_fp_register (regcache, regno);
   else
-	store_register (regcache, regno);
+warning (_("unable to store register %d"), regno);
 }
   else
 {



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-09-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep  6 14:37:00 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: ChangeLog event-top.c inflow.c inflow.h
ser-unix.c top.c

Log Message:
Cherry-pick upstream GDB patch to fix SIGTTOU handling

Fixes toolchain/54508 by Tobias Ulmer

commit 766f883622ef008230250aa5aecef9fb9b29f233
Author: Alan Hayward 
Date:   Tue May 28 10:07:54 2019 +0100

Suppress SIGTTOU when handling errors

Calls to error () can cause SIGTTOU to send gdb to the background.

For example, on an Arm build:
  (gdb) b main
  Breakpoint 1 at 0x10774: file 
/build/gdb/testsuite/../../../src/binutils-gdb/gdb/testsuite/gdb.base/watchpoint.c,
 line 174.
  (gdb) r
  Starting program: 
/build/gdb/testsuite/outputs/gdb.base/watchpoint/watchpoint

  [1]+  Stopped ../gdb 
./outputs/gdb.base/watchpoint/watchpoint
  localhost$ fg
  ../gdb ./outputs/gdb.base/watchpoint/watchpoint
  Cannot parse expression `.L1199 4@r4'.
  warning: Probes-based dynamic linker interface failed.
  Reverting to original interface.

The SIGTTOU is raised whilst inside a syscall during the call to tcdrain.
Fix is to use scoped_ignore_sigttou to ensure SIGTTOU is blocked.

In addition fix include comments - job_control is not included via 
terminal.h

gdb/ChangeLog:

* event-top.c: Remove include comment.
* inflow.c (class scoped_ignore_sigttou): Move from here...
* inflow.h (class scoped_ignore_sigttou): ...to here.
* ser-unix.c (hardwire_drain_output): Block SIGTTOU during drain.
* top.c:  Remove include comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 src/external/gpl3/gdb/dist/gdb/ChangeLog \
src/external/gpl3/gdb/dist/gdb/event-top.c \
src/external/gpl3/gdb/dist/gdb/ser-unix.c \
src/external/gpl3/gdb/dist/gdb/top.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/inflow.c \
src/external/gpl3/gdb/dist/gdb/inflow.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/ChangeLog
diff -u src/external/gpl3/gdb/dist/gdb/ChangeLog:1.1.1.8 src/external/gpl3/gdb/dist/gdb/ChangeLog:1.2
--- src/external/gpl3/gdb/dist/gdb/ChangeLog:1.1.1.8	Sun May 26 20:59:19 2019
+++ src/external/gpl3/gdb/dist/gdb/ChangeLog	Fri Sep  6 14:37:00 2019
@@ -1,3 +1,11 @@
+2019-05-28  Alan Hayward  
+
+	* event-top.c: Remove include comment.
+	* inflow.c (class scoped_ignore_sigttou): Move from here...
+	* inflow.h (class scoped_ignore_sigttou): ...to here.
+	* ser-unix.c (hardwire_drain_output): Block SIGTTOU during drain.
+	* top.c:  Remove include comment.
+
 2019-05-11  Joel Brobecker  
 
 	* version.in: Set GDB version number to 8.3.
@@ -2691,4 +2699,3 @@ fill-column: 74
 version-control: never
 coding: utf-8
 End:
-
Index: src/external/gpl3/gdb/dist/gdb/event-top.c
diff -u src/external/gpl3/gdb/dist/gdb/event-top.c:1.1.1.8 src/external/gpl3/gdb/dist/gdb/event-top.c:1.2
--- src/external/gpl3/gdb/dist/gdb/event-top.c:1.1.1.8	Sun May 26 20:59:21 2019
+++ src/external/gpl3/gdb/dist/gdb/event-top.c	Fri Sep  6 14:37:00 2019
@@ -24,7 +24,7 @@
 #include "inferior.h"
 #include "infrun.h"
 #include "target.h"
-#include "terminal.h"		/* for job_control */
+#include "terminal.h"
 #include "event-loop.h"
 #include "event-top.h"
 #include "interps.h"
Index: src/external/gpl3/gdb/dist/gdb/ser-unix.c
diff -u src/external/gpl3/gdb/dist/gdb/ser-unix.c:1.1.1.8 src/external/gpl3/gdb/dist/gdb/ser-unix.c:1.2
--- src/external/gpl3/gdb/dist/gdb/ser-unix.c:1.1.1.8	Sun May 26 20:59:24 2019
+++ src/external/gpl3/gdb/dist/gdb/ser-unix.c	Fri Sep  6 14:37:00 2019
@@ -32,6 +32,7 @@
 #include "gdbcmd.h"
 #include "common/filestuff.h"
 #include 
+#include "inflow.h"
 
 struct hardwire_ttystate
   {
@@ -164,6 +165,9 @@ hardwire_print_tty_state (struct serial 
 static int
 hardwire_drain_output (struct serial *scb)
 {
+  /* Ignore SIGTTOU which may occur during the drain.  */
+  scoped_ignore_sigttou ignore_sigttou;
+
   return tcdrain (scb->fd);
 }
 
Index: src/external/gpl3/gdb/dist/gdb/top.c
diff -u src/external/gpl3/gdb/dist/gdb/top.c:1.1.1.8 src/external/gpl3/gdb/dist/gdb/top.c:1.2
--- src/external/gpl3/gdb/dist/gdb/top.c:1.1.1.8	Sun May 26 20:59:38 2019
+++ src/external/gpl3/gdb/dist/gdb/top.c	Fri Sep  6 14:37:00 2019
@@ -34,7 +34,7 @@
 #include "expression.h"
 #include "value.h"
 #include "language.h"
-#include "terminal.h"		/* For job_control.  */
+#include "terminal.h"
 #include "common/job-control.h"
 #include "annotate.h"
 #include "completer.h"

Index: src/external/gpl3/gdb/dist/gdb/inflow.c
diff -u src/external/gpl3/gdb/dist/gdb/inflow.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/inflow.c:1.2
--- src/external/gpl3/gdb/dist/gdb/inflow.c:1.1.1.7	Sun May 26 20:59:25 2019
+++ src/external/gpl3/gdb/dist/gdb/inflow.c	Fri Sep  6 14:37:00 

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-09-06 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep  6 14:37:00 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: ChangeLog event-top.c inflow.c inflow.h
ser-unix.c top.c

Log Message:
Cherry-pick upstream GDB patch to fix SIGTTOU handling

Fixes toolchain/54508 by Tobias Ulmer

commit 766f883622ef008230250aa5aecef9fb9b29f233
Author: Alan Hayward 
Date:   Tue May 28 10:07:54 2019 +0100

Suppress SIGTTOU when handling errors

Calls to error () can cause SIGTTOU to send gdb to the background.

For example, on an Arm build:
  (gdb) b main
  Breakpoint 1 at 0x10774: file 
/build/gdb/testsuite/../../../src/binutils-gdb/gdb/testsuite/gdb.base/watchpoint.c,
 line 174.
  (gdb) r
  Starting program: 
/build/gdb/testsuite/outputs/gdb.base/watchpoint/watchpoint

  [1]+  Stopped ../gdb 
./outputs/gdb.base/watchpoint/watchpoint
  localhost$ fg
  ../gdb ./outputs/gdb.base/watchpoint/watchpoint
  Cannot parse expression `.L1199 4@r4'.
  warning: Probes-based dynamic linker interface failed.
  Reverting to original interface.

The SIGTTOU is raised whilst inside a syscall during the call to tcdrain.
Fix is to use scoped_ignore_sigttou to ensure SIGTTOU is blocked.

In addition fix include comments - job_control is not included via 
terminal.h

gdb/ChangeLog:

* event-top.c: Remove include comment.
* inflow.c (class scoped_ignore_sigttou): Move from here...
* inflow.h (class scoped_ignore_sigttou): ...to here.
* ser-unix.c (hardwire_drain_output): Block SIGTTOU during drain.
* top.c:  Remove include comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 src/external/gpl3/gdb/dist/gdb/ChangeLog \
src/external/gpl3/gdb/dist/gdb/event-top.c \
src/external/gpl3/gdb/dist/gdb/ser-unix.c \
src/external/gpl3/gdb/dist/gdb/top.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/inflow.c \
src/external/gpl3/gdb/dist/gdb/inflow.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-08-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 31 20:16:25 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-nat.c

Log Message:
Restore the kvm support


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-08-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 31 20:16:25 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: arm-nbsd-nat.c

Log Message:
Restore the kvm support


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.11 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.12
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.11	Thu May 30 16:02:23 2019
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c	Sat Aug 31 20:16:25 2019
@@ -536,6 +536,9 @@ _initialize_arm_netbsd_nat (void)
 {
   add_inf_child_target (_arm_nbsd_nat_target);
 
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (armnbsd_supply_pcb);
+
   deprecated_add_core_fns (_netbsd_core_fns);
   deprecated_add_core_fns (_netbsd_elfcore_fns);
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 12 05:40:42 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: auxv.c

Log Message:
On NetBSD the auxv tag is always 32 bits long. Gdb assumes it is 64 on _LP64.
This works most of the time, except for 64 bit big endian (sparc64 eg).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/auxv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 12 05:40:42 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: auxv.c

Log Message:
On NetBSD the auxv tag is always 32 bits long. Gdb assumes it is 64 on _LP64.
This works most of the time, except for 64 bit big endian (sparc64 eg).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/auxv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/auxv.c
diff -u src/external/gpl3/gdb/dist/gdb/auxv.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/auxv.c:1.2
--- src/external/gpl3/gdb/dist/gdb/auxv.c:1.1.1.7	Sun May 26 16:59:24 2019
+++ src/external/gpl3/gdb/dist/gdb/auxv.c	Mon Aug 12 01:40:42 2019
@@ -266,8 +266,12 @@ default_auxv_parse (struct target_ops *o
 
   if (endptr - ptr < sizeof_auxv_field * 2)
 return -1;
-
-  *typep = extract_unsigned_integer (ptr, sizeof_auxv_field, byte_order);
+#ifdef __NetBSD__
+  const int sizeof_auxv_type = 4;
+#else
+  const int sizeof_auxv_type = sizeof_auxv_field;
+#endif
+  *typep = extract_unsigned_integer (ptr, sizeof_auxv_type, byte_order);
   ptr += sizeof_auxv_field;
   *valp = extract_unsigned_integer (ptr, sizeof_auxv_field, byte_order);
   ptr += sizeof_auxv_field;



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 14 18:50:58 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
PR/54375: Andreas Gustafsson: gdb attached to running process shows extra
thread. When attaching to a process that has threads make sure that we
mutate the inferior_ptid (that currently has lwpid == 0 to the first thread
we encounter.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.12 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.13
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.12	Thu Jun 13 21:00:52 2019
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Sun Jul 14 14:50:58 2019
@@ -263,7 +263,12 @@ nbsd_add_threads (pid_t pid)
 {
   ptid_t ptid = ptid_t (pid, pl.pl_lwpid, 0);
   if (!in_thread_list (ptid))
-	add_thread (ptid);
+	{
+	  if (inferior_ptid.lwp () == 0)
+	thread_change_ptid (inferior_ptid, ptid);
+	  else
+	add_thread (ptid);
+	}
 }
 }
 
@@ -454,7 +459,10 @@ nbsd_nat_target::wait (ptid_t ptid, stru
   ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
   return wptid;
 }
-add_thread (wptid);
+	if (inferior_ptid.lwp () == 0)
+	  thread_change_ptid (inferior_ptid, wptid);
+	else
+	  add_thread (wptid);
 ourstatus->kind = TARGET_WAITKIND_THREAD_CREATED;
 if (debug_nbsd_lwp)
   fprintf_unfiltered (gdb_stdlog, "NLWP: created LWP %d\n", pst.pe_lwp);



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 14 18:50:58 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
PR/54375: Andreas Gustafsson: gdb attached to running process shows extra
thread. When attaching to a process that has threads make sure that we
mutate the inferior_ptid (that currently has lwpid == 0 to the first thread
we encounter.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 13 21:55:52 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c alpha-nbsd-tdep.c
sh-nbsd-tdep.c

Log Message:
Use ULONGEST_MAX instead of (ULONGEST)-1


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.5	Thu May 30 09:43:03 2019
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c	Sat Jul 13 17:55:52 2019
@@ -118,11 +118,11 @@ static const struct tramp_frame aarch64_
   SIGTRAMP_FRAME,
   4,
   {
-{0x910003e0, (ULONGEST)-1},		/* mov  x0, sp  */
-{0x91014000, (ULONGEST)-1},		/* add  x0, x0, #SF_UC  */
-{0xd2803428, (ULONGEST)-1},		/* mov  x8, #SYS_sigreturn  */
-{0xd401, (ULONGEST)-1},		/* svc  0x0  */
-{(ULONGEST)TRAMP_SENTINEL_INSN, (ULONGEST)-1}
+{0x910003e0, ULONGEST_MAX},		/* mov  x0, sp  */
+{0x91014000, ULONGEST_MAX},		/* add  x0, x0, #SF_UC  */
+{0xd2803428, ULONGEST_MAX},		/* mov  x8, #SYS_sigreturn  */
+{0xd401, ULONGEST_MAX},		/* svc  0x0  */
+{(ULONGEST)TRAMP_SENTINEL_INSN, ULONGEST_MAX}
   },
   aarch64_nbsd_sigframe_init
 };

Index: src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.6	Sat Jul 13 17:53:48 2019
+++ src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c	Sat Jul 13 17:55:52 2019
@@ -192,7 +192,7 @@ static const struct tramp_frame alphanbs
 { 0x23de0010, 0x },		/* lda sp, 16(sp) */
 { 0x201f0127, 0x },		/* lda v0, 295 */
 { 0x0083, 0x },		/* call_pal callsys */
-{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
+{ TRAMP_SENTINEL_INSN, ULONGEST_MAX }
   },
   alphanbsd_sigtramp_cache_init
 };
@@ -203,13 +203,13 @@ static const struct tramp_frame alphanbs
   SIGTRAMP_FRAME,
   4,
   {
-{ 0x221e0080, (ULONGEST)-1 },		/* lda	a0,128(sp) */
-{ 0x201f0134, (ULONGEST)-1 },		/* lda	v0,308 */
-{ 0x0083, (ULONGEST)-1 },		/* callsys */
-{ 0x47e00410, (ULONGEST)-1 },		/* mov	v0,a0 */
-{ 0x201f0001, (ULONGEST)-1 },		/* lda	v0,1 */
-{ 0x0083, (ULONGEST)-1 },		/* callsys */
-{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
+{ 0x221e0080, ULONGEST_MAX },		/* lda	a0,128(sp) */
+{ 0x201f0134, ULONGEST_MAX },		/* lda	v0,308 */
+{ 0x0083, ULONGEST_MAX },		/* callsys */
+{ 0x47e00410, ULONGEST_MAX },		/* mov	v0,a0 */
+{ 0x201f0001, ULONGEST_MAX },		/* lda	v0,1 */
+{ 0x0083, ULONGEST_MAX },		/* callsys */
+{ TRAMP_SENTINEL_INSN, ULONGEST_MAX }
   },
   alphanbsd_sigtramp_cache_init
 };
@@ -221,13 +221,13 @@ static const struct tramp_frame alphanbs
   {
 { 0x27ba, 0x },
 { 0x23bd, 0x },			/* ldgp	gp,0(ra) */
-{ 0x221e0080, (ULONGEST)-1 },		/* lda	a0,128(sp) */
-{ 0x201f0134, (ULONGEST)-1 },		/* lda	v0,308 */
-{ 0x0083, (ULONGEST)-1 },		/* callsys */
-{ 0x221f, (ULONGEST)-1 },		/* lda	a0,-1 */
-{ 0x201f0001, (ULONGEST)-1 },		/* lda	v0,1 */
-{ 0x0083, (ULONGEST)-1 },		/* callsys */
-{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
+{ 0x221e0080, ULONGEST_MAX },		/* lda	a0,128(sp) */
+{ 0x201f0134, ULONGEST_MAX },		/* lda	v0,308 */
+{ 0x0083, ULONGEST_MAX },		/* callsys */
+{ 0x221f, ULONGEST_MAX },		/* lda	a0,-1 */
+{ 0x201f0001, ULONGEST_MAX },		/* lda	v0,1 */
+{ 0x0083, ULONGEST_MAX },		/* callsys */
+{ TRAMP_SENTINEL_INSN, ULONGEST_MAX }
   },
   alphanbsd_sigtramp_cache_init
 };

Index: src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.7 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.8
--- src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.7	Fri Jun 21 15:20:18 2019
+++ src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c	Sat Jul 13 17:55:52 2019
@@ -141,25 +141,25 @@ static const struct tramp_frame shnbsd_s
   SIGTRAMP_FRAME,
   2,
   {
-{ 0x64f3, (ULONGEST)-1 },			/* mov r15,r4 */
-{ 0xd002, (ULONGEST)-1 },			/* mov.l   .LSYS_setcontext */
-{ 0xc380, (ULONGEST)-1 },			/* trapa   #-128 */
-{ 0xa003, (ULONGEST)-1 },			/* bra .Lskip1 */
-{ 0x0009, (ULONGEST)-1 },			/* nop */
-{ 0x0009, (ULONGEST)-1 },			/* nop */
+{ 0x64f3, ULONGEST_MAX },			/* mov r15,r4 */
+{ 0xd002, ULONGEST_MAX },			/* mov.l   .LSYS_setcontext */
+{ 0xc380, ULONGEST_MAX 

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 13 21:55:52 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c alpha-nbsd-tdep.c
sh-nbsd-tdep.c

Log Message:
Use ULONGEST_MAX instead of (ULONGEST)-1


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 13 21:53:48 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-nbsd-tdep.c

Log Message:
Add (ULONGEST) to prevent narrowing warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c:1.5	Thu May 30 09:54:20 2019
+++ src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c	Sat Jul 13 17:53:48 2019
@@ -192,7 +192,7 @@ static const struct tramp_frame alphanbs
 { 0x23de0010, 0x },		/* lda sp, 16(sp) */
 { 0x201f0127, 0x },		/* lda v0, 295 */
 { 0x0083, 0x },		/* call_pal callsys */
-{ TRAMP_SENTINEL_INSN, -1 }
+{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
   },
   alphanbsd_sigtramp_cache_init
 };
@@ -203,13 +203,13 @@ static const struct tramp_frame alphanbs
   SIGTRAMP_FRAME,
   4,
   {
-{ 0x221e0080, -1 },		/* lda	a0,128(sp) */
-{ 0x201f0134, -1 },		/* lda	v0,308 */
-{ 0x0083, -1 },		/* callsys */
-{ 0x47e00410, -1 },		/* mov	v0,a0 */
-{ 0x201f0001, -1 },		/* lda	v0,1 */
-{ 0x0083, -1 },		/* callsys */
-{ TRAMP_SENTINEL_INSN, -1 }
+{ 0x221e0080, (ULONGEST)-1 },		/* lda	a0,128(sp) */
+{ 0x201f0134, (ULONGEST)-1 },		/* lda	v0,308 */
+{ 0x0083, (ULONGEST)-1 },		/* callsys */
+{ 0x47e00410, (ULONGEST)-1 },		/* mov	v0,a0 */
+{ 0x201f0001, (ULONGEST)-1 },		/* lda	v0,1 */
+{ 0x0083, (ULONGEST)-1 },		/* callsys */
+{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
   },
   alphanbsd_sigtramp_cache_init
 };
@@ -220,14 +220,14 @@ static const struct tramp_frame alphanbs
   4,
   {
 { 0x27ba, 0x },
-{ 0x23bd, 0x },	/* ldgp	gp,0(ra) */
-{ 0x221e0080, -1 },		/* lda	a0,128(sp) */
-{ 0x201f0134, -1 },		/* lda	v0,308 */
-{ 0x0083, -1 },		/* callsys */
-{ 0x221f, -1 },		/* lda	a0,-1 */
-{ 0x201f0001, -1 },		/* lda	v0,1 */
-{ 0x0083, -1 },		/* callsys */
-{ TRAMP_SENTINEL_INSN, -1 }
+{ 0x23bd, 0x },			/* ldgp	gp,0(ra) */
+{ 0x221e0080, (ULONGEST)-1 },		/* lda	a0,128(sp) */
+{ 0x201f0134, (ULONGEST)-1 },		/* lda	v0,308 */
+{ 0x0083, (ULONGEST)-1 },		/* callsys */
+{ 0x221f, (ULONGEST)-1 },		/* lda	a0,-1 */
+{ 0x201f0001, (ULONGEST)-1 },		/* lda	v0,1 */
+{ 0x0083, (ULONGEST)-1 },		/* callsys */
+{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
   },
   alphanbsd_sigtramp_cache_init
 };



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jul 13 21:53:48 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-nbsd-tdep.c

Log Message:
Add (ULONGEST) to prevent narrowing warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/alpha-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 12 22:44:11 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
remove dup solib-svr4 defs


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.22 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.23
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.22	Thu May 30 12:02:23 2019
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Fri Jul 12 18:44:11 2019
@@ -131,7 +131,7 @@ aarch64*-*-linux*)
 aarch64*-*-netbsd*)
 	# Target: AArch64 NetBSD
 	gdb_target_obs="aarch64-tdep.o aarch64-nbsd-tdep.o \
-			arch/aarch64-insn.o solib-svr4.o"
+			arch/aarch64-insn.o"
 	;;
 
 alpha*-*-osf*)
@@ -256,11 +256,11 @@ hppa*-*-linux*)
 	;;
 hppa*-*-netbsd*)
 	# Target: NetBSD/hppa
-	gdb_target_obs="hppa-bsd-tdep.o hppa-nbsd-tdep.o solib-svr4.o"
+	gdb_target_obs="hppa-bsd-tdep.o hppa-nbsd-tdep.o"
 	;;
 hppa*-*-openbsd*)
 	# Target: OpenBSD/hppa
-	gdb_target_obs="hppa-bsd-tdep.o hppa-obsd-tdep.o solib-svr4.o"
+	gdb_target_obs="hppa-bsd-tdep.o hppa-obsd-tdep.o"
 	;;
 
 i[34567]86-*-darwin*)
@@ -724,7 +724,7 @@ v850*-*-elf | v850*-*-rtems*)
 
 vax-*-netbsd* | vax-*-knetbsd*-gnu)
 	# Target: NetBSD/vax
-	gdb_target_obs="vax-tdep.o solib-svr4.o"
+	gdb_target_obs="vax-tdep.o"
 	;;
 vax-*-openbsd*)
 	# Target: OpenBSD/vax



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 12 22:44:33 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c i386-nbsd-nat.c

Log Message:
remove ancient and unused regset_t definitions


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.8	Thu May 30 17:16:03 2019
+++ src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c	Fri Jul 12 18:44:33 2019
@@ -32,16 +32,6 @@
 #include 
 #include 
 
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h"
-
 /* Mapping between the general-purpose registers in NetBSD/amd64
`struct reg' format and GDB's register cache layout for
NetBSD/i386.

Index: src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c:1.5	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c	Fri Jul 12 18:44:33 2019
@@ -36,16 +36,6 @@
 #include "nbsd-nat.h"
 #include "bsd-kvm.h"
 
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h" 
-
 static int
 i386nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
 {



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 12 22:44:33 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c i386-nbsd-nat.c

Log Message:
remove ancient and unused regset_t definitions


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/i386-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 12 22:44:11 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.tgt

Log Message:
remove dup solib-svr4 defs


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/gpl3/gdb/dist/gdb/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 12 22:43:15 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: mips-nbsd-nat.c

Log Message:
put back the kvm stuff lost in previous merge.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-07-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jul 12 22:43:15 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: mips-nbsd-nat.c

Log Message:
put back the kvm stuff lost in previous merge.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.8	Wed May 29 21:19:36 2019
+++ src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c	Fri Jul 12 18:43:15 2019
@@ -28,16 +28,6 @@
 #include 
 #include 
 
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h"
-
 #include "mips-tdep.h"
 #include "nbsd-nat.h"
 #include "mips-nbsd-tdep.h"
@@ -133,8 +123,44 @@ mips_nbsd_nat_target::store_registers (s
 }
 }
 
+static int
+mipsnbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  struct label_t sf;
+
+  sf = pcb->pcb_context;
+
+  /* really should test for n{32,64} abi for this register
+ unless this is purely the "n" ABI */
+
+  regcache->raw_supply (MIPS_S0_REGNUM, [_L_S0]);
+  regcache->raw_supply (MIPS_S1_REGNUM, [_L_S1]);
+  regcache->raw_supply (MIPS_S2_REGNUM, [_L_S2]);
+  regcache->raw_supply (MIPS_S3_REGNUM, [_L_S3]);
+  regcache->raw_supply (MIPS_S4_REGNUM, [_L_S4]);
+  regcache->raw_supply (MIPS_S5_REGNUM, [_L_S5]);
+  regcache->raw_supply (MIPS_S6_REGNUM, [_L_S6]);
+  regcache->raw_supply (MIPS_S7_REGNUM, [_L_S7]);
+
+  regcache->raw_supply (MIPS_S8_REGNUM, [_L_S8]);
+
+  regcache->raw_supply (MIPS_T8_REGNUM, [_L_T8]);
+
+  regcache->raw_supply (MIPS_GP_REGNUM, [_L_GP]);
+
+  regcache->raw_supply (MIPS_SP_REGNUM, [_L_SP]);
+  regcache->raw_supply (MIPS_RA_REGNUM, [_L_RA]);
+  regcache->raw_supply (MIPS_PS_REGNUM, [_L_SR]);
+
+  /* provide the return address of the savectx as the current pc */
+  regcache->raw_supply (MIPS_EMBED_PC_REGNUM, [_L_RA]);
+
+  return 0;
+}
+
 void
 _initialize_mipsnbsd_nat (void)
 {
   add_inf_child_target (_mips_nbsd_nat_target);
+  bsd_kvm_add_target (mipsnbsd_supply_pcb);
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 21 19:20:18 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: sh-nbsd-tdep.c

Log Message:
Sync (c) note in GDB:sh-nbsd-tdep.c with upstream

This file is now GPLv3+, not GPLv2+.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-21 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 21 19:20:18 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: sh-nbsd-tdep.c

Log Message:
Sync (c) note in GDB:sh-nbsd-tdep.c with upstream

This file is now GPLv3+, not GPLv2+.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.6 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.7
--- src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.6	Mon Jun 17 06:33:53 2019
+++ src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c	Fri Jun 21 19:20:18 2019
@@ -8,7 +8,7 @@
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see .  */
 
 #include "defs.h"
 #include "gdbcore.h"



Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-17 Thread Christos Zoulas
In article <20190617063353.57514f...@cvs.netbsd.org>,
matthew green  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  mrg
>Date:  Mon Jun 17 06:33:53 UTC 2019
>
>Modified Files:
>   src/external/gpl3/gdb/dist/gdb: ppc-nbsd-nat.c sh-nbsd-tdep.c
>
>Log Message:
>fix cross gdb build on sh and ppc:
>- gdb_assert.h has moved into common/gdb_assert.h.
>- force promotion to avoid compile errors
>
>XXX why aren't these files built into the native binary, and
>triggered normal build failures.

They are built into the native binary... There is a
-I${DIST}/gdb/common \
in the Makefile. Perhaps we should remove it. Also:

# XXX: I should fix these...
CPPFLAGS.i386-nbsd-tdep.c+= -Wno-narrowing
CPPFLAGS.arm-get-next-pcs.c+= -Wno-narrowing
CPPFLAGS.mips-tdep.c+= -Wno-narrowing
CPPFLAGS.sh-nbsd-tdep.c+= -Wno-narrowing
CPPFLAGS.ppc-nbsd-tdep.c+= -Wno-narrowing
CPPFLAGS.alpha-nbsd-tdep.c+= -Wno-narrowing
CPPFLAGS.alpha-tdep.c+= -Wno-narrowing
CPPFLAGS.rs6000-tdep.c+= -Wno-narrowing
CPPFLAGS.hppa-nbsd-tdep.c+= -Wno-narrowing

christos



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 17 06:33:53 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: ppc-nbsd-nat.c sh-nbsd-tdep.c

Log Message:
fix cross gdb build on sh and ppc:
- gdb_assert.h has moved into common/gdb_assert.h.
- force promotion to avoid compile errors

XXX why aren't these files built into the native binary, and
triggered normal build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 17 06:33:53 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: ppc-nbsd-nat.c sh-nbsd-tdep.c

Log Message:
fix cross gdb build on sh and ppc:
- gdb_assert.h has moved into common/gdb_assert.h.
- force promotion to avoid compile errors

XXX why aren't these files built into the native binary, and
triggered normal build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.8	Thu May 30 21:27:58 2019
+++ src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c	Mon Jun 17 06:33:53 2019
@@ -32,7 +32,7 @@
 #include "inferior.h"
 #include "regcache.h"
 
-#include "gdb_assert.h"
+#include "common/gdb_assert.h"
 
 #include "nbsd-nat.h"
 #include "ppc-tdep.h"

Index: src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.5	Thu May 30 19:34:27 2019
+++ src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c	Mon Jun 17 06:33:53 2019
@@ -32,7 +32,7 @@
 #include "trad-frame.h"
 #include "tramp-frame.h"
 
-#include "gdb_assert.h"
+#include "common/gdb_assert.h"
 
 #include "solib-svr4.h"
 
@@ -143,25 +143,25 @@ static const struct tramp_frame shnbsd_s
   SIGTRAMP_FRAME,
   2,
   {
-{ 0x64f3, -1 },			/* mov r15,r4 */
-{ 0xd002, -1 },			/* mov.l   .LSYS_setcontext */
-{ 0xc380, -1 },			/* trapa   #-128 */
-{ 0xa003, -1 },			/* bra .Lskip1 */
-{ 0x0009, -1 },			/* nop */
-{ 0x0009, -1 },			/* nop */
+{ 0x64f3, (ULONGEST)-1 },			/* mov r15,r4 */
+{ 0xd002, (ULONGEST)-1 },			/* mov.l   .LSYS_setcontext */
+{ 0xc380, (ULONGEST)-1 },			/* trapa   #-128 */
+{ 0xa003, (ULONGEST)-1 },			/* bra .Lskip1 */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
  /* .LSYS_setcontext */
-{ 0x0134, -1 }, { 0x, -1 }, /* 0x134 */
+{ 0x0134, (ULONGEST)-1 }, { 0x, (ULONGEST)-1 }, /* 0x134 */
  /* .Lskip1 */
-{ 0x6403, -1 },			/* mov r0,r4 */
-{ 0xd002, -1 },			/* mov.l   .LSYS_exit  */
-{ 0xc380, -1 },			/* trapa   #-128 */
-{ 0xa003, -1 },			/* bra .Lskip2 */
-{ 0x0009, -1 },			/* nop */
-{ 0x0009, -1 },			/* nop */
+{ 0x6403, (ULONGEST)-1 },			/* mov r0,r4 */
+{ 0xd002, (ULONGEST)-1 },			/* mov.l   .LSYS_exit  */
+{ 0xc380, (ULONGEST)-1 },			/* trapa   #-128 */
+{ 0xa003, (ULONGEST)-1 },			/* bra .Lskip2 */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
  /* .LSYS_exit */
-{ 0x0001, -1 }, { 0x, -1 }, /* 0x1 */
+{ 0x0001, (ULONGEST)-1 }, { 0x, (ULONGEST)-1 }, /* 0x1 */
 /* .Lskip2 */
-{ TRAMP_SENTINEL_INSN, -1 }
+{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
   },
   shnbsd_sigtramp_cache_init
 };



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 14 01:00:52 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Enhance the GDB support for NetBSD

- Enable VFORK events
- Add syscall number for SCE/SCX events
- Add commented out posix_spawn(3) events


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Jun 14 01:00:52 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Enhance the GDB support for NetBSD

- Enable VFORK events
- Add syscall number for SCE/SCX events
- Add commented out posix_spawn(3) events


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.11 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.12
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.11	Tue May 28 15:30:39 2019
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri Jun 14 01:00:52 2019
@@ -233,12 +233,13 @@ nbsd_enable_proc_events (pid_t pid)
 	  sizeof (events)) == -1)
 perror_with_name (("ptrace"));
   events |= PTRACE_FORK;
-#ifdef notyet
   events |= PTRACE_VFORK;
   events |= PTRACE_VFORK_DONE;
-#endif
   events |= PTRACE_LWP_CREATE;
   events |= PTRACE_LWP_EXIT;
+#if notyet
+  events |= PTRACE_POSIX_SPAWN;
+#endif
   if (ptrace (PT_SET_EVENT_MASK, pid, (PTRACE_TYPE_ARG3),
 	  sizeof (events)) == -1)
 perror_with_name (("ptrace"));
@@ -381,11 +382,11 @@ nbsd_nat_target::wait (ptid_t ptid, stru
   break;
 case TRAP_SCE:
   ourstatus->kind = TARGET_WAITKIND_SYSCALL_ENTRY;
-//  ourstatus->value.syscall_number = 0;
+  ourstatus->value.syscall_number = psi.psi_siginfo.si_sysnum;
   break;
 case TRAP_SCX:
   ourstatus->kind = TARGET_WAITKIND_SYSCALL_RETURN;
-//  ourstatus->value.syscall_number = 0;
+  ourstatus->value.syscall_number = psi.psi_siginfo.si_sysnum;
   break;
 case TRAP_EXEC:
   ourstatus->kind = TARGET_WAITKIND_EXECD;



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jun  8 14:59:01 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c

Log Message:
make this compile.  now arm64 gdb works again.  yay.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jun  8 14:59:01 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c

Log Message:
make this compile.  now arm64 gdb works again.  yay.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.5
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.4	Thu May 30 01:19:36 2019
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c	Sat Jun  8 14:59:01 2019
@@ -59,7 +59,7 @@ getfpregs_supplies (struct gdbarch *gdba
 }
 
 void
-aarch64_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
+aarch64_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
 {
   ptid_t ptid = regcache->ptid ();
   pid_t pid = ptid.pid ();
@@ -93,7 +93,7 @@ aarch64_nbsd_nat_target::fetch_registers
this for all registers.  */
 
 void
-aarch64_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
+aarch64_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
 {
   ptid_t ptid = regcache->ptid ();
   pid_t pid = ptid.pid ();
@@ -110,7 +110,7 @@ aarch64_nbsd_nat_target::store_registers
   regcache_collect_regset (_nbsd_gregset, regcache,regnum, ,
 			   sizeof (regs));
 
-  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , tid) == -1)
+  if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write registers"));
 }
 
@@ -118,13 +118,13 @@ aarch64_nbsd_nat_target::store_registers
 {
   struct fpreg fpregs;
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , tid) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   regcache_collect_regset (_nbsd_fpregset, regcache,regnum, ,
 sizeof (fpregs));
 
-  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , tid) == -1)
+  if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:43:23 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:43:23 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.15 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.16
--- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.15	Thu May 30 17:23:52 2019
+++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c	Thu May 30 17:43:23 2019
@@ -111,7 +111,6 @@ bsd_kvm_target_open (const char *arg, in
   kvm_t *temp_kd;
   struct inferior *inf;
   char *filename = NULL;
-  struct gdbarch_info info;
 
   target_preopen (from_tty);
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:23:52 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
need arch-utils.h


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.14 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.15
--- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.14	Thu May 30 17:15:47 2019
+++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c	Thu May 30 17:23:52 2019
@@ -29,6 +29,7 @@
 #include "gdbcore.h"
 #include "inferior.h"  /* for get_exec_file */
 #include "gdbthread.h"
+#include "arch-utils.h"
 
 #include 
 #include 



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:23:52 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
need arch-utils.h


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:15:47 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
set the architecture of the inferior.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.13 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.14
--- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.13	Wed May 29 13:52:09 2019
+++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c	Thu May 30 17:15:47 2019
@@ -110,6 +110,7 @@ bsd_kvm_target_open (const char *arg, in
   kvm_t *temp_kd;
   struct inferior *inf;
   char *filename = NULL;
+  struct gdbarch_info info;
 
   target_preopen (from_tty);
 
@@ -141,6 +142,8 @@ bsd_kvm_target_open (const char *arg, in
   inf->aspace = maybe_new_address_space ();
   inf->pspace = new program_space (inf->aspace);
 
+  inf->gdbarch = get_current_arch ();
+
   add_thread_silent (bsd_kvm_ptid);
   inferior_ptid = bsd_kvm_ptid;
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:16:03 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c

Log Message:
let's do things in the order everyone else does (I don't think it matters)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:16:03 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c

Log Message:
let's do things in the order everyone else does (I don't think it matters)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.7 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.8
--- src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.7	Thu May 30 16:41:14 2019
+++ src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c	Thu May 30 17:16:03 2019
@@ -131,7 +131,7 @@ _initialize_amd64nbsd_nat (void)
   amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64nbsd32_r_reg_offset);
   amd64_native_gregset64_reg_offset = amd64nbsd_r_reg_offset;
 
-  bsd_kvm_add_target (amd64nbsd_supply_pcb);
-
   add_inf_child_target (_amd64_nbsd_nat_target);
+
+  bsd_kvm_add_target (amd64nbsd_supply_pcb);
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 21:15:47 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c

Log Message:
set the architecture of the inferior.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 20:41:14 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c

Log Message:
put back the kvm pcb code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.6 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.7
--- src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c:1.6	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c	Thu May 30 16:41:14 2019
@@ -71,6 +71,57 @@ static int amd64nbsd32_r_reg_offset[] =
   15 * 8			/* %gs */
 };
 
+static int
+amd64nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  struct switchframe sf;
+  int regnum;
+  long zero = 0;
+
+  /* The following is true for NetBSD/amd64:
+
+ The pcb contains the stack pointer at the point of the context
+ switch in cpu_switchto().  At that point we have a stack frame as
+ described by `struct switchframe', which for NetBSD/amd64 has the
+ following layout:
+
+ interrupt level
+ %r15
+ %r14
+ %r13
+ %r12
+ %rbx
+ return address
+
+ Together with %rsp in the pcb, this accounts for all callee-saved
+ registers specified by the psABI.  From this information we
+ reconstruct the register state as it would look when we just
+ returned from cpu_switchto().
+
+ For kernel core dumps, dumpsys() builds a fake switchframe for us. */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_rsp == 0)
+return 0;
+
+  /* Read the stack frame, and check its validity.  */
+  read_memory (pcb->pcb_rsp, (gdb_byte *) , sizeof sf);
+  pcb->pcb_rsp += sizeof (struct switchframe);
+  regcache->raw_supply (12, _r12);
+  regcache->raw_supply (13, _r13);
+  regcache->raw_supply (14, _r14);
+  regcache->raw_supply (15, _r15);
+  regcache->raw_supply (AMD64_RBX_REGNUM, _rbx);
+  regcache->raw_supply (AMD64_RIP_REGNUM, _rip);
+
+  regcache->raw_supply (AMD64_RSP_REGNUM, >pcb_rsp);
+  regcache->raw_supply (AMD64_RBP_REGNUM, >pcb_rbp);
+  regcache->raw_supply (AMD64_FS_REGNUM, >pcb_fs);
+  regcache->raw_supply (AMD64_GS_REGNUM, >pcb_gs);
+
+  return 1;
+}
+
 static amd64_bsd_nat_target the_amd64_nbsd_nat_target;
 
 void
@@ -80,5 +131,7 @@ _initialize_amd64nbsd_nat (void)
   amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64nbsd32_r_reg_offset);
   amd64_native_gregset64_reg_offset = amd64nbsd_r_reg_offset;
 
+  bsd_kvm_add_target (amd64nbsd_supply_pcb);
+
   add_inf_child_target (_amd64_nbsd_nat_target);
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 20:41:14 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-nbsd-nat.c

Log Message:
put back the kvm pcb code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:19:36 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c alpha-bsd-nat.c
arm-nbsd-nat.c hppa-nbsd-nat.c i386-bsd-nat.c m68k-bsd-nat.c
mips-nbsd-nat.c ppc-nbsd-nat.c sh-nbsd-nat.c sparc-nat.c
sparc-nbsd-nat.c sparc64-nbsd-nat.c vax-bsd-nat.c x86-bsd-nat.c

Log Message:
more cleanups and homogenization


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/sparc-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.3	Wed May 29 18:10:38 2019
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c	Wed May 29 21:19:36 2019
@@ -36,6 +36,14 @@
 
 /* Determine if PT_GETREGS fetches REGNUM.  */
 
+struct aarch64_nbsd_nat_target final : public nbsd_nat_target
+{
+  void fetch_registers (struct regcache *, int) override;
+  void store_registers (struct regcache *, int) override;
+};
+
+static aarch64_nbsd_nat_target the_aarch64_nbsd_nat_target;
+
 static bool
 getregs_supplies (struct gdbarch *gdbarch, int regnum)
 {
@@ -50,23 +58,19 @@ getfpregs_supplies (struct gdbarch *gdba
   return (regnum >= AARCH64_V0_REGNUM && regnum <= AARCH64_FPCR_REGNUM);
 }
 
-/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
-   for all registers.  */
-
-static void
-aarch64_nbsd_fetch_inferior_registers (struct target_ops *ops,
-struct regcache *regcache, int regnum)
-{
-  ptid_t ptid = regcache_get_ptid (regcache);
-  pid_t pid = ptid_get_pid (ptid);
-  int tid = ptid_get_lwp (ptid);
+void
+aarch64_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
+{
+  ptid_t ptid = regcache->ptid ();
+  pid_t pid = ptid.pid ();
+  int lwp = ptid.lwp ();
 
   struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , tid) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache_supply_regset (_nbsd_gregset, regcache, regnum, ,
@@ -77,7 +81,7 @@ aarch64_nbsd_fetch_inferior_registers (s
 {
   struct fpreg fpregs;
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , tid) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   regcache_supply_regset (_nbsd_fpregset, regcache, regnum, ,
@@ -88,20 +92,19 @@ aarch64_nbsd_fetch_inferior_registers (s
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
this for all registers.  */
 
-static void
-aarch64_nbsd_store_inferior_registers (struct target_ops *ops,
-struct regcache *regcache, int regnum)
-{
-  ptid_t ptid = regcache_get_ptid (regcache);
-  pid_t pid = ptid_get_pid (ptid);
-  int tid = ptid_get_lwp (ptid);
+void
+aarch64_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
+{
+  ptid_t ptid = regcache->ptid ();
+  pid_t pid = ptid.pid ();
+  int lwp = ptid.lwp ();
 
   struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , tid) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) , lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache_collect_regset (_nbsd_gregset, regcache,regnum, ,
@@ -173,12 +176,7 @@ aarch64_nbsd_supply_pcb (struct regcache
 void
 _initialize_aarch64_nbsd_nat (void)
 {
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = aarch64_nbsd_fetch_inferior_registers;
-  t->to_store_registers = aarch64_nbsd_store_inferior_registers;
-  nbsd_nat_add_target (t);
+  add_inf_child_target 

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:19:36 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c alpha-bsd-nat.c
arm-nbsd-nat.c hppa-nbsd-nat.c i386-bsd-nat.c m68k-bsd-nat.c
mips-nbsd-nat.c ppc-nbsd-nat.c sh-nbsd-nat.c sparc-nat.c
sparc-nbsd-nat.c sparc64-nbsd-nat.c vax-bsd-nat.c x86-bsd-nat.c

Log Message:
more cleanups and homogenization


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/sparc-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:10:38 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c arm-nbsd-nat.c

Log Message:
Some more mechanical c++ificiation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:10:38 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c arm-nbsd-nat.c

Log Message:
Some more mechanical c++ificiation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.2	Thu Dec 27 04:55:27 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c	Wed May 29 18:10:38 2019
@@ -61,7 +61,7 @@ aarch64_nbsd_fetch_inferior_registers (s
   pid_t pid = ptid_get_pid (ptid);
   int tid = ptid_get_lwp (ptid);
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
@@ -96,7 +96,7 @@ aarch64_nbsd_store_inferior_registers (s
   pid_t pid = ptid_get_pid (ptid);
   int tid = ptid_get_lwp (ptid);
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
@@ -159,13 +159,13 @@ aarch64_nbsd_supply_pcb (struct regcache
 
   for (i = 0; i <= 30; i++)
 {
-  regcache_raw_supply (regcache, AARCH64_X0_REGNUM + i, _reg[i]);
+  regcache->raw_supply (AARCH64_X0_REGNUM + i, _reg[i]);
 }
-  regcache_raw_supply (regcache, AARCH64_SP_REGNUM, _sp);
-  regcache_raw_supply (regcache, AARCH64_PC_REGNUM, _pc);
+  regcache->raw_supply (AARCH64_SP_REGNUM, _sp);
+  regcache->raw_supply (AARCH64_PC_REGNUM, _pc);
 
-  regcache_raw_supply (regcache, AARCH64_FPCR_REGNUM, >pcb_fpregs.fpcr);
-  regcache_raw_supply (regcache, AARCH64_FPSR_REGNUM, >pcb_fpregs.fpsr);
+  regcache->raw_supply (AARCH64_FPCR_REGNUM, >pcb_fpregs.fpcr);
+  regcache->raw_supply (AARCH64_FPSR_REGNUM, >pcb_fpregs.fpsr);
 
   return 1;
 }

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.8	Tue May 28 11:30:39 2019
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c	Wed May 29 18:10:38 2019
@@ -93,17 +93,17 @@ armnbsd_supply_pcb (struct regcache *reg
 
   read_memory (pcb->pcb_sp, (gdb_byte *) , sizeof sf);
 
-  regcache_raw_supply (regcache, ARM_PC_REGNUM, _pc);
-  regcache_raw_supply (regcache, ARM_SP_REGNUM, >pcb_sp);
-  regcache_raw_supply (regcache, 12, >pcb_r12);
-  regcache_raw_supply (regcache, 11, >pcb_r11);
-  regcache_raw_supply (regcache, 10, >pcb_r10);
-  regcache_raw_supply (regcache, 9, >pcb_r9);
-  regcache_raw_supply (regcache, 8, >pcb_r8);
-  regcache_raw_supply (regcache, 7, _r7);
-  regcache_raw_supply (regcache, 6, _r6);
-  regcache_raw_supply (regcache, 5, _r5);
-  regcache_raw_supply (regcache, 4, _r4);
+  regcache->raw_supply (ARM_PC_REGNUM, _pc);
+  regcache->raw_supply (ARM_SP_REGNUM, >pcb_sp);
+  regcache->raw_supply (12, >pcb_r12);
+  regcache->raw_supply (11, >pcb_r11);
+  regcache->raw_supply (10, >pcb_r10);
+  regcache->raw_supply (9, >pcb_r9);
+  regcache->raw_supply (8, >pcb_r8);
+  regcache->raw_supply (7, _r7);
+  regcache->raw_supply (6, _r6);
+  regcache->raw_supply (5, _r5);
+  regcache->raw_supply (4, _r4);
 
   return 1;
 }



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:08:28 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc-nat.c sparc-nat.h
sparc-nbsd-nat.c sparc-nbsd-tdep.c sparc64-nbsd-nat.c

Log Message:
make those compile again...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/sparc-nat.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/sparc-nat.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sparc-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.12 src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.13
--- src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.12	Tue May 28 11:30:39 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc-nat.c	Wed May 29 18:08:28 2019
@@ -252,7 +252,7 @@ sparc_store_inferior_registers (struct r
TARGET_OBJECT_WCOOKIE.  Fetch StackGhost Per-Process XOR cookie.  */
 
 enum target_xfer_status
-sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
+sparc_xfer_wcookie (enum target_object object,
 		const char *annex, gdb_byte *readbuf,
 		const gdb_byte *writebuf, ULONGEST offset, ULONGEST len,
 		ULONGEST *xfered_len)

Index: src/external/gpl3/gdb/dist/gdb/sparc-nat.h
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nat.h:1.1.1.7 src/external/gpl3/gdb/dist/gdb/sparc-nat.h:1.2
--- src/external/gpl3/gdb/dist/gdb/sparc-nat.h:1.1.1.7	Sun May 26 16:59:31 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc-nat.h	Wed May 29 18:08:28 2019
@@ -75,7 +75,7 @@ struct sparc_target : public BaseTarget
   return sparc_xfer_wcookie (object, annex, readbuf, writebuf,
  offset, len, xfered_len);
 
-return BaseTarget (object, annex, readbuf, writebuf,
+return BaseTarget::xfer_partial (object, annex, readbuf, writebuf,
 		   offset, len, xfered_len);
   }
 };

Index: src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c:1.5	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c	Wed May 29 18:08:28 2019
@@ -91,7 +91,7 @@ sparc32nbsd_supply_pcb (struct regcache 
   return 1;
 }
 
-static sparc_target the_sparc_nbsd_nat_target;
+static sparc_target the_sparc_nbsd_nat_target;
 
 void
 _initialize_sparcnbsd_nat (void)
@@ -100,7 +100,7 @@ _initialize_sparcnbsd_nat (void)
   sparc_gregmap = _gregmap;
   sparc_fpregmap = _bsd_fpregmap;
 
-  add_inf_child_target (_nbsd_nat_target);
+  add_inf_child_target (_sparc_nbsd_nat_target);
 
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (sparc32nbsd_supply_pcb);
Index: src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.5	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c	Wed May 29 18:08:28 2019
@@ -20,6 +20,8 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "regcache.h"
+#include "inferior.h"
+#include "inf-ptrace.h"
 #include "target.h"
 
 #include "nbsd-nat.h"
@@ -27,17 +29,6 @@
 #include "sparc-nbsd-tdep.h"
 #include "sparc-nat.h"
 
-#include 
-
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-#include "gregset.h"
- 
 /* NetBSD is different from the other OSes that support both SPARC and
UltraSPARC in that the result of ptrace(2) depends on whether the
traced process is 32-bit or 64-bit.  */
@@ -139,29 +130,7 @@ sparc64nbsd_fpregset_supplies_p (struct 
   return 0;
 }
 
-void
-supply_gregset (struct regcache *regcache, const gregset_t *gregs)
-{
-  sparc64nbsd_supply_gregset (sparc_gregmap, regcache, -1, gregs);
-}
-
-void
-supply_fpregset (struct regcache *regcache, const fpregset_t *fpregs)
-{
-  sparc64nbsd_supply_fpregset (sparc_fpregmap, regcache, -1, fpregs);
-}
 
-void
-fill_gregset (const struct regcache *regcache, gregset_t *gregs, int regnum)
-{
-  sparc64nbsd_collect_gregset (sparc_gregmap, regcache, regnum, gregs);
-}
-
-void
-fill_fpregset (const struct regcache *regcache, fpregset_t *fpregs, int regnum)
-{
-  sparc64nbsd_collect_fpregset (sparc_fpregmap, regcache, regnum, fpregs);
-}
 /* Support for debugging kernel virtual memory images.  */
 
 #include 
@@ -203,13 +172,11 @@ sparc64nbsd_supply_pcb (struct regcache 
 }
 
 /* We've got nothing to add to the generic SPARC target.  */
-static sparc_target the_sparc64_nbsd_nat_target;
+static sparc_target the_sparc64_nbsd_nat_target;
 
 void
 

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:07:47 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.nat
Removed Files:
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh

Log Message:
Move definitions into configure.nat; harmonize and refactor the NetBSD
nat definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.10 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r1.7 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:08:28 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc-nat.c sparc-nat.h
sparc-nbsd-nat.c sparc-nbsd-tdep.c sparc64-nbsd-nat.c

Log Message:
make those compile again...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/sparc-nat.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/sparc-nat.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:07:47 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.nat
Removed Files:
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh

Log Message:
Move definitions into configure.nat; harmonize and refactor the NetBSD
nat definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.10 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r1.7 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/configure.nat
diff -u src/external/gpl3/gdb/dist/gdb/configure.nat:1.1.1.1 src/external/gpl3/gdb/dist/gdb/configure.nat:1.2
--- src/external/gpl3/gdb/dist/gdb/configure.nat:1.1.1.1	Sun May 26 16:59:23 2019
+++ src/external/gpl3/gdb/dist/gdb/configure.nat	Wed May 29 18:07:47 2019
@@ -329,11 +329,12 @@ case ${gdb_host} in
 	esac
 	;;
 nbsd)
+	NATDEPFILES="${NATDEPFILES} nbsd-nat.o bsd-kvm.o"
+	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	alpha)
 		# Host: NetBSD/alpha
-		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o"
 		;;
 	mips)
 		# Host: NetBSD/mips
@@ -341,12 +342,11 @@ case ${gdb_host} in
 		;;
 	pa)
 		# Host: NetBSD/hppa
-		NATDEPFILES="${NATDEPFILES} nbsd-nat.o hppa-nbsd-nat.o"
+		NATDEPFILES="${NATDEPFILES} hppa-nbsd-nat.o"
 		;;
 	powerpc)
 		# Host: NetBSD/powerpc
-		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o"
 		;;
 	sh)
 		# Host: NetBSD/sh
@@ -356,22 +356,24 @@ case ${gdb_host} in
 	esac
 	;;
 nbsd64)
+	NATDEPFILES="${NATDEPFILES} nbsd-nat.o bsd-kvm.o"
+	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	i386)
 		# Host: NetBSD/amd64
-		NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o x86-nat.o \
-		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o"
+		NATDEPFILES="${NATDEPFILES} amd64-nbsd-nat.o amd64-bsd-nat.o \
+		amd64-nat.o x86-bsd-nat.o x86-nat.o nat/x86-dregs.o"
 		;;
 	sparc)
 		# Host: NetBSD/sparc64
-		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o \
-		bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o"
 		;;
 
 	esac
 	;;
 nbsdelf)
+	NATDEPFILES="${NATDEPFILES} nbsd-nat.o bsd-kvm.o"
+	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	arm)
 		# Host: NetBSD/arm
@@ -379,26 +381,20 @@ case ${gdb_host} in
 		;;
 	i386)
 		# Host: NetBSD/i386 ELF
-		NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-nat.o \
-		nat/x86-dregs.o \
-		x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} i386-nbsd-nat.o i386-bsd-nat.o \
+		x86-bsd-nat.o x86-nat.o nat/x86-dregs.o"
 		;;
 	m68k)
 		# Host: NetBSD/m68k ELF
-		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o"
 		;;
 	sparc)
 		# Host: NetBSD/sparc ELF
-		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o \
-		bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o"
 		;;
 	vax)
 		# Host: NetBSD/vax ELF
-		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o"
 		;;
 
 	esac



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 01:46:50 UTC 2019

Added Files:
src/external/gpl3/gdb/dist/gdb: ia64-nbsd-tdep.c
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/ia64: netbsd.mh

Log Message:
add netbsd specific files


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/ia64-nbsd-tdep.c
cvs rdiff -u -r0 -r1.10 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r0 -r1.7 src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/config/ia64/netbsd.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/external/gpl3/gdb/dist/gdb/ia64-nbsd-tdep.c
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/ia64-nbsd-tdep.c:1.1
--- /dev/null	Tue May 28 21:46:50 2019
+++ src/external/gpl3/gdb/dist/gdb/ia64-nbsd-tdep.c	Tue May 28 21:46:49 2019
@@ -0,0 +1,46 @@
+/* Target-dependent code for NetBSD/ia64.
+
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see .  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "osabi.h"
+
+#include "ia64-tdep.h"
+#include "solib-svr4.h"
+
+/* NetBSD ELF.  */
+
+static void
+ia64nbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  /* NetBSD ELF uses SVR4-style shared libraries.  */
+  set_solib_svr4_fetch_link_map_offsets
+(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_ia64nbsd_tdep (void);
+
+void
+_initialize_ia64nbsd_tdep (void)
+{
+  gdbarch_register_osabi (bfd_arch_ia64, 0, GDB_OSABI_NETBSD,
+			  ia64nbsd_elf_init_abi);
+}

Index: src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh:1.10
--- /dev/null	Tue May 28 21:46:50 2019
+++ src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh	Tue May 28 21:46:49 2019
@@ -0,0 +1,6 @@
+# Host: NetBSD/amd64
+NATDEPFILES= fork-child.o inf-ptrace.o \
+	nbsd-nat.o amd64-nat.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o \
+	bsd-kvm.o x86-nat.o x86-dregs.o
+
+LOADLIBES= -lkvm

Index: src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh:1.7
--- /dev/null	Tue May 28 21:46:50 2019
+++ src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh	Tue May 28 21:46:49 2019
@@ -0,0 +1,7 @@
+# Host: NetBSD/i386 ELF
+NATDEPFILES= fork-child.o inf-ptrace.o \
+	nbsd-nat.o x86-bsd-nat.o x86-nat.o x86-dregs.o \
+	i386-bsd-nat.o i386-nbsd-nat.o \
+	bsd-kvm.o
+
+LOADLIBES= -lkvm

Index: src/external/gpl3/gdb/dist/gdb/config/ia64/netbsd.mh
diff -u /dev/null src/external/gpl3/gdb/dist/gdb/config/ia64/netbsd.mh:1.1
--- /dev/null	Tue May 28 21:46:50 2019
+++ src/external/gpl3/gdb/dist/gdb/config/ia64/netbsd.mh	Tue May 28 21:46:50 2019
@@ -0,0 +1,5 @@
+# Host: NetBSD/ia64 ELF
+NATDEPFILES= fork-child.o inf-ptrace.o nbsd-nat.o ia64-bsd-nat.o bsd-kvm.o \
+	ia64-nbsd-tdep.o
+
+LOADLIBES= -lkvm



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 01:46:50 UTC 2019

Added Files:
src/external/gpl3/gdb/dist/gdb: ia64-nbsd-tdep.c
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh
src/external/gpl3/gdb/dist/gdb/config/ia64: netbsd.mh

Log Message:
add netbsd specific files


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/ia64-nbsd-tdep.c
cvs rdiff -u -r0 -r1.10 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r0 -r1.7 src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/config/ia64/netbsd.mh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 01:41:33 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.h

Log Message:
we don't have xfer_partial


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/nbsd-nat.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 01:41:33 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.h

Log Message:
we don't have xfer_partial


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/nbsd-nat.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.h
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.h:1.4 src/external/gpl3/gdb/dist/gdb/nbsd-nat.h:1.5
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.h:1.4	Tue May 28 11:30:39 2019
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.h	Tue May 28 21:41:33 2019
@@ -29,13 +29,6 @@ struct nbsd_nat_target : public inf_ptra
   char *pid_to_exec_file (int pid) override;
   int find_memory_regions (find_memory_region_ftype func, void *data) override;
 
-  enum target_xfer_status xfer_partial (enum target_object object,
-	const char *annex,
-	gdb_byte *readbuf,
-	const gdb_byte *writebuf,
-	ULONGEST offset, ULONGEST len,
-	ULONGEST *xfered_len) override;
-
   bool thread_alive (ptid_t ptid) override;
   const char *pid_to_str (ptid_t) override;
 



CVS commit: src/external/gpl3/gdb/dist/gdb/common

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 01:41:01 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb/common: pathstuff.h

Log Message:
Add a declaration for canonicalize_file_name(), it really does not belong
here, but it is the most convenient (since it is only used in pathstuff.c)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/common/pathstuff.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/common/pathstuff.h
diff -u src/external/gpl3/gdb/dist/gdb/common/pathstuff.h:1.1.1.1 src/external/gpl3/gdb/dist/gdb/common/pathstuff.h:1.2
--- src/external/gpl3/gdb/dist/gdb/common/pathstuff.h:1.1.1.1	Sun May 26 17:00:08 2019
+++ src/external/gpl3/gdb/dist/gdb/common/pathstuff.h	Tue May 28 21:41:01 2019
@@ -92,4 +92,6 @@ extern const char *get_shell ();
 
 extern gdb::char_vector make_temp_filename (const std::string );
 
+extern "C" char *canonicalize_file_name (const char *path);
+
 #endif /* COMMON_PATHSTUFF_H */



CVS commit: src/external/gpl3/gdb/dist/gdb/common

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 01:41:01 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb/common: pathstuff.h

Log Message:
Add a declaration for canonicalize_file_name(), it really does not belong
here, but it is the most convenient (since it is only used in pathstuff.c)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/common/pathstuff.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 28 15:30:39 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-bsd-nat.c amd64-bsd-nat.c
amd64-nbsd-tdep.c arm-nbsd-nat.c event-loop.h hppa-nbsd-nat.c
i386-bsd-nat.c inf-ptrace.c m68k-bsd-nat.c mips-nbsd-nat.c
nbsd-nat.c nbsd-nat.h ppc-nbsd-nat.c sh-nbsd-nat.c sparc-nat.c
vax-bsd-nat.c x86-bsd-nat.c

Log Message:
Start adjusting to the c++ world.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/nbsd-nat.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/event-loop.h \
src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/sparc-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 28 15:30:39 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: alpha-bsd-nat.c amd64-bsd-nat.c
amd64-nbsd-tdep.c arm-nbsd-nat.c event-loop.h hppa-nbsd-nat.c
i386-bsd-nat.c inf-ptrace.c m68k-bsd-nat.c mips-nbsd-nat.c
nbsd-nat.c nbsd-nat.h ppc-nbsd-nat.c sh-nbsd-nat.c sparc-nat.c
vax-bsd-nat.c x86-bsd-nat.c

Log Message:
Start adjusting to the c++ world.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/amd64-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/nbsd-nat.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/amd64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/event-loop.h \
src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/dist/gdb/sparc-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.6 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.7
--- src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c:1.6	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c	Tue May 28 11:30:39 2019
@@ -103,7 +103,7 @@ alpha_bsd_nat_target::fetch_registers (s
   struct reg gregs;
 
   if (ptrace (PT_GETREGS, regcache->ptid ().pid (),
-		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1) 
+		  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1) 
 	perror_with_name (_("Couldn't get registers"));
 
   alphabsd_supply_reg (regcache, (char *) , regno);
@@ -117,7 +117,7 @@ alpha_bsd_nat_target::fetch_registers (s
   struct fpreg fpregs;
 
   if (ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
-		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
+		  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   alphabsd_supply_fpreg (regcache, (char *) , regno);
@@ -134,13 +134,13 @@ alpha_bsd_nat_target::store_registers (s
 {
   struct reg gregs;
   if (ptrace (PT_GETREGS, regcache->ptid ().pid (),
-  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
+  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1)
 perror_with_name (_("Couldn't get registers"));
 
   alphabsd_fill_reg (regcache, (char *) , regno);
 
   if (ptrace (PT_SETREGS, regcache->ptid ().pid (),
-  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1) 
+  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1) 
 perror_with_name (_("Couldn't write registers"));
 
   if (regno != -1)
@@ -153,13 +153,13 @@ alpha_bsd_nat_target::store_registers (s
   struct fpreg fpregs;
 
   if (ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
-		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
+		  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   alphabsd_fill_fpreg (regcache, (char *) , regno);
 
   if (ptrace (PT_SETFPREGS, regcache->ptid ().pid (),
-		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1) 
+		  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1) 
 	perror_with_name (_("Couldn't write floating point status"));
 }
 }
Index: src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.6 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.7
--- src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.6	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c	Tue May 28 11:30:39 2019
@@ -73,7 +73,7 @@ mips_nbsd_nat_target::fetch_registers (s
   struct reg regs;
 
   if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid),
-		  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
+		  (PTRACE_TYPE_ARG3) , inferior_ptid.lwp ()) == -1)
 	perror_with_name (_("Couldn't get registers"));
   
   mipsnbsd_supply_reg (regcache, (char *) , regno);
@@ -87,7 +87,7 @@ mips_nbsd_nat_target::fetch_registers (s
   struct fpreg fpregs;
 
   if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid),
-		  (PTRACE_TYPE_ARG3) , 

Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2016-11-07 Thread Martin Husemann
On Mon, Nov 07, 2016 at 06:38:54PM +1100, matthew green wrote:
> can we put this function into a netbsd-common file that all
> ports can reference, rather than repeating it?  ie, this is
> identical to the arm version, and probably others.

Yes please, IIUC Nick and Rin are working on that.

Martin


re: CVS commit: src/external/gpl3/gdb/dist/gdb

2016-11-06 Thread matthew green
"Martin Husemann" writes:
> Module Name:  src
> Committed By: martin
> Date: Sat Oct 29 17:02:07 UTC 2016
> 
> Modified Files:
>   src/external/gpl3/gdb/dist/gdb: alphanbsd-tdep.c
> 
> Log Message:
> Add a skip_solib_resolver, from Rin Okuyama, fixes single stepping for
> shared binaries.

can we put this function into a netbsd-common file that all
ports can reference, rather than repeating it?  ie, this is
identical to the arm version, and probably others.

i noticed that the openbsd version of this is one version.

thanks.


.mrg.


Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2014-02-02 Thread David Laight
On Sun, Feb 02, 2014 at 05:00:38PM -0500, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Sun Feb  2 22:00:38 UTC 2014
 
 Modified Files:
   src/external/gpl3/gdb/dist/gdb: inf-ptrace.c
 
 Log Message:
 Fix threading bug again.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
@@ -374,7 +380,7 @@
 XXX __NetBSD__: We used to pass this as the signal
 sig = ptid_get_lwp(ptid);
*/
-  ptrace (request, pid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal));
+  ptrace (request, pid, (PTRACE_TYPE_ARG3)1, sig);


You probably want to kill the comment from the last merge.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/external/gpl3/gdb/dist/gdb

2014-02-02 Thread Christos Zoulas
In article 20140202223912.gd16...@snowdrop.l8s.co.uk,
David Laight  da...@l8s.co.uk wrote:
On Sun, Feb 02, 2014 at 05:00:38PM -0500, Christos Zoulas wrote:
 Module Name: src
 Committed By:christos
 Date:Sun Feb  2 22:00:38 UTC 2014
 
 Modified Files:
  src/external/gpl3/gdb/dist/gdb: inf-ptrace.c
 
 Log Message:
 Fix threading bug again.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c
@@ -374,7 +380,7 @@
 XXX __NetBSD__: We used to pass this as the signal
 sig = ptid_get_lwp(ptid);
*/
-  ptrace (request, pid, (PTRACE_TYPE_ARG3)1, gdb_signal_to_host (signal));
+  ptrace (request, pid, (PTRACE_TYPE_ARG3)1, sig);


You probably want to kill the comment from the last merge.

Right.

christos