projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdbserver/linux-low: turn 'arch_setup' into a method
[deliverable/binutils-gdb.git]
/
gdbserver
/
server.cc
diff --git
a/gdbserver/server.cc
b/gdbserver/server.cc
index bc497f87b7f27bff7203b4d9bd595fb31b4681fa..43962adc86c456c72a7a57aa8afe68cb8e5ff4ce 100644
(file)
--- a/
gdbserver/server.cc
+++ b/
gdbserver/server.cc
@@
-130,6
+130,7
@@
bool disable_packet_vCont;
bool disable_packet_Tthread;
bool disable_packet_qC;
bool disable_packet_qfThreadInfo;
bool disable_packet_Tthread;
bool disable_packet_qC;
bool disable_packet_qfThreadInfo;
+bool disable_packet_T;
static unsigned char *mem_buf;
static unsigned char *mem_buf;
@@
-740,7
+741,7
@@
handle_general_set (char *own_buf)
}
req_str = req ? "non-stop" : "all-stop";
}
req_str = req ? "non-stop" : "all-stop";
- if (
start_non_stop (req
) != 0)
+ if (
the_target->start_non_stop (req == 1
) != 0)
{
fprintf (stderr, "Setting %s mode failed\n", req_str);
write_enn (own_buf);
{
fprintf (stderr, "Setting %s mode failed\n", req_str);
write_enn (own_buf);
@@
-1234,7
+1235,7
@@
handle_detach (char *own_buf)
debug_printf ("Forcing non-stop mode\n");
non_stop = true;
debug_printf ("Forcing non-stop mode\n");
non_stop = true;
-
start_non_stop (1
);
+
the_target->start_non_stop (true
);
}
process->gdb_detached = 1;
}
process->gdb_detached = 1;
@@
-1442,13
+1443,13
@@
handle_qxfer_auxv (const char *annex,
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
- if (
the_target->read_auxv == NULL
|| writebuf != NULL)
+ if (
!the_target->supports_read_auxv ()
|| writebuf != NULL)
return -2;
if (annex[0] != '\0' || current_thread == NULL)
return -1;
return -2;
if (annex[0] != '\0' || current_thread == NULL)
return -1;
- return
(*the_target->read_auxv)
(offset, readbuf, len);
+ return
the_target->read_auxv
(offset, readbuf, len);
}
/* Handle qXfer:exec-file:read. */
}
/* Handle qXfer:exec-file:read. */
@@
-1462,7
+1463,7
@@
handle_qxfer_exec_file (const char *annex,
ULONGEST pid;
int total_len;
ULONGEST pid;
int total_len;
- if (
the_target->pid_to_exec_file == NULL
|| writebuf != NULL)
+ if (
!the_target->supports_pid_to_exec_file ()
|| writebuf != NULL)
return -2;
if (annex[0] == '\0')
return -2;
if (annex[0] == '\0')
@@
-1482,7
+1483,7
@@
handle_qxfer_exec_file (const char *annex,
if (pid <= 0)
return -1;
if (pid <= 0)
return -1;
- file =
(*the_target->pid_to_exec_file)
(pid);
+ file =
the_target->pid_to_exec_file
(pid);
if (file == NULL)
return -1;
if (file == NULL)
return -1;
@@
-1574,10
+1575,12
@@
handle_qxfer_libraries_svr4 (const char *annex,
if (writebuf != NULL)
return -2;
if (writebuf != NULL)
return -2;
- if (current_thread == NULL || the_target->qxfer_libraries_svr4 == NULL)
+ if (current_thread == NULL
+ || !the_target->supports_qxfer_libraries_svr4 ())
return -1;
return -1;
- return the_target->qxfer_libraries_svr4 (annex, readbuf, writebuf, offset, len);
+ return the_target->qxfer_libraries_svr4 (annex, readbuf, writebuf,
+ offset, len);
}
/* Handle qXfer:osadata:read. */
}
/* Handle qXfer:osadata:read. */
@@
-1587,10
+1590,10
@@
handle_qxfer_osdata (const char *annex,
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
- if (
the_target->qxfer_osdata == NULL
|| writebuf != NULL)
+ if (
!the_target->supports_qxfer_osdata ()
|| writebuf != NULL)
return -2;
return -2;
- return
(*the_target->qxfer_osdata)
(annex, readbuf, NULL, offset, len);
+ return
the_target->qxfer_osdata
(annex, readbuf, NULL, offset, len);
}
/* Handle qXfer:siginfo:read and qXfer:siginfo:write. */
}
/* Handle qXfer:siginfo:read and qXfer:siginfo:write. */
@@
-1600,13
+1603,13
@@
handle_qxfer_siginfo (const char *annex,
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len)
{
- if (
the_target->qxfer_siginfo == NULL
)
+ if (
!the_target->supports_qxfer_siginfo ()
)
return -2;
if (annex[0] != '\0' || current_thread == NULL)
return -1;
return -2;
if (annex[0] != '\0' || current_thread == NULL)
return -1;
- return
(*the_target->qxfer_siginfo)
(annex, readbuf, writebuf, offset, len);
+ return
the_target->qxfer_siginfo
(annex, readbuf, writebuf, offset, len);
}
/* Handle qXfer:statictrace:read. */
}
/* Handle qXfer:statictrace:read. */
@@
-1792,13
+1795,13
@@
static int
handle_qxfer_fdpic (const char *annex, gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
{
handle_qxfer_fdpic (const char *annex, gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
{
- if (
the_target->read_loadmap == NULL
)
+ if (
!the_target->supports_read_loadmap ()
)
return -2;
if (current_thread == NULL)
return -1;
return -2;
if (current_thread == NULL)
return -1;
- return
(*the_target->read_loadmap)
(annex, offset, readbuf, len);
+ return
the_target->read_loadmap
(annex, offset, readbuf, len);
}
/* Handle qXfer:btrace:read. */
}
/* Handle qXfer:btrace:read. */
@@
-2193,7
+2196,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
tracepoint_look_up_symbols ();
if (current_thread != NULL)
tracepoint_look_up_symbols ();
if (current_thread != NULL)
- the_target->
pt->
look_up_symbols ();
+ the_target->look_up_symbols ();
current_thread = save_thread;
current_thread = save_thread;
@@
-2234,7
+2237,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
}
}
}
}
- if (the_target->
read_offsets != NULL
+ if (the_target->
supports_read_offsets ()
&& strcmp ("qOffsets", own_buf) == 0)
{
CORE_ADDR text, data;
&& strcmp ("qOffsets", own_buf) == 0)
{
CORE_ADDR text, data;
@@
-2364,7
+2367,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
if (target_supports_catch_syscall ())
strcat (own_buf, ";QCatchSyscalls+");
if (target_supports_catch_syscall ())
strcat (own_buf, ";QCatchSyscalls+");
- if (the_target->
qxfer_libraries_svr4 != NULL
)
+ if (the_target->
supports_qxfer_libraries_svr4 ()
)
strcat (own_buf, ";qXfer:libraries-svr4:read+"
";augmented-libraries-svr4-read+");
else
strcat (own_buf, ";qXfer:libraries-svr4:read+"
";augmented-libraries-svr4-read+");
else
@@
-2374,13
+2377,13
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
strcat (own_buf, ";qXfer:libraries:read+");
}
strcat (own_buf, ";qXfer:libraries:read+");
}
- if (the_target->
read_auxv != NULL
)
+ if (the_target->
supports_read_auxv ()
)
strcat (own_buf, ";qXfer:auxv:read+");
strcat (own_buf, ";qXfer:auxv:read+");
- if (the_target->
qxfer_siginfo != NULL
)
+ if (the_target->
supports_qxfer_siginfo ()
)
strcat (own_buf, ";qXfer:siginfo:read+;qXfer:siginfo:write+");
strcat (own_buf, ";qXfer:siginfo:read+;qXfer:siginfo:write+");
- if (the_target->
read_loadmap != NULL
)
+ if (the_target->
supports_read_loadmap ()
)
strcat (own_buf, ";qXfer:fdpic:read+");
/* We always report qXfer:features:read, as targets may
strcat (own_buf, ";qXfer:fdpic:read+");
/* We always report qXfer:features:read, as targets may
@@
-2392,7
+2395,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
if (cs.transport_is_reliable)
strcat (own_buf, ";QStartNoAckMode+");
if (cs.transport_is_reliable)
strcat (own_buf, ";QStartNoAckMode+");
- if (the_target->
qxfer_osdata != NULL
)
+ if (the_target->
supports_qxfer_osdata ()
)
strcat (own_buf, ";qXfer:osdata:read+");
if (target_supports_multi_process ())
strcat (own_buf, ";qXfer:osdata:read+");
if (target_supports_multi_process ())
@@
-2450,7
+2453,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
if (target_supports_stopped_by_hw_breakpoint ())
strcat (own_buf, ";hwbreak+");
if (target_supports_stopped_by_hw_breakpoint ())
strcat (own_buf, ";hwbreak+");
- if (the_target->
pid_to_exec_file != NULL
)
+ if (the_target->
supports_pid_to_exec_file ()
)
strcat (own_buf, ";qXfer:exec-file:read+");
strcat (own_buf, ";vContSupported+");
strcat (own_buf, ";qXfer:exec-file:read+");
strcat (own_buf, ";vContSupported+");
@@
-2467,7
+2470,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
}
/* Thread-local storage support. */
}
/* Thread-local storage support. */
- if (the_target->
get_tls_address != NULL
+ if (the_target->
supports_get_tls_address ()
&& startswith (own_buf, "qGetTLSAddr:"))
{
char *p = own_buf + 12;
&& startswith (own_buf, "qGetTLSAddr:"))
{
char *p = own_buf + 12;
@@
-2532,7
+2535,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
}
/* Windows OS Thread Information Block address support. */
}
/* Windows OS Thread Information Block address support. */
- if (the_target->
get_tib_address != NULL
+ if (the_target->
supports_get_tib_address ()
&& startswith (own_buf, "qGetTIBAddr:"))
{
const char *annex;
&& startswith (own_buf, "qGetTIBAddr:"))
{
const char *annex;
@@
-2540,7
+2543,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
CORE_ADDR tlb;
ptid_t ptid = read_ptid (own_buf + 12, &annex);
CORE_ADDR tlb;
ptid_t ptid = read_ptid (own_buf + 12, &annex);
- n =
(*the_target->get_tib_address)
(ptid, &tlb);
+ n =
the_target->get_tib_address
(ptid, &tlb);
if (n == 1)
{
strcpy (own_buf, paddress(tlb));
if (n == 1)
{
strcpy (own_buf, paddress(tlb));
@@
-2577,8
+2580,7
@@
handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
write_ok (own_buf);
write_ok (own_buf);
- if (the_target->handle_monitor_command == NULL
- || (*the_target->handle_monitor_command) (mon) == 0)
+ if (the_target->handle_monitor_command (mon) == 0)
/* Default processing. */
handle_monitor_command (mon, own_buf);
/* Default processing. */
handle_monitor_command (mon, own_buf);
@@
-2847,7
+2849,7
@@
resume (struct thread_resume *actions, size_t num_actions)
enable_async_io ();
}
enable_async_io ();
}
- the_target->
pt->
resume (actions, num_actions);
+ the_target->resume (actions, num_actions);
if (non_stop)
write_ok (cs.own_buf);
if (non_stop)
write_ok (cs.own_buf);
@@
-3088,7
+3090,7
@@
handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
{
if (strcmp (own_buf, "vCtrlC") == 0)
{
{
if (strcmp (own_buf, "vCtrlC") == 0)
{
- the_target->
pt->
request_interrupt ();
+ the_target->request_interrupt ();
write_ok (own_buf);
return;
}
write_ok (own_buf);
return;
}
@@
-3218,7
+3220,7
@@
queue_stop_reply_callback (thread_info *thread)
{
/* For now, assume targets that don't have this callback also don't
manage the thread's last_status field. */
{
/* For now, assume targets that don't have this callback also don't
manage the thread's last_status field. */
- if (
the_target->thread_stopped == NULL
)
+ if (
!the_target->supports_thread_stopped ()
)
{
struct vstop_notif *new_notif = new struct vstop_notif;
{
struct vstop_notif *new_notif = new struct vstop_notif;
@@
-3230,7
+3232,7
@@
queue_stop_reply_callback (thread_info *thread)
}
else
{
}
else
{
- if (thread_stopped (thread))
+ if (t
arget_t
hread_stopped (thread))
{
if (debug_threads)
{
{
if (debug_threads)
{
@@
-3324,8
+3326,8
@@
handle_status (char *own_buf)
{
thread_info *thread = NULL;
{
thread_info *thread = NULL;
-
pause_all (0
);
- stabilize_threads ();
+
target_pause_all (false
);
+
target_
stabilize_threads ();
gdb_wants_all_threads_stopped ();
/* We can only report one status, but we might be coming out of
gdb_wants_all_threads_stopped ();
/* We can only report one status, but we might be coming out of
@@
-3648,6
+3650,8
@@
captured_main (int argc, char *argv[])
disable_packet_qC = true;
else if (strcmp ("qfThreadInfo", tok) == 0)
disable_packet_qfThreadInfo = true;
disable_packet_qC = true;
else if (strcmp ("qfThreadInfo", tok) == 0)
disable_packet_qfThreadInfo = true;
+ else if (strcmp ("T", tok) == 0)
+ disable_packet_T = true;
else if (strcmp ("threads", tok) == 0)
{
disable_packet_vCont = true;
else if (strcmp ("threads", tok) == 0)
{
disable_packet_vCont = true;
@@
-3885,7
+3889,7
@@
captured_main (int argc, char *argv[])
down without informing GDB. */
if (!non_stop)
{
down without informing GDB. */
if (!non_stop)
{
- if (
start_non_stop (1
))
+ if (
the_target->start_non_stop (true
))
non_stop = 1;
/* Detaching implicitly resumes all threads;
non_stop = 1;
/* Detaching implicitly resumes all threads;
This page took
0.028214 seconds
and
4
git commands to generate.