}
new_process = add_process (pid);
- add_thread (pid, new_process);
+ add_thread (pid, new_process, pid);
return pid;
}
}
new_process = (struct process_info *) add_process (pid);
- add_thread (tid, new_process);
+ add_thread (tid, new_process, pid);
/* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH
brings it to a halt. We should ignore that SIGSTOP and resume the process
then we need to make sure we restart the other threads. We could
pick a thread at random or restart all; restarting all is less
arbitrary. */
- if (cont_thread > 0)
+ if (cont_thread != 0 && cont_thread != -1)
{
child = (struct thread_info *) find_inferior_id (&all_threads,
cont_thread);
goto error_exit;
}
}
- supply_register (regno, buf);
+ if (the_low_target.left_pad_xfer
+ && register_size (regno) < sizeof (PTRACE_XFER_TYPE))
+ supply_register (regno, (buf + sizeof (PTRACE_XFER_TYPE)
+ - register_size (regno)));
+ else
+ supply_register (regno, buf);
error_exit:;
}
& - sizeof (PTRACE_XFER_TYPE);
buf = alloca (size);
memset (buf, 0, size);
- collect_register (regno, buf);
+ if (the_low_target.left_pad_xfer
+ && register_size (regno) < sizeof (PTRACE_XFER_TYPE))
+ collect_register (regno, (buf + sizeof (PTRACE_XFER_TYPE)
+ - register_size (regno)));
+ else
+ collect_register (regno, buf);
for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
to debugger memory starting at MYADDR. */
static int
-linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
+linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
returns the value of errno. */
static int
-linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
+linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
{
extern unsigned long signal_pid;
- if (cont_thread > 0)
+ if (cont_thread != 0 && cont_thread != -1)
{
struct process_info *process;
to debugger memory starting at MYADDR. */
static int
-linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len)
+linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
{
char filename[PATH_MAX];
int fd, n;