亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? linux-low.c

?? gdb-6.0 linux 下的調試工具
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* Low level interface to ptrace, for the remote server for GDB.   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002   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 2 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, write to the Free Software   Foundation, Inc., 59 Temple Place - Suite 330,   Boston, MA 02111-1307, USA.  */#include "server.h"#include "linux-low.h"#include <sys/wait.h>#include <stdio.h>#include <sys/param.h>#include <sys/dir.h>#include <sys/ptrace.h>#include <sys/user.h>#include <signal.h>#include <sys/ioctl.h>#include <fcntl.h>#include <string.h>#include <stdlib.h>#include <unistd.h>/* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead,   however.  This requires changing the ID in place when we go from !using_threads   to using_threads, immediately.   ``all_processes'' is keyed by the process ID - which on Linux is (presently)   the same as the LWP ID.  */struct inferior_list all_processes;/* FIXME this is a bit of a hack, and could be removed.  */int stopping_threads;/* FIXME make into a target method?  */int using_threads;static void linux_resume_one_process (struct inferior_list_entry *entry,				      int step, int signal);static void linux_resume (int step, int signal);static void stop_all_processes (void);static int linux_wait_for_event (struct thread_info *child);struct pending_signals{  int signal;  struct pending_signals *prev;};#define PTRACE_ARG3_TYPE long#define PTRACE_XFER_TYPE long#ifdef HAVE_LINUX_REGSETSstatic int use_regsets_p = 1;#endifextern int errno;int debug_threads = 0;#define pid_of(proc) ((proc)->head.id)/* FIXME: Delete eventually.  */#define inferior_pid (pid_of (get_thread_process (current_inferior)))/* This function should only be called if the process got a SIGTRAP.   The SIGTRAP could mean several things.   On i386, where decr_pc_after_break is non-zero:   If we were single-stepping this process using PTRACE_SINGLESTEP,   we will get only the one SIGTRAP (even if the instruction we   stepped over was a breakpoint).  The value of $eip will be the   next instruction.   If we continue the process using PTRACE_CONT, we will get a   SIGTRAP when we hit a breakpoint.  The value of $eip will be   the instruction after the breakpoint (i.e. needs to be   decremented).  If we report the SIGTRAP to GDB, we must also   report the undecremented PC.  If we cancel the SIGTRAP, we   must resume at the decremented PC.   (Presumably, not yet tested) On a non-decr_pc_after_break machine   with hardware or kernel single-step:   If we single-step over a breakpoint instruction, our PC will   point at the following instruction.  If we continue and hit a   breakpoint instruction, our PC will point at the breakpoint   instruction.  */static CORE_ADDRget_stop_pc (void){  CORE_ADDR stop_pc = (*the_low_target.get_pc) ();  if (get_thread_process (current_inferior)->stepping)    return stop_pc;  else    return stop_pc - the_low_target.decr_pc_after_break;}static void *add_process (int pid){  struct process_info *process;  process = (struct process_info *) malloc (sizeof (*process));  memset (process, 0, sizeof (*process));  process->head.id = pid;  /* Default to tid == lwpid == pid.  */  process->tid = pid;  process->lwpid = pid;  add_inferior_to_list (&all_processes, &process->head);  return process;}/* Start an inferior process and returns its pid.   ALLARGS is a vector of program-name and args. */static intlinux_create_inferior (char *program, char **allargs){  void *new_process;  int pid;  pid = fork ();  if (pid < 0)    perror_with_name ("fork");  if (pid == 0)    {      ptrace (PTRACE_TRACEME, 0, 0, 0);      signal (__SIGRTMIN + 1, SIG_DFL);      setpgid (0, 0);      execv (program, allargs);      fprintf (stderr, "Cannot exec %s: %s.\n", program,	       strerror (errno));      fflush (stderr);      _exit (0177);    }  new_process = add_process (pid);  add_thread (pid, new_process);  return pid;}/* Attach to an inferior process.  */voidlinux_attach_lwp (int pid, int tid){  struct process_info *new_process;  if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)    {      fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,	       strerror (errno), errno);      fflush (stderr);      /* If we fail to attach to an LWP, just return.  */      if (!using_threads)	_exit (0177);      return;    }  new_process = (struct process_info *) add_process (pid);  add_thread (tid, new_process);  /* 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     (unless this is the first process, in which case the flag will be cleared     in linux_attach).     On the other hand, if we are currently trying to stop all threads, we     should treat the new thread as if we had sent it a SIGSTOP.  This works     because we are guaranteed that add_process added us to the end of the     list, and so the new thread has not yet reached wait_for_sigstop (but     will).  */  if (! stopping_threads)    new_process->stop_expected = 1;}intlinux_attach (int pid){  struct process_info *process;  linux_attach_lwp (pid, pid);  /* Don't ignore the initial SIGSTOP if we just attached to this process.  */  process = (struct process_info *) find_inferior_id (&all_processes, pid);  process->stop_expected = 0;  return 0;}/* Kill the inferior process.  Make us have no inferior.  */static voidlinux_kill_one_process (struct inferior_list_entry *entry){  struct thread_info *thread = (struct thread_info *) entry;  struct process_info *process = get_thread_process (thread);  int wstat;  do    {      ptrace (PTRACE_KILL, pid_of (process), 0, 0);      /* Make sure it died.  The loop is most likely unnecessary.  */      wstat = linux_wait_for_event (thread);    } while (WIFSTOPPED (wstat));}static voidlinux_kill (void){  for_each_inferior (&all_threads, linux_kill_one_process);}static voidlinux_detach_one_process (struct inferior_list_entry *entry){  struct thread_info *thread = (struct thread_info *) entry;  struct process_info *process = get_thread_process (thread);  ptrace (PTRACE_DETACH, pid_of (process), 0, 0);}static voidlinux_detach (void){  for_each_inferior (&all_threads, linux_detach_one_process);}/* Return nonzero if the given thread is still alive.  */static intlinux_thread_alive (int tid){  if (find_inferior_id (&all_threads, tid) != NULL)    return 1;  else    return 0;}/* Return nonzero if this process stopped at a breakpoint which   no longer appears to be inserted.  Also adjust the PC   appropriately to resume where the breakpoint used to be.  */static intcheck_removed_breakpoint (struct process_info *event_child){  CORE_ADDR stop_pc;  struct thread_info *saved_inferior;  if (event_child->pending_is_breakpoint == 0)    return 0;  if (debug_threads)    fprintf (stderr, "Checking for breakpoint.\n");  saved_inferior = current_inferior;  current_inferior = get_process_thread (event_child);  stop_pc = get_stop_pc ();  /* If the PC has changed since we stopped, then we shouldn't do     anything.  This happens if, for instance, GDB handled the     decr_pc_after_break subtraction itself.  */  if (stop_pc != event_child->pending_stop_pc)    {      if (debug_threads)	fprintf (stderr, "Ignoring, PC was changed.\n");      event_child->pending_is_breakpoint = 0;      current_inferior = saved_inferior;      return 0;    }  /* If the breakpoint is still there, we will report hitting it.  */  if ((*the_low_target.breakpoint_at) (stop_pc))    {      if (debug_threads)	fprintf (stderr, "Ignoring, breakpoint is still present.\n");      current_inferior = saved_inferior;      return 0;    }  if (debug_threads)    fprintf (stderr, "Removed breakpoint.\n");  /* For decr_pc_after_break targets, here is where we perform the     decrement.  We go immediately from this function to resuming,     and can not safely call get_stop_pc () again.  */  if (the_low_target.set_pc != NULL)    (*the_low_target.set_pc) (stop_pc);  /* We consumed the pending SIGTRAP.  */  event_child->status_pending_p = 0;  event_child->status_pending = 0;  current_inferior = saved_inferior;  return 1;}/* Return 1 if this process has an interesting status pending.  This function   may silently resume an inferior process.  */static intstatus_pending_p (struct inferior_list_entry *entry, void *dummy){  struct process_info *process = (struct process_info *) entry;  if (process->status_pending_p)    if (check_removed_breakpoint (process))      {	/* This thread was stopped at a breakpoint, and the breakpoint	   is now gone.  We were told to continue (or step...) all threads,	   so GDB isn't trying to single-step past this breakpoint.	   So instead of reporting the old SIGTRAP, pretend we got to	   the breakpoint just after it was removed instead of just	   before; resume the process.  */	linux_resume_one_process (&process->head, 0, 0);	return 0;      }  return process->status_pending_p;}static voidlinux_wait_for_process (struct process_info **childp, int *wstatp){  int ret;  int to_wait_for = -1;  if (*childp != NULL)    to_wait_for = (*childp)->lwpid;  while (1)    {      ret = waitpid (to_wait_for, wstatp, WNOHANG);      if (ret == -1)	{	  if (errno != ECHILD)	    perror_with_name ("waitpid");	}      else if (ret > 0)	break;      ret = waitpid (to_wait_for, wstatp, WNOHANG | __WCLONE);      if (ret == -1)	{	  if (errno != ECHILD)	    perror_with_name ("waitpid (WCLONE)");	}      else if (ret > 0)	break;      usleep (1000);    }  if (debug_threads      && (!WIFSTOPPED (*wstatp)	  || (WSTOPSIG (*wstatp) != 32	      && WSTOPSIG (*wstatp) != 33)))    fprintf (stderr, "Got an event from %d (%x)\n", ret, *wstatp);  if (to_wait_for == -1)    *childp = (struct process_info *) find_inferior_id (&all_processes, ret);  (*childp)->stopped = 1;  (*childp)->pending_is_breakpoint = 0;  if (debug_threads      && WIFSTOPPED (*wstatp))    {      current_inferior = (struct thread_info *)	find_inferior_id (&all_threads, (*childp)->tid);      /* For testing only; i386_stop_pc prints out a diagnostic.  */      if (the_low_target.get_pc != NULL)	get_stop_pc ();    }}static intlinux_wait_for_event (struct thread_info *child){  CORE_ADDR stop_pc;  struct process_info *event_child;  int wstat;  /* Check for a process with a pending status.  */  /* It is possible that the user changed the pending task's registers since     it stopped.  We correctly handle the change of PC if we hit a breakpoint     (in check_removed_breakpoint); signals should be reported anyway.  */  if (child == NULL)    {      event_child = (struct process_info *)	find_inferior (&all_processes, status_pending_p, NULL);      if (debug_threads && event_child)	fprintf (stderr, "Got a pending child %d\n", event_child->lwpid);    }  else    {      event_child = get_thread_process (child);      if (event_child->status_pending_p	  && check_removed_breakpoint (event_child))	event_child = NULL;    }  if (event_child != NULL)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品99久久久久久久女警| 国产精品综合在线视频| 亚洲美女免费视频| 中文字幕一区二区三区蜜月| 中文字幕电影一区| 国产精品欧美久久久久一区二区| 久久久久久夜精品精品免费| 日韩精品一区二区三区在线| 欧美一区午夜精品| 欧美xxx久久| 久久久国产精品麻豆| 久久亚洲一级片| 久久久91精品国产一区二区三区| 国产亚洲一二三区| 中国av一区二区三区| 中文字幕一区av| 亚洲精品中文在线观看| 亚洲影视资源网| 日韩黄色小视频| 麻豆中文一区二区| 国产精品自在欧美一区| 国产91丝袜在线播放0| 成人精品亚洲人成在线| 99精品视频中文字幕| 一本色道久久综合亚洲91| 欧美日韩中文精品| 日韩午夜激情免费电影| 久久夜色精品国产噜噜av | 洋洋av久久久久久久一区| 伊人婷婷欧美激情| 日韩精品成人一区二区在线| 精品在线你懂的| 成人免费高清在线| 欧美午夜在线一二页| 日韩欧美高清dvd碟片| 国产日韩欧美精品在线| 亚洲精品美腿丝袜| 青椒成人免费视频| 成人伦理片在线| 欧美日韩二区三区| 久久久天堂av| 一区二区三区国产豹纹内裤在线| 日本va欧美va精品发布| 成人网男人的天堂| 欧美日韩二区三区| 国产精品视频yy9299一区| 亚洲一级二级在线| 国产河南妇女毛片精品久久久| 色综合中文综合网| 国产成人亚洲综合a∨猫咪| 色呦呦一区二区三区| 欧美一区二区三区播放老司机| 久久九九久久九九| 香蕉久久一区二区不卡无毒影院| 国产呦精品一区二区三区网站| 91美女福利视频| 日韩精品一区二区三区视频播放 | 久久午夜羞羞影院免费观看| 综合激情成人伊人| 蜜乳av一区二区| 色狠狠av一区二区三区| 久久综合一区二区| 亚洲成人激情自拍| 成+人+亚洲+综合天堂| 日韩一级片网址| 亚洲免费成人av| 国产精品77777竹菊影视小说| 欧美综合亚洲图片综合区| 久久麻豆一区二区| 日韩电影在线观看电影| 91女人视频在线观看| av爱爱亚洲一区| 亚洲视频网在线直播| 国产欧美视频一区二区| 五月婷婷激情综合| 91麻豆自制传媒国产之光| 日韩精品一区二区三区视频| 亚洲精品视频自拍| 国产精品一区二区在线观看不卡| 欧美视频自拍偷拍| 自拍偷拍欧美激情| 国产91富婆露脸刺激对白| 日韩三区在线观看| 午夜精品久久久久久久久久久 | 91在线国产福利| 久久综合久久综合久久综合| 日韩精品一区第一页| 色综合久久88色综合天天| 国产精品精品国产色婷婷| 国产在线国偷精品产拍免费yy | 有码一区二区三区| 不卡一二三区首页| 国产免费久久精品| 高清在线成人网| 国产婷婷精品av在线| 国产综合久久久久久久久久久久 | 亚洲成a人v欧美综合天堂| 99精品一区二区三区| 1000精品久久久久久久久| 成人亚洲一区二区一| 国产欧美视频一区二区| 成人夜色视频网站在线观看| 国产精品久久久久久久久久久免费看 | 日韩一区二区精品葵司在线| 丝袜诱惑亚洲看片| 在线播放一区二区三区| 丝袜a∨在线一区二区三区不卡| 在线视频观看一区| 亚洲在线视频网站| 欧美日韩中文精品| 日韩专区一卡二卡| 欧美一级二级在线观看| 蜜臀精品一区二区三区在线观看| 91精品国产综合久久国产大片| 亚洲成av人影院在线观看网| 欧美久久一二三四区| 视频一区在线视频| 91精品久久久久久久91蜜桃 | 欧美三级韩国三级日本一级| 亚洲午夜久久久久久久久电影院| 色狠狠一区二区| 午夜av一区二区三区| 日韩欧美在线影院| 国产乱人伦精品一区二区在线观看| 久久久精品影视| 波多野结衣在线一区| 依依成人精品视频| 欧美一区二区播放| 精品亚洲国产成人av制服丝袜| 久久视频一区二区| 99免费精品在线| 亚洲高清免费视频| 欧美成人午夜电影| 成人av免费观看| 亚洲一区二区视频在线观看| 欧美日韩1区2区| 国产一区二区0| 一区二区在线观看免费| 欧美一区二区三区播放老司机| 国产激情一区二区三区四区 | 国产精品毛片久久久久久| 欧洲一区二区三区免费视频| 日本不卡一二三| 日本一区二区三区免费乱视频| 色爱区综合激月婷婷| 免费看日韩精品| 中文字幕日韩欧美一区二区三区| 欧美系列亚洲系列| 国产成人8x视频一区二区| 亚洲激情第一区| 精品国产电影一区二区| 91污片在线观看| 久久成人免费电影| 亚洲女同一区二区| 日韩精品资源二区在线| 99re视频精品| 精品制服美女久久| 一区二区三区鲁丝不卡| 久久这里只有精品视频网| 色94色欧美sute亚洲线路一久| 国产在线不卡一区| 亚洲国产日日夜夜| 国产精品色在线观看| 日韩一区二区免费在线观看| 色婷婷综合久色| 国产成人免费xxxxxxxx| 亚洲成a人片综合在线| 中文字幕一区二区三区精华液| 在线综合视频播放| 色综合色综合色综合| 国产一区欧美日韩| 日韩精品1区2区3区| 亚洲精品视频在线观看网站| 国产欧美一区视频| 日韩亚洲欧美一区| 91国产免费看| 不卡一区二区中文字幕| 国内精品伊人久久久久av影院| 夜夜揉揉日日人人青青一国产精品| 久久综合九色综合97_久久久| 欧美日韩成人综合在线一区二区| 不卡的电影网站| 懂色中文一区二区在线播放| 免费人成精品欧美精品 | 国产福利一区二区三区视频| 午夜精品成人在线视频| 中文字幕日韩av资源站| 国产欧美日韩精品在线| 久久综合久久综合久久综合| 欧美一区二区三区视频在线| 欧美伊人久久大香线蕉综合69| 不卡在线观看av| 波多野结衣亚洲| 国产成人av福利| 黄网站免费久久| 国内偷窥港台综合视频在线播放| 蜜臀av一区二区在线观看 | 91精品国产综合久久蜜臀| 91成人国产精品| 色拍拍在线精品视频8848|