home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / GDB / GDB-4.13 / GDB-4 / gdb-4.13 / gdb / annotate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-17  |  9.2 KB  |  522 lines

  1. /* Annotation routines for GDB.
  2.    Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  3.  
  4. This file is part of GDB.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #include "defs.h"
  21. #include "annotate.h"
  22. #include "value.h"
  23. #include "target.h"
  24. #include "gdbtypes.h"
  25.  
  26. static void print_value_flags PARAMS ((struct type *));
  27.  
  28. static void
  29. print_value_flags (t)
  30.      struct type *t;
  31. {
  32.   if (can_dereference (t))
  33.     printf_filtered ("*");
  34.   else
  35.     printf_filtered ("-");
  36. }
  37.  
  38. void
  39. breakpoints_changed ()
  40. {
  41.   if (annotation_level > 1)
  42.     {
  43.       target_terminal_ours ();
  44.       printf_unfiltered ("\n\032\032breakpoints-invalid\n");
  45.     }
  46. }
  47.  
  48. void
  49. annotate_breakpoint (num)
  50.      int num;
  51. {
  52.   if (annotation_level > 1)
  53.     printf_filtered ("\n\032\032breakpoint %d\n", num);
  54. }
  55.  
  56. void
  57. annotate_watchpoint (num)
  58.      int num;
  59. {
  60.   if (annotation_level > 1)
  61.     printf_filtered ("\n\032\032watchpoint %d\n", num);
  62. }
  63.  
  64. void
  65. annotate_starting ()
  66. {
  67.   if (annotation_level > 1)
  68.     printf_filtered ("\n\032\032starting\n");
  69. }
  70.  
  71. void
  72. annotate_stopped ()
  73. {
  74.   if (annotation_level > 1)
  75.     printf_filtered ("\n\032\032stopped\n");
  76. }
  77.  
  78. void
  79. annotate_exited (exitstatus)
  80.      int exitstatus;
  81. {
  82.   if (annotation_level > 1)
  83.     printf_filtered ("\n\032\032exited %d\n", exitstatus);
  84. }
  85.  
  86. void
  87. annotate_signalled ()
  88. {
  89.   if (annotation_level > 1)
  90.     printf_filtered ("\n\032\032signalled\n");
  91. }
  92.  
  93. void
  94. annotate_signal_name ()
  95. {
  96.   if (annotation_level > 1)
  97.     printf_filtered ("\n\032\032signal-name\n");
  98. }
  99.  
  100. void
  101. annotate_signal_name_end ()
  102. {
  103.   if (annotation_level > 1)
  104.     printf_filtered ("\n\032\032signal-name-end\n");
  105. }
  106.  
  107. void
  108. annotate_signal_string ()
  109. {
  110.   if (annotation_level > 1)
  111.     printf_filtered ("\n\032\032signal-string\n");
  112. }
  113.  
  114. void
  115. annotate_signal_string_end ()
  116. {
  117.   if (annotation_level > 1)
  118.     printf_filtered ("\n\032\032signal-string-end\n");
  119. }
  120.  
  121. void
  122. annotate_signal ()
  123. {
  124.   if (annotation_level > 1)
  125.     printf_filtered ("\n\032\032signal\n");
  126. }
  127.  
  128. void
  129. annotate_breakpoints_headers ()
  130. {
  131.   if (annotation_level > 1)
  132.     printf_filtered ("\n\032\032breakpoints-headers\n");
  133. }
  134.  
  135. void
  136. annotate_field (num)
  137.      int num;
  138. {
  139.   if (annotation_level > 1)
  140.     printf_filtered ("\n\032\032field %d\n", num);
  141. }
  142.  
  143. void
  144. annotate_breakpoints_table ()
  145. {
  146.   if (annotation_level > 1)
  147.     printf_filtered ("\n\032\032breakpoints-table\n");
  148. }
  149.  
  150. void
  151. annotate_record ()
  152. {
  153.   if (annotation_level > 1)
  154.     printf_filtered ("\n\032\032record\n");
  155. }
  156.  
  157. void
  158. annotate_breakpoints_table_end ()
  159. {
  160.   if (annotation_level > 1)
  161.     printf_filtered ("\n\032\032breakpoints-table-end\n");
  162. }
  163.  
  164. void
  165. annotate_frames_invalid ()
  166. {
  167.   if (annotation_level > 1)
  168.     {
  169.       target_terminal_ours ();
  170.       printf_unfiltered ("\n\032\032frames-invalid\n");
  171.     }
  172. }
  173.  
  174. void
  175. annotate_field_begin (type)
  176.      struct type *type;
  177. {
  178.   if (annotation_level > 1)
  179.     {
  180.       printf_filtered ("\n\032\032field-begin ");
  181.       print_value_flags (type);
  182.       printf_filtered ("\n");
  183.     }
  184. }
  185.  
  186. void
  187. annotate_field_name_end ()
  188. {
  189.   if (annotation_level > 1)
  190.     printf_filtered ("\n\032\032field-name-end\n");
  191. }
  192.  
  193. void
  194. annotate_field_value ()
  195. {
  196.   if (annotation_level > 1)
  197.     printf_filtered ("\n\032\032field-value\n");
  198. }
  199.  
  200. void
  201. annotate_field_end ()
  202. {
  203.   if (annotation_level > 1)
  204.     printf_filtered ("\n\032\032field-end\n");
  205. }
  206.  
  207. void
  208. annotate_quit ()
  209. {
  210.   if (annotation_level > 1)
  211.     printf_filtered ("\n\032\032quit\n");
  212. }
  213.  
  214. void
  215. annotate_error ()
  216. {
  217.   if (annotation_level > 1)
  218.     printf_filtered ("\n\032\032error\n");
  219. }
  220.  
  221. void
  222. annotate_error_begin ()
  223. {
  224.   if (annotation_level > 1)
  225.     fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
  226. }
  227.  
  228. void
  229. annotate_value_history_begin (histindex, type)
  230.      int histindex;
  231.      struct type *type;
  232. {
  233.   if (annotation_level > 1)
  234.     {
  235.       printf_filtered ("\n\032\032value-history-begin %d ", histindex);
  236.       print_value_flags (type);
  237.       printf_filtered ("\n");
  238.     }
  239. }
  240.  
  241. void
  242. annotate_value_begin (type)
  243.      struct type *type;
  244. {
  245.   if (annotation_level > 1)
  246.     {
  247.       printf_filtered ("\n\032\032value-begin ");
  248.       print_value_flags (type);
  249.       printf_filtered ("\n");
  250.     }
  251. }
  252.  
  253. void
  254. annotate_value_history_value ()
  255. {
  256.   if (annotation_level > 1)
  257.     printf_filtered ("\n\032\032value-history-value\n");
  258. }
  259.  
  260. void
  261. annotate_value_history_end ()
  262. {
  263.   if (annotation_level > 1)
  264.     printf_filtered ("\n\032\032value-history-end\n");
  265. }
  266.  
  267. void
  268. annotate_value_end ()
  269. {
  270.   if (annotation_level > 1)
  271.     printf_filtered ("\n\032\032value-end\n");
  272. }
  273.  
  274. void
  275. annotate_display_begin ()
  276. {
  277.   if (annotation_level > 1)
  278.     printf_filtered ("\n\032\032display-begin\n");
  279. }
  280.  
  281. void
  282. annotate_display_number_end ()
  283. {
  284.   if (annotation_level > 1)
  285.     printf_filtered ("\n\032\032display-number-end\n");
  286. }
  287.  
  288. void
  289. annotate_display_format ()
  290. {
  291.   if (annotation_level > 1)
  292.     printf_filtered ("\n\032\032display-format\n");
  293. }
  294.  
  295. void
  296. annotate_display_expression ()
  297. {
  298.   if (annotation_level > 1)
  299.     printf_filtered ("\n\032\032display-expression\n");
  300. }
  301.  
  302. void
  303. annotate_display_expression_end ()
  304. {
  305.   if (annotation_level > 1)
  306.     printf_filtered ("\n\032\032display-expression-end\n");
  307. }
  308.  
  309. void
  310. annotate_display_value ()
  311. {
  312.   if (annotation_level > 1)
  313.     printf_filtered ("\n\032\032display-value\n");
  314. }
  315.  
  316. void
  317. annotate_display_end ()
  318. {
  319.   if (annotation_level > 1)
  320.     printf_filtered ("\n\032\032display-end\n");
  321. }
  322.  
  323. void
  324. annotate_arg_begin ()
  325. {
  326.   if (annotation_level > 1)
  327.     printf_filtered ("\n\032\032arg-begin\n");
  328. }
  329.  
  330. void
  331. annotate_arg_name_end ()
  332. {
  333.   if (annotation_level > 1)
  334.     printf_filtered ("\n\032\032arg-name-end\n");
  335. }
  336.  
  337. void
  338. annotate_arg_value (type)
  339.      struct type *type;
  340. {
  341.   if (annotation_level > 1)
  342.     {
  343.       printf_filtered ("\n\032\032arg-value ");
  344.       print_value_flags (type);
  345.       printf_filtered ("\n");
  346.     }
  347. }
  348.  
  349. void
  350. annotate_arg_end ()
  351. {
  352.   if (annotation_level > 1)
  353.     printf_filtered ("\n\032\032arg-end\n");
  354. }
  355.  
  356. void
  357. annotate_source (filename, line, character, mid, pc)
  358.      char *filename;
  359.      int line;
  360.      int character;
  361.      int mid;
  362.      CORE_ADDR pc;
  363. {
  364.   if (annotation_level > 1)
  365.     printf_filtered ("\n\032\032source ");
  366.   else
  367.     printf_filtered ("\032\032");
  368.  
  369.   printf_filtered ("%s:%d:%d:%s:", filename,
  370.            line, character,
  371.            mid ? "middle" : "beg");
  372.   print_address_numeric (pc, 0, gdb_stdout);
  373.   printf_filtered ("\n");
  374. }
  375.  
  376. void
  377. annotate_frame_begin (level, pc)
  378.      int level;
  379.      CORE_ADDR pc;
  380. {
  381.   if (annotation_level > 1)
  382.     {
  383.       printf_filtered ("\n\032\032frame-begin %d ", level);
  384.       print_address_numeric (pc, 0, gdb_stdout);
  385.       printf_filtered ("\n");
  386.     }
  387. }
  388.  
  389. void
  390. annotate_function_call ()
  391. {
  392.   if (annotation_level > 1)
  393.     printf_filtered ("\n\032\032function-call\n");
  394. }
  395.  
  396. void
  397. annotate_signal_handler_caller ()
  398. {
  399.   if (annotation_level > 1)
  400.     printf_filtered ("\n\032\032signal-handler-caller\n");
  401. }
  402.  
  403. void
  404. annotate_frame_address ()
  405. {
  406.   if (annotation_level > 1)
  407.     printf_filtered ("\n\032\032frame-address\n");
  408. }
  409.  
  410. void
  411. annotate_frame_address_end ()
  412. {
  413.   if (annotation_level > 1)
  414.     printf_filtered ("\n\032\032frame-address-end\n");
  415. }
  416.  
  417. void
  418. annotate_frame_function_name ()
  419. {
  420.   if (annotation_level > 1)
  421.     printf_filtered ("\n\032\032frame-function-name\n");
  422. }
  423.  
  424. void
  425. annotate_frame_args ()
  426. {
  427.   if (annotation_level > 1)
  428.     printf_filtered ("\n\032\032frame-args\n");
  429. }
  430.  
  431. void
  432. annotate_frame_source_begin ()
  433. {
  434.   if (annotation_level > 1)
  435.     printf_filtered ("\n\032\032frame-source-begin\n");
  436. }
  437.  
  438. void
  439. annotate_frame_source_file ()
  440. {
  441.   if (annotation_level > 1)
  442.     printf_filtered ("\n\032\032frame-source-file\n");
  443. }
  444.  
  445. void
  446. annotate_frame_source_file_end ()
  447. {
  448.   if (annotation_level > 1)
  449.     printf_filtered ("\n\032\032frame-source-file-end\n");
  450. }
  451.  
  452. void
  453. annotate_frame_source_line ()
  454. {
  455.   if (annotation_level > 1)
  456.     printf_filtered ("\n\032\032frame-source-line\n");
  457. }
  458.  
  459. void
  460. annotate_frame_source_end ()
  461. {
  462.   if (annotation_level > 1)
  463.     printf_filtered ("\n\032\032frame-source-end\n");
  464. }
  465.  
  466. void
  467. annotate_frame_where ()
  468. {
  469.   if (annotation_level > 1)
  470.     printf_filtered ("\n\032\032frame-where\n");
  471. }
  472.  
  473. void
  474. annotate_frame_end ()
  475. {
  476.   if (annotation_level > 1)
  477.     printf_filtered ("\n\032\032frame-end\n");
  478. }
  479.  
  480. void
  481. annotate_array_section_begin (index, elttype)
  482.      int index;
  483.      struct type *elttype;
  484. {
  485.   if (annotation_level > 1)
  486.     {
  487.       printf_filtered ("\n\032\032array-section-begin %d ", index);
  488.       print_value_flags (elttype);
  489.       printf_filtered ("\n");
  490.     }
  491. }
  492.  
  493. void
  494. annotate_elt_rep (repcount)
  495.      unsigned int repcount;
  496. {
  497.   if (annotation_level > 1)
  498.     printf_filtered ("\n\032\032elt-rep %u\n", repcount);
  499. }
  500.  
  501. void
  502. annotate_elt_rep_end ()
  503. {
  504.   if (annotation_level > 1)
  505.     printf_filtered ("\n\032\032elt-rep-end\n");
  506. }
  507.  
  508. void
  509. annotate_elt ()
  510. {
  511.   if (annotation_level > 1)
  512.     printf_filtered ("\n\032\032elt\n");
  513. }
  514.  
  515. void
  516. annotate_array_section_end ()
  517. {
  518.   if (annotation_level > 1)
  519.     printf_filtered ("\n\032\032array-section-end\n");
  520. }
  521.  
  522.