target.cc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  1. /* Target operations for the remote server for GDB.
  2. Copyright (C) 2002-2022 Free Software Foundation, Inc.
  3. Contributed by MontaVista Software.
  4. This file is part of GDB.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #include "server.h"
  16. #include "tracepoint.h"
  17. #include "gdbsupport/byte-vector.h"
  18. #include "hostio.h"
  19. #include <fcntl.h>
  20. #include <unistd.h>
  21. #include <sys/types.h>
  22. #include <sys/stat.h>
  23. process_stratum_target *the_target;
  24. int
  25. set_desired_thread ()
  26. {
  27. client_state &cs = get_client_state ();
  28. thread_info *found = find_thread_ptid (cs.general_thread);
  29. switch_to_thread (found);
  30. return (current_thread != NULL);
  31. }
  32. /* The thread that was current before prepare_to_access_memory was
  33. called. done_accessing_memory uses this to restore the previous
  34. selected thread. */
  35. static ptid_t prev_general_thread;
  36. /* See target.h. */
  37. int
  38. prepare_to_access_memory (void)
  39. {
  40. client_state &cs = get_client_state ();
  41. /* The first thread found. */
  42. struct thread_info *first = NULL;
  43. /* The first stopped thread found. */
  44. struct thread_info *stopped = NULL;
  45. /* The current general thread, if found. */
  46. struct thread_info *current = NULL;
  47. /* Save the general thread value, since prepare_to_access_memory could change
  48. it. */
  49. prev_general_thread = cs.general_thread;
  50. int res = the_target->prepare_to_access_memory ();
  51. if (res != 0)
  52. return res;
  53. for_each_thread (prev_general_thread.pid (), [&] (thread_info *thread)
  54. {
  55. if (mythread_alive (thread->id))
  56. {
  57. if (stopped == NULL && the_target->supports_thread_stopped ()
  58. && target_thread_stopped (thread))
  59. stopped = thread;
  60. if (first == NULL)
  61. first = thread;
  62. if (current == NULL && prev_general_thread == thread->id)
  63. current = thread;
  64. }
  65. });
  66. /* The thread we end up choosing. */
  67. struct thread_info *thread;
  68. /* Prefer a stopped thread. If none is found, try the current
  69. thread. Otherwise, take the first thread in the process. If
  70. none is found, undo the effects of
  71. target->prepare_to_access_memory() and return error. */
  72. if (stopped != NULL)
  73. thread = stopped;
  74. else if (current != NULL)
  75. thread = current;
  76. else if (first != NULL)
  77. thread = first;
  78. else
  79. {
  80. done_accessing_memory ();
  81. return 1;
  82. }
  83. switch_to_thread (thread);
  84. cs.general_thread = ptid_of (thread);
  85. return 0;
  86. }
  87. /* See target.h. */
  88. void
  89. done_accessing_memory (void)
  90. {
  91. client_state &cs = get_client_state ();
  92. the_target->done_accessing_memory ();
  93. /* Restore the previous selected thread. */
  94. cs.general_thread = prev_general_thread;
  95. switch_to_thread (the_target, cs.general_thread);
  96. }
  97. int
  98. read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
  99. {
  100. int res;
  101. res = the_target->read_memory (memaddr, myaddr, len);
  102. check_mem_read (memaddr, myaddr, len);
  103. return res;
  104. }
  105. /* See target/target.h. */
  106. int
  107. target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
  108. {
  109. return read_inferior_memory (memaddr, myaddr, len);
  110. }
  111. /* See target/target.h. */
  112. int
  113. target_read_uint32 (CORE_ADDR memaddr, uint32_t *result)
  114. {
  115. return read_inferior_memory (memaddr, (gdb_byte *) result, sizeof (*result));
  116. }
  117. /* See target/target.h. */
  118. int
  119. target_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
  120. ssize_t len)
  121. {
  122. /* Make a copy of the data because check_mem_write may need to
  123. update it. */
  124. gdb::byte_vector buffer (myaddr, myaddr + len);
  125. check_mem_write (memaddr, buffer.data (), myaddr, len);
  126. return the_target->write_memory (memaddr, buffer.data (), len);
  127. }
  128. ptid_t
  129. mywait (ptid_t ptid, struct target_waitstatus *ourstatus,
  130. target_wait_flags options, int connected_wait)
  131. {
  132. ptid_t ret;
  133. if (connected_wait)
  134. server_waiting = 1;
  135. ret = target_wait (ptid, ourstatus, options);
  136. /* We don't expose _LOADED events to gdbserver core. See the
  137. `dlls_changed' global. */
  138. if (ourstatus->kind () == TARGET_WAITKIND_LOADED)
  139. ourstatus->set_stopped (GDB_SIGNAL_0);
  140. /* If GDB is connected through TCP/serial, then GDBserver will most
  141. probably be running on its own terminal/console, so it's nice to
  142. print there why is GDBserver exiting. If however, GDB is
  143. connected through stdio, then there's no need to spam the GDB
  144. console with this -- the user will already see the exit through
  145. regular GDB output, in that same terminal. */
  146. if (!remote_connection_is_stdio ())
  147. {
  148. if (ourstatus->kind () == TARGET_WAITKIND_EXITED)
  149. fprintf (stderr,
  150. "\nChild exited with status %d\n", ourstatus->exit_status ());
  151. else if (ourstatus->kind () == TARGET_WAITKIND_SIGNALLED)
  152. fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n",
  153. gdb_signal_to_host (ourstatus->sig ()),
  154. gdb_signal_to_name (ourstatus->sig ()));
  155. }
  156. if (connected_wait)
  157. server_waiting = 0;
  158. return ret;
  159. }
  160. /* See target/target.h. */
  161. void
  162. target_stop_and_wait (ptid_t ptid)
  163. {
  164. struct target_waitstatus status;
  165. bool was_non_stop = non_stop;
  166. struct thread_resume resume_info;
  167. resume_info.thread = ptid;
  168. resume_info.kind = resume_stop;
  169. resume_info.sig = GDB_SIGNAL_0;
  170. the_target->resume (&resume_info, 1);
  171. non_stop = true;
  172. mywait (ptid, &status, 0, 0);
  173. non_stop = was_non_stop;
  174. }
  175. /* See target/target.h. */
  176. ptid_t
  177. target_wait (ptid_t ptid, struct target_waitstatus *status,
  178. target_wait_flags options)
  179. {
  180. return the_target->wait (ptid, status, options);
  181. }
  182. /* See target/target.h. */
  183. void
  184. target_mourn_inferior (ptid_t ptid)
  185. {
  186. the_target->mourn (find_process_pid (ptid.pid ()));
  187. }
  188. /* See target/target.h. */
  189. void
  190. target_continue_no_signal (ptid_t ptid)
  191. {
  192. struct thread_resume resume_info;
  193. resume_info.thread = ptid;
  194. resume_info.kind = resume_continue;
  195. resume_info.sig = GDB_SIGNAL_0;
  196. the_target->resume (&resume_info, 1);
  197. }
  198. /* See target/target.h. */
  199. void
  200. target_continue (ptid_t ptid, enum gdb_signal signal)
  201. {
  202. struct thread_resume resume_info;
  203. resume_info.thread = ptid;
  204. resume_info.kind = resume_continue;
  205. resume_info.sig = gdb_signal_to_host (signal);
  206. the_target->resume (&resume_info, 1);
  207. }
  208. /* See target/target.h. */
  209. int
  210. target_supports_multi_process (void)
  211. {
  212. return the_target->supports_multi_process ();
  213. }
  214. void
  215. set_target_ops (process_stratum_target *target)
  216. {
  217. the_target = target;
  218. }
  219. /* Convert pid to printable format. */
  220. std::string
  221. target_pid_to_str (ptid_t ptid)
  222. {
  223. if (ptid == minus_one_ptid)
  224. return string_printf("<all threads>");
  225. else if (ptid == null_ptid)
  226. return string_printf("<null thread>");
  227. else if (ptid.tid () != 0)
  228. return string_printf("Thread %d.0x%s",
  229. ptid.pid (),
  230. phex_nz (ptid.tid (), sizeof (ULONGEST)));
  231. else if (ptid.lwp () != 0)
  232. return string_printf("LWP %d.%ld",
  233. ptid.pid (), ptid.lwp ());
  234. else
  235. return string_printf("Process %d",
  236. ptid.pid ());
  237. }
  238. int
  239. kill_inferior (process_info *proc)
  240. {
  241. gdb_agent_about_to_close (proc->pid);
  242. return the_target->kill (proc);
  243. }
  244. /* Define it. */
  245. target_terminal_state target_terminal::m_terminal_state
  246. = target_terminal_state::is_ours;
  247. /* See target/target.h. */
  248. void
  249. target_terminal::init ()
  250. {
  251. /* Placeholder needed because of fork_inferior. Not necessary on
  252. GDBserver. */
  253. }
  254. /* See target/target.h. */
  255. void
  256. target_terminal::inferior ()
  257. {
  258. /* Placeholder needed because of fork_inferior. Not necessary on
  259. GDBserver. */
  260. }
  261. /* See target/target.h. */
  262. void
  263. target_terminal::ours ()
  264. {
  265. /* Placeholder needed because of fork_inferior. Not necessary on
  266. GDBserver. */
  267. }
  268. /* See target/target.h. */
  269. void
  270. target_terminal::ours_for_output (void)
  271. {
  272. /* Placeholder. */
  273. }
  274. /* See target/target.h. */
  275. void
  276. target_terminal::info (const char *arg, int from_tty)
  277. {
  278. /* Placeholder. */
  279. }
  280. /* Default implementations of target ops.
  281. See target.h for definitions. */
  282. void
  283. process_stratum_target::post_create_inferior ()
  284. {
  285. /* Nop. */
  286. }
  287. int
  288. process_stratum_target::prepare_to_access_memory ()
  289. {
  290. return 0;
  291. }
  292. void
  293. process_stratum_target::done_accessing_memory ()
  294. {
  295. /* Nop. */
  296. }
  297. void
  298. process_stratum_target::look_up_symbols ()
  299. {
  300. /* Nop. */
  301. }
  302. bool
  303. process_stratum_target::supports_read_auxv ()
  304. {
  305. return false;
  306. }
  307. int
  308. process_stratum_target::read_auxv (CORE_ADDR offset, unsigned char *myaddr,
  309. unsigned int len)
  310. {
  311. gdb_assert_not_reached ("target op read_auxv not supported");
  312. }
  313. bool
  314. process_stratum_target::supports_z_point_type (char z_type)
  315. {
  316. return false;
  317. }
  318. int
  319. process_stratum_target::insert_point (enum raw_bkpt_type type,
  320. CORE_ADDR addr,
  321. int size, raw_breakpoint *bp)
  322. {
  323. return 1;
  324. }
  325. int
  326. process_stratum_target::remove_point (enum raw_bkpt_type type,
  327. CORE_ADDR addr,
  328. int size, raw_breakpoint *bp)
  329. {
  330. return 1;
  331. }
  332. bool
  333. process_stratum_target::stopped_by_sw_breakpoint ()
  334. {
  335. return false;
  336. }
  337. bool
  338. process_stratum_target::supports_stopped_by_sw_breakpoint ()
  339. {
  340. return false;
  341. }
  342. bool
  343. process_stratum_target::stopped_by_hw_breakpoint ()
  344. {
  345. return false;
  346. }
  347. bool
  348. process_stratum_target::supports_stopped_by_hw_breakpoint ()
  349. {
  350. return false;
  351. }
  352. bool
  353. process_stratum_target::supports_hardware_single_step ()
  354. {
  355. return false;
  356. }
  357. bool
  358. process_stratum_target::stopped_by_watchpoint ()
  359. {
  360. return false;
  361. }
  362. CORE_ADDR
  363. process_stratum_target::stopped_data_address ()
  364. {
  365. return 0;
  366. }
  367. bool
  368. process_stratum_target::supports_read_offsets ()
  369. {
  370. return false;
  371. }
  372. bool
  373. process_stratum_target::supports_memory_tagging ()
  374. {
  375. return false;
  376. }
  377. bool
  378. process_stratum_target::fetch_memtags (CORE_ADDR address, size_t len,
  379. gdb::byte_vector &tags, int type)
  380. {
  381. gdb_assert_not_reached ("target op fetch_memtags not supported");
  382. }
  383. bool
  384. process_stratum_target::store_memtags (CORE_ADDR address, size_t len,
  385. const gdb::byte_vector &tags, int type)
  386. {
  387. gdb_assert_not_reached ("target op store_memtags not supported");
  388. }
  389. int
  390. process_stratum_target::read_offsets (CORE_ADDR *text, CORE_ADDR *data)
  391. {
  392. gdb_assert_not_reached ("target op read_offsets not supported");
  393. }
  394. bool
  395. process_stratum_target::supports_get_tls_address ()
  396. {
  397. return false;
  398. }
  399. int
  400. process_stratum_target::get_tls_address (thread_info *thread,
  401. CORE_ADDR offset,
  402. CORE_ADDR load_module,
  403. CORE_ADDR *address)
  404. {
  405. gdb_assert_not_reached ("target op get_tls_address not supported");
  406. }
  407. bool
  408. process_stratum_target::supports_qxfer_osdata ()
  409. {
  410. return false;
  411. }
  412. int
  413. process_stratum_target::qxfer_osdata (const char *annex,
  414. unsigned char *readbuf,
  415. unsigned const char *writebuf,
  416. CORE_ADDR offset, int len)
  417. {
  418. gdb_assert_not_reached ("target op qxfer_osdata not supported");
  419. }
  420. bool
  421. process_stratum_target::supports_qxfer_siginfo ()
  422. {
  423. return false;
  424. }
  425. int
  426. process_stratum_target::qxfer_siginfo (const char *annex,
  427. unsigned char *readbuf,
  428. unsigned const char *writebuf,
  429. CORE_ADDR offset, int len)
  430. {
  431. gdb_assert_not_reached ("target op qxfer_siginfo not supported");
  432. }
  433. bool
  434. process_stratum_target::supports_non_stop ()
  435. {
  436. return false;
  437. }
  438. bool
  439. process_stratum_target::async (bool enable)
  440. {
  441. return false;
  442. }
  443. int
  444. process_stratum_target::start_non_stop (bool enable)
  445. {
  446. if (enable)
  447. return -1;
  448. else
  449. return 0;
  450. }
  451. bool
  452. process_stratum_target::supports_multi_process ()
  453. {
  454. return false;
  455. }
  456. bool
  457. process_stratum_target::supports_fork_events ()
  458. {
  459. return false;
  460. }
  461. bool
  462. process_stratum_target::supports_vfork_events ()
  463. {
  464. return false;
  465. }
  466. bool
  467. process_stratum_target::supports_exec_events ()
  468. {
  469. return false;
  470. }
  471. void
  472. process_stratum_target::handle_new_gdb_connection ()
  473. {
  474. /* Nop. */
  475. }
  476. int
  477. process_stratum_target::handle_monitor_command (char *mon)
  478. {
  479. return 0;
  480. }
  481. int
  482. process_stratum_target::core_of_thread (ptid_t ptid)
  483. {
  484. return -1;
  485. }
  486. bool
  487. process_stratum_target::supports_read_loadmap ()
  488. {
  489. return false;
  490. }
  491. int
  492. process_stratum_target::read_loadmap (const char *annex,
  493. CORE_ADDR offset,
  494. unsigned char *myaddr,
  495. unsigned int len)
  496. {
  497. gdb_assert_not_reached ("target op read_loadmap not supported");
  498. }
  499. void
  500. process_stratum_target::process_qsupported
  501. (gdb::array_view<const char * const> features)
  502. {
  503. /* Nop. */
  504. }
  505. bool
  506. process_stratum_target::supports_tracepoints ()
  507. {
  508. return false;
  509. }
  510. CORE_ADDR
  511. process_stratum_target::read_pc (regcache *regcache)
  512. {
  513. gdb_assert_not_reached ("process_target::read_pc: Unable to find PC");
  514. }
  515. void
  516. process_stratum_target::write_pc (regcache *regcache, CORE_ADDR pc)
  517. {
  518. gdb_assert_not_reached ("process_target::write_pc: Unable to update PC");
  519. }
  520. bool
  521. process_stratum_target::supports_thread_stopped ()
  522. {
  523. return false;
  524. }
  525. bool
  526. process_stratum_target::thread_stopped (thread_info *thread)
  527. {
  528. gdb_assert_not_reached ("target op thread_stopped not supported");
  529. }
  530. bool
  531. process_stratum_target::supports_get_tib_address ()
  532. {
  533. return false;
  534. }
  535. int
  536. process_stratum_target::get_tib_address (ptid_t ptid, CORE_ADDR *address)
  537. {
  538. gdb_assert_not_reached ("target op get_tib_address not supported");
  539. }
  540. void
  541. process_stratum_target::pause_all (bool freeze)
  542. {
  543. /* Nop. */
  544. }
  545. void
  546. process_stratum_target::unpause_all (bool unfreeze)
  547. {
  548. /* Nop. */
  549. }
  550. void
  551. process_stratum_target::stabilize_threads ()
  552. {
  553. /* Nop. */
  554. }
  555. bool
  556. process_stratum_target::supports_fast_tracepoints ()
  557. {
  558. return false;
  559. }
  560. int
  561. process_stratum_target::install_fast_tracepoint_jump_pad
  562. (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector,
  563. CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry,
  564. CORE_ADDR *trampoline, ULONGEST *trampoline_size,
  565. unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size,
  566. CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end,
  567. char *err)
  568. {
  569. gdb_assert_not_reached ("target op install_fast_tracepoint_jump_pad "
  570. "not supported");
  571. }
  572. int
  573. process_stratum_target::get_min_fast_tracepoint_insn_len ()
  574. {
  575. return 0;
  576. }
  577. struct emit_ops *
  578. process_stratum_target::emit_ops ()
  579. {
  580. return nullptr;
  581. }
  582. bool
  583. process_stratum_target::supports_disable_randomization ()
  584. {
  585. return false;
  586. }
  587. bool
  588. process_stratum_target::supports_qxfer_libraries_svr4 ()
  589. {
  590. return false;
  591. }
  592. int
  593. process_stratum_target::qxfer_libraries_svr4 (const char *annex,
  594. unsigned char *readbuf,
  595. unsigned const char *writebuf,
  596. CORE_ADDR offset, int len)
  597. {
  598. gdb_assert_not_reached ("target op qxfer_libraries_svr4 not supported");
  599. }
  600. bool
  601. process_stratum_target::supports_agent ()
  602. {
  603. return false;
  604. }
  605. btrace_target_info *
  606. process_stratum_target::enable_btrace (thread_info *tp,
  607. const btrace_config *conf)
  608. {
  609. error (_("Target does not support branch tracing."));
  610. }
  611. int
  612. process_stratum_target::disable_btrace (btrace_target_info *tinfo)
  613. {
  614. error (_("Target does not support branch tracing."));
  615. }
  616. int
  617. process_stratum_target::read_btrace (btrace_target_info *tinfo,
  618. buffer *buffer,
  619. enum btrace_read_type type)
  620. {
  621. error (_("Target does not support branch tracing."));
  622. }
  623. int
  624. process_stratum_target::read_btrace_conf (const btrace_target_info *tinfo,
  625. buffer *buffer)
  626. {
  627. error (_("Target does not support branch tracing."));
  628. }
  629. bool
  630. process_stratum_target::supports_range_stepping ()
  631. {
  632. return false;
  633. }
  634. bool
  635. process_stratum_target::supports_pid_to_exec_file ()
  636. {
  637. return false;
  638. }
  639. const char *
  640. process_stratum_target::pid_to_exec_file (int pid)
  641. {
  642. gdb_assert_not_reached ("target op pid_to_exec_file not supported");
  643. }
  644. bool
  645. process_stratum_target::supports_multifs ()
  646. {
  647. return false;
  648. }
  649. int
  650. process_stratum_target::multifs_open (int pid, const char *filename,
  651. int flags, mode_t mode)
  652. {
  653. return open (filename, flags, mode);
  654. }
  655. int
  656. process_stratum_target::multifs_unlink (int pid, const char *filename)
  657. {
  658. return unlink (filename);
  659. }
  660. ssize_t
  661. process_stratum_target::multifs_readlink (int pid, const char *filename,
  662. char *buf, size_t bufsiz)
  663. {
  664. return readlink (filename, buf, bufsiz);
  665. }
  666. int
  667. process_stratum_target::breakpoint_kind_from_pc (CORE_ADDR *pcptr)
  668. {
  669. /* The default behavior is to use the size of a breakpoint as the
  670. kind. */
  671. int size = 0;
  672. sw_breakpoint_from_kind (0, &size);
  673. return size;
  674. }
  675. int
  676. process_stratum_target::breakpoint_kind_from_current_state (CORE_ADDR *pcptr)
  677. {
  678. return breakpoint_kind_from_pc (pcptr);
  679. }
  680. const char *
  681. process_stratum_target::thread_name (ptid_t thread)
  682. {
  683. return nullptr;
  684. }
  685. bool
  686. process_stratum_target::thread_handle (ptid_t ptid, gdb_byte **handle,
  687. int *handle_len)
  688. {
  689. return false;
  690. }
  691. thread_info *
  692. process_stratum_target::thread_pending_parent (thread_info *thread)
  693. {
  694. return nullptr;
  695. }
  696. thread_info *
  697. process_stratum_target::thread_pending_child (thread_info *thread)
  698. {
  699. return nullptr;
  700. }
  701. bool
  702. process_stratum_target::supports_software_single_step ()
  703. {
  704. return false;
  705. }
  706. bool
  707. process_stratum_target::supports_catch_syscall ()
  708. {
  709. return false;
  710. }
  711. int
  712. process_stratum_target::get_ipa_tdesc_idx ()
  713. {
  714. return 0;
  715. }