1/* This file is automatically generated. DO NOT EDIT! */ 2/* Generated from: NetBSD: mknative-gdb,v 1.7 2016/10/16 04:37:42 mrg Exp */ 3/* Generated from: NetBSD: mknative.common,v 1.15 2017/11/29 03:32:28 christos Exp */ 4 5/* GDB Notifications to Observers. 6 7 Copyright (C) 2004-2017 Free Software Foundation, Inc. 8 9 This file is part of GDB. 10 11 This program is free software; you can redistribute it and/or modify 12 it under the terms of the GNU General Public License as published by 13 the Free Software Foundation; either version 3 of the License, or 14 (at your option) any later version. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License for more details. 20 21 You should have received a copy of the GNU General Public License 22 along with this program. If not, see <http://www.gnu.org/licenses/>. 23 24 -- 25 26 This file was generated using observer.sh and observer.texi. */ 27 28 29/* normal_stop notifications. */ 30 31static struct observer_list *normal_stop_subject = NULL; 32 33struct normal_stop_args { struct bpstats *bs; int print_frame; }; 34 35static void 36observer_normal_stop_notification_stub (const void *data, const void *args_data) 37{ 38 observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data; 39 const struct normal_stop_args *args = (const struct normal_stop_args *) args_data; 40 notify (args->bs, args->print_frame); 41} 42 43struct observer * 44observer_attach_normal_stop (observer_normal_stop_ftype *f) 45{ 46 return generic_observer_attach (&normal_stop_subject, 47 &observer_normal_stop_notification_stub, 48 (void *) f); 49} 50 51void 52observer_detach_normal_stop (struct observer *observer) 53{ 54 generic_observer_detach (&normal_stop_subject, observer); 55} 56 57void 58observer_notify_normal_stop (struct bpstats *bs, int print_frame) 59{ 60 struct normal_stop_args args; 61 args.bs = bs, args.print_frame = print_frame; 62 63 if (observer_debug) 64 fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n"); 65 generic_observer_notify (normal_stop_subject, &args); 66} 67 68/* signal_received notifications. */ 69 70static struct observer_list *signal_received_subject = NULL; 71 72struct signal_received_args { enum gdb_signal siggnal; }; 73 74static void 75observer_signal_received_notification_stub (const void *data, const void *args_data) 76{ 77 observer_signal_received_ftype *notify = (observer_signal_received_ftype *) data; 78 const struct signal_received_args *args = (const struct signal_received_args *) args_data; 79 notify (args->siggnal); 80} 81 82struct observer * 83observer_attach_signal_received (observer_signal_received_ftype *f) 84{ 85 return generic_observer_attach (&signal_received_subject, 86 &observer_signal_received_notification_stub, 87 (void *) f); 88} 89 90void 91observer_detach_signal_received (struct observer *observer) 92{ 93 generic_observer_detach (&signal_received_subject, observer); 94} 95 96void 97observer_notify_signal_received (enum gdb_signal siggnal) 98{ 99 struct signal_received_args args; 100 args.siggnal = siggnal; 101 102 if (observer_debug) 103 fprintf_unfiltered (gdb_stdlog, "observer_notify_signal_received() called\n"); 104 generic_observer_notify (signal_received_subject, &args); 105} 106 107/* end_stepping_range notifications. */ 108 109static struct observer_list *end_stepping_range_subject = NULL; 110 111static void 112observer_end_stepping_range_notification_stub (const void *data, const void *args_data) 113{ 114 observer_end_stepping_range_ftype *notify = (observer_end_stepping_range_ftype *) data; 115 notify (); 116} 117 118struct observer * 119observer_attach_end_stepping_range (observer_end_stepping_range_ftype *f) 120{ 121 return generic_observer_attach (&end_stepping_range_subject, 122 &observer_end_stepping_range_notification_stub, 123 (void *) f); 124} 125 126void 127observer_detach_end_stepping_range (struct observer *observer) 128{ 129 generic_observer_detach (&end_stepping_range_subject, observer); 130} 131 132void 133observer_notify_end_stepping_range (void) 134{ 135char *args = NULL; 136 if (observer_debug) 137 fprintf_unfiltered (gdb_stdlog, "observer_notify_end_stepping_range() called\n"); 138 generic_observer_notify (end_stepping_range_subject, &args); 139} 140 141/* signal_exited notifications. */ 142 143static struct observer_list *signal_exited_subject = NULL; 144 145struct signal_exited_args { enum gdb_signal siggnal; }; 146 147static void 148observer_signal_exited_notification_stub (const void *data, const void *args_data) 149{ 150 observer_signal_exited_ftype *notify = (observer_signal_exited_ftype *) data; 151 const struct signal_exited_args *args = (const struct signal_exited_args *) args_data; 152 notify (args->siggnal); 153} 154 155struct observer * 156observer_attach_signal_exited (observer_signal_exited_ftype *f) 157{ 158 return generic_observer_attach (&signal_exited_subject, 159 &observer_signal_exited_notification_stub, 160 (void *) f); 161} 162 163void 164observer_detach_signal_exited (struct observer *observer) 165{ 166 generic_observer_detach (&signal_exited_subject, observer); 167} 168 169void 170observer_notify_signal_exited (enum gdb_signal siggnal) 171{ 172 struct signal_exited_args args; 173 args.siggnal = siggnal; 174 175 if (observer_debug) 176 fprintf_unfiltered (gdb_stdlog, "observer_notify_signal_exited() called\n"); 177 generic_observer_notify (signal_exited_subject, &args); 178} 179 180/* exited notifications. */ 181 182static struct observer_list *exited_subject = NULL; 183 184struct exited_args { int exitstatus; }; 185 186static void 187observer_exited_notification_stub (const void *data, const void *args_data) 188{ 189 observer_exited_ftype *notify = (observer_exited_ftype *) data; 190 const struct exited_args *args = (const struct exited_args *) args_data; 191 notify (args->exitstatus); 192} 193 194struct observer * 195observer_attach_exited (observer_exited_ftype *f) 196{ 197 return generic_observer_attach (&exited_subject, 198 &observer_exited_notification_stub, 199 (void *) f); 200} 201 202void 203observer_detach_exited (struct observer *observer) 204{ 205 generic_observer_detach (&exited_subject, observer); 206} 207 208void 209observer_notify_exited (int exitstatus) 210{ 211 struct exited_args args; 212 args.exitstatus = exitstatus; 213 214 if (observer_debug) 215 fprintf_unfiltered (gdb_stdlog, "observer_notify_exited() called\n"); 216 generic_observer_notify (exited_subject, &args); 217} 218 219/* no_history notifications. */ 220 221static struct observer_list *no_history_subject = NULL; 222 223static void 224observer_no_history_notification_stub (const void *data, const void *args_data) 225{ 226 observer_no_history_ftype *notify = (observer_no_history_ftype *) data; 227 notify (); 228} 229 230struct observer * 231observer_attach_no_history (observer_no_history_ftype *f) 232{ 233 return generic_observer_attach (&no_history_subject, 234 &observer_no_history_notification_stub, 235 (void *) f); 236} 237 238void 239observer_detach_no_history (struct observer *observer) 240{ 241 generic_observer_detach (&no_history_subject, observer); 242} 243 244void 245observer_notify_no_history (void) 246{ 247char *args = NULL; 248 if (observer_debug) 249 fprintf_unfiltered (gdb_stdlog, "observer_notify_no_history() called\n"); 250 generic_observer_notify (no_history_subject, &args); 251} 252 253/* sync_execution_done notifications. */ 254 255static struct observer_list *sync_execution_done_subject = NULL; 256 257static void 258observer_sync_execution_done_notification_stub (const void *data, const void *args_data) 259{ 260 observer_sync_execution_done_ftype *notify = (observer_sync_execution_done_ftype *) data; 261 notify (); 262} 263 264struct observer * 265observer_attach_sync_execution_done (observer_sync_execution_done_ftype *f) 266{ 267 return generic_observer_attach (&sync_execution_done_subject, 268 &observer_sync_execution_done_notification_stub, 269 (void *) f); 270} 271 272void 273observer_detach_sync_execution_done (struct observer *observer) 274{ 275 generic_observer_detach (&sync_execution_done_subject, observer); 276} 277 278void 279observer_notify_sync_execution_done (void) 280{ 281char *args = NULL; 282 if (observer_debug) 283 fprintf_unfiltered (gdb_stdlog, "observer_notify_sync_execution_done() called\n"); 284 generic_observer_notify (sync_execution_done_subject, &args); 285} 286 287/* command_error notifications. */ 288 289static struct observer_list *command_error_subject = NULL; 290 291static void 292observer_command_error_notification_stub (const void *data, const void *args_data) 293{ 294 observer_command_error_ftype *notify = (observer_command_error_ftype *) data; 295 notify (); 296} 297 298struct observer * 299observer_attach_command_error (observer_command_error_ftype *f) 300{ 301 return generic_observer_attach (&command_error_subject, 302 &observer_command_error_notification_stub, 303 (void *) f); 304} 305 306void 307observer_detach_command_error (struct observer *observer) 308{ 309 generic_observer_detach (&command_error_subject, observer); 310} 311 312void 313observer_notify_command_error (void) 314{ 315char *args = NULL; 316 if (observer_debug) 317 fprintf_unfiltered (gdb_stdlog, "observer_notify_command_error() called\n"); 318 generic_observer_notify (command_error_subject, &args); 319} 320 321/* target_changed notifications. */ 322 323static struct observer_list *target_changed_subject = NULL; 324 325struct target_changed_args { struct target_ops *target; }; 326 327static void 328observer_target_changed_notification_stub (const void *data, const void *args_data) 329{ 330 observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data; 331 const struct target_changed_args *args = (const struct target_changed_args *) args_data; 332 notify (args->target); 333} 334 335struct observer * 336observer_attach_target_changed (observer_target_changed_ftype *f) 337{ 338 return generic_observer_attach (&target_changed_subject, 339 &observer_target_changed_notification_stub, 340 (void *) f); 341} 342 343void 344observer_detach_target_changed (struct observer *observer) 345{ 346 generic_observer_detach (&target_changed_subject, observer); 347} 348 349void 350observer_notify_target_changed (struct target_ops *target) 351{ 352 struct target_changed_args args; 353 args.target = target; 354 355 if (observer_debug) 356 fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n"); 357 generic_observer_notify (target_changed_subject, &args); 358} 359 360/* executable_changed notifications. */ 361 362static struct observer_list *executable_changed_subject = NULL; 363 364static void 365observer_executable_changed_notification_stub (const void *data, const void *args_data) 366{ 367 observer_executable_changed_ftype *notify = (observer_executable_changed_ftype *) data; 368 notify (); 369} 370 371struct observer * 372observer_attach_executable_changed (observer_executable_changed_ftype *f) 373{ 374 return generic_observer_attach (&executable_changed_subject, 375 &observer_executable_changed_notification_stub, 376 (void *) f); 377} 378 379void 380observer_detach_executable_changed (struct observer *observer) 381{ 382 generic_observer_detach (&executable_changed_subject, observer); 383} 384 385void 386observer_notify_executable_changed (void) 387{ 388char *args = NULL; 389 if (observer_debug) 390 fprintf_unfiltered (gdb_stdlog, "observer_notify_executable_changed() called\n"); 391 generic_observer_notify (executable_changed_subject, &args); 392} 393 394/* inferior_created notifications. */ 395 396static struct observer_list *inferior_created_subject = NULL; 397 398struct inferior_created_args { struct target_ops *objfile; int from_tty; }; 399 400static void 401observer_inferior_created_notification_stub (const void *data, const void *args_data) 402{ 403 observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data; 404 const struct inferior_created_args *args = (const struct inferior_created_args *) args_data; 405 notify (args->objfile, args->from_tty); 406} 407 408struct observer * 409observer_attach_inferior_created (observer_inferior_created_ftype *f) 410{ 411 return generic_observer_attach (&inferior_created_subject, 412 &observer_inferior_created_notification_stub, 413 (void *) f); 414} 415 416void 417observer_detach_inferior_created (struct observer *observer) 418{ 419 generic_observer_detach (&inferior_created_subject, observer); 420} 421 422void 423observer_notify_inferior_created (struct target_ops *objfile, int from_tty) 424{ 425 struct inferior_created_args args; 426 args.objfile = objfile, args.from_tty = from_tty; 427 428 if (observer_debug) 429 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n"); 430 generic_observer_notify (inferior_created_subject, &args); 431} 432 433/* record_changed notifications. */ 434 435static struct observer_list *record_changed_subject = NULL; 436 437struct record_changed_args { struct inferior *inferior; int started; const char *method; const char *format; }; 438 439static void 440observer_record_changed_notification_stub (const void *data, const void *args_data) 441{ 442 observer_record_changed_ftype *notify = (observer_record_changed_ftype *) data; 443 const struct record_changed_args *args = (const struct record_changed_args *) args_data; 444 notify (args->inferior, args->started, args->method, args->format); 445} 446 447struct observer * 448observer_attach_record_changed (observer_record_changed_ftype *f) 449{ 450 return generic_observer_attach (&record_changed_subject, 451 &observer_record_changed_notification_stub, 452 (void *) f); 453} 454 455void 456observer_detach_record_changed (struct observer *observer) 457{ 458 generic_observer_detach (&record_changed_subject, observer); 459} 460 461void 462observer_notify_record_changed (struct inferior *inferior, int started, const char *method, const char *format) 463{ 464 struct record_changed_args args; 465 args.inferior = inferior, args.started = started, args.method = method, args.format = format; 466 467 if (observer_debug) 468 fprintf_unfiltered (gdb_stdlog, "observer_notify_record_changed() called\n"); 469 generic_observer_notify (record_changed_subject, &args); 470} 471 472/* solib_loaded notifications. */ 473 474static struct observer_list *solib_loaded_subject = NULL; 475 476struct solib_loaded_args { struct so_list *solib; }; 477 478static void 479observer_solib_loaded_notification_stub (const void *data, const void *args_data) 480{ 481 observer_solib_loaded_ftype *notify = (observer_solib_loaded_ftype *) data; 482 const struct solib_loaded_args *args = (const struct solib_loaded_args *) args_data; 483 notify (args->solib); 484} 485 486struct observer * 487observer_attach_solib_loaded (observer_solib_loaded_ftype *f) 488{ 489 return generic_observer_attach (&solib_loaded_subject, 490 &observer_solib_loaded_notification_stub, 491 (void *) f); 492} 493 494void 495observer_detach_solib_loaded (struct observer *observer) 496{ 497 generic_observer_detach (&solib_loaded_subject, observer); 498} 499 500void 501observer_notify_solib_loaded (struct so_list *solib) 502{ 503 struct solib_loaded_args args; 504 args.solib = solib; 505 506 if (observer_debug) 507 fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_loaded() called\n"); 508 generic_observer_notify (solib_loaded_subject, &args); 509} 510 511/* solib_unloaded notifications. */ 512 513static struct observer_list *solib_unloaded_subject = NULL; 514 515struct solib_unloaded_args { struct so_list *solib; }; 516 517static void 518observer_solib_unloaded_notification_stub (const void *data, const void *args_data) 519{ 520 observer_solib_unloaded_ftype *notify = (observer_solib_unloaded_ftype *) data; 521 const struct solib_unloaded_args *args = (const struct solib_unloaded_args *) args_data; 522 notify (args->solib); 523} 524 525struct observer * 526observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f) 527{ 528 return generic_observer_attach (&solib_unloaded_subject, 529 &observer_solib_unloaded_notification_stub, 530 (void *) f); 531} 532 533void 534observer_detach_solib_unloaded (struct observer *observer) 535{ 536 generic_observer_detach (&solib_unloaded_subject, observer); 537} 538 539void 540observer_notify_solib_unloaded (struct so_list *solib) 541{ 542 struct solib_unloaded_args args; 543 args.solib = solib; 544 545 if (observer_debug) 546 fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_unloaded() called\n"); 547 generic_observer_notify (solib_unloaded_subject, &args); 548} 549 550/* new_objfile notifications. */ 551 552static struct observer_list *new_objfile_subject = NULL; 553 554struct new_objfile_args { struct objfile *objfile; }; 555 556static void 557observer_new_objfile_notification_stub (const void *data, const void *args_data) 558{ 559 observer_new_objfile_ftype *notify = (observer_new_objfile_ftype *) data; 560 const struct new_objfile_args *args = (const struct new_objfile_args *) args_data; 561 notify (args->objfile); 562} 563 564struct observer * 565observer_attach_new_objfile (observer_new_objfile_ftype *f) 566{ 567 return generic_observer_attach (&new_objfile_subject, 568 &observer_new_objfile_notification_stub, 569 (void *) f); 570} 571 572void 573observer_detach_new_objfile (struct observer *observer) 574{ 575 generic_observer_detach (&new_objfile_subject, observer); 576} 577 578void 579observer_notify_new_objfile (struct objfile *objfile) 580{ 581 struct new_objfile_args args; 582 args.objfile = objfile; 583 584 if (observer_debug) 585 fprintf_unfiltered (gdb_stdlog, "observer_notify_new_objfile() called\n"); 586 generic_observer_notify (new_objfile_subject, &args); 587} 588 589/* free_objfile notifications. */ 590 591static struct observer_list *free_objfile_subject = NULL; 592 593struct free_objfile_args { struct objfile *objfile; }; 594 595static void 596observer_free_objfile_notification_stub (const void *data, const void *args_data) 597{ 598 observer_free_objfile_ftype *notify = (observer_free_objfile_ftype *) data; 599 const struct free_objfile_args *args = (const struct free_objfile_args *) args_data; 600 notify (args->objfile); 601} 602 603struct observer * 604observer_attach_free_objfile (observer_free_objfile_ftype *f) 605{ 606 return generic_observer_attach (&free_objfile_subject, 607 &observer_free_objfile_notification_stub, 608 (void *) f); 609} 610 611void 612observer_detach_free_objfile (struct observer *observer) 613{ 614 generic_observer_detach (&free_objfile_subject, observer); 615} 616 617void 618observer_notify_free_objfile (struct objfile *objfile) 619{ 620 struct free_objfile_args args; 621 args.objfile = objfile; 622 623 if (observer_debug) 624 fprintf_unfiltered (gdb_stdlog, "observer_notify_free_objfile() called\n"); 625 generic_observer_notify (free_objfile_subject, &args); 626} 627 628/* new_thread notifications. */ 629 630static struct observer_list *new_thread_subject = NULL; 631 632struct new_thread_args { struct thread_info *t; }; 633 634static void 635observer_new_thread_notification_stub (const void *data, const void *args_data) 636{ 637 observer_new_thread_ftype *notify = (observer_new_thread_ftype *) data; 638 const struct new_thread_args *args = (const struct new_thread_args *) args_data; 639 notify (args->t); 640} 641 642struct observer * 643observer_attach_new_thread (observer_new_thread_ftype *f) 644{ 645 return generic_observer_attach (&new_thread_subject, 646 &observer_new_thread_notification_stub, 647 (void *) f); 648} 649 650void 651observer_detach_new_thread (struct observer *observer) 652{ 653 generic_observer_detach (&new_thread_subject, observer); 654} 655 656void 657observer_notify_new_thread (struct thread_info *t) 658{ 659 struct new_thread_args args; 660 args.t = t; 661 662 if (observer_debug) 663 fprintf_unfiltered (gdb_stdlog, "observer_notify_new_thread() called\n"); 664 generic_observer_notify (new_thread_subject, &args); 665} 666 667/* thread_exit notifications. */ 668 669static struct observer_list *thread_exit_subject = NULL; 670 671struct thread_exit_args { struct thread_info *t; int silent; }; 672 673static void 674observer_thread_exit_notification_stub (const void *data, const void *args_data) 675{ 676 observer_thread_exit_ftype *notify = (observer_thread_exit_ftype *) data; 677 const struct thread_exit_args *args = (const struct thread_exit_args *) args_data; 678 notify (args->t, args->silent); 679} 680 681struct observer * 682observer_attach_thread_exit (observer_thread_exit_ftype *f) 683{ 684 return generic_observer_attach (&thread_exit_subject, 685 &observer_thread_exit_notification_stub, 686 (void *) f); 687} 688 689void 690observer_detach_thread_exit (struct observer *observer) 691{ 692 generic_observer_detach (&thread_exit_subject, observer); 693} 694 695void 696observer_notify_thread_exit (struct thread_info *t, int silent) 697{ 698 struct thread_exit_args args; 699 args.t = t, args.silent = silent; 700 701 if (observer_debug) 702 fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_exit() called\n"); 703 generic_observer_notify (thread_exit_subject, &args); 704} 705 706/* thread_stop_requested notifications. */ 707 708static struct observer_list *thread_stop_requested_subject = NULL; 709 710struct thread_stop_requested_args { ptid_t ptid; }; 711 712static void 713observer_thread_stop_requested_notification_stub (const void *data, const void *args_data) 714{ 715 observer_thread_stop_requested_ftype *notify = (observer_thread_stop_requested_ftype *) data; 716 const struct thread_stop_requested_args *args = (const struct thread_stop_requested_args *) args_data; 717 notify (args->ptid); 718} 719 720struct observer * 721observer_attach_thread_stop_requested (observer_thread_stop_requested_ftype *f) 722{ 723 return generic_observer_attach (&thread_stop_requested_subject, 724 &observer_thread_stop_requested_notification_stub, 725 (void *) f); 726} 727 728void 729observer_detach_thread_stop_requested (struct observer *observer) 730{ 731 generic_observer_detach (&thread_stop_requested_subject, observer); 732} 733 734void 735observer_notify_thread_stop_requested (ptid_t ptid) 736{ 737 struct thread_stop_requested_args args; 738 args.ptid = ptid; 739 740 if (observer_debug) 741 fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_stop_requested() called\n"); 742 generic_observer_notify (thread_stop_requested_subject, &args); 743} 744 745/* target_resumed notifications. */ 746 747static struct observer_list *target_resumed_subject = NULL; 748 749struct target_resumed_args { ptid_t ptid; }; 750 751static void 752observer_target_resumed_notification_stub (const void *data, const void *args_data) 753{ 754 observer_target_resumed_ftype *notify = (observer_target_resumed_ftype *) data; 755 const struct target_resumed_args *args = (const struct target_resumed_args *) args_data; 756 notify (args->ptid); 757} 758 759struct observer * 760observer_attach_target_resumed (observer_target_resumed_ftype *f) 761{ 762 return generic_observer_attach (&target_resumed_subject, 763 &observer_target_resumed_notification_stub, 764 (void *) f); 765} 766 767void 768observer_detach_target_resumed (struct observer *observer) 769{ 770 generic_observer_detach (&target_resumed_subject, observer); 771} 772 773void 774observer_notify_target_resumed (ptid_t ptid) 775{ 776 struct target_resumed_args args; 777 args.ptid = ptid; 778 779 if (observer_debug) 780 fprintf_unfiltered (gdb_stdlog, "observer_notify_target_resumed() called\n"); 781 generic_observer_notify (target_resumed_subject, &args); 782} 783 784/* about_to_proceed notifications. */ 785 786static struct observer_list *about_to_proceed_subject = NULL; 787 788static void 789observer_about_to_proceed_notification_stub (const void *data, const void *args_data) 790{ 791 observer_about_to_proceed_ftype *notify = (observer_about_to_proceed_ftype *) data; 792 notify (); 793} 794 795struct observer * 796observer_attach_about_to_proceed (observer_about_to_proceed_ftype *f) 797{ 798 return generic_observer_attach (&about_to_proceed_subject, 799 &observer_about_to_proceed_notification_stub, 800 (void *) f); 801} 802 803void 804observer_detach_about_to_proceed (struct observer *observer) 805{ 806 generic_observer_detach (&about_to_proceed_subject, observer); 807} 808 809void 810observer_notify_about_to_proceed (void) 811{ 812char *args = NULL; 813 if (observer_debug) 814 fprintf_unfiltered (gdb_stdlog, "observer_notify_about_to_proceed() called\n"); 815 generic_observer_notify (about_to_proceed_subject, &args); 816} 817 818/* breakpoint_created notifications. */ 819 820static struct observer_list *breakpoint_created_subject = NULL; 821 822struct breakpoint_created_args { struct breakpoint *b; }; 823 824static void 825observer_breakpoint_created_notification_stub (const void *data, const void *args_data) 826{ 827 observer_breakpoint_created_ftype *notify = (observer_breakpoint_created_ftype *) data; 828 const struct breakpoint_created_args *args = (const struct breakpoint_created_args *) args_data; 829 notify (args->b); 830} 831 832struct observer * 833observer_attach_breakpoint_created (observer_breakpoint_created_ftype *f) 834{ 835 return generic_observer_attach (&breakpoint_created_subject, 836 &observer_breakpoint_created_notification_stub, 837 (void *) f); 838} 839 840void 841observer_detach_breakpoint_created (struct observer *observer) 842{ 843 generic_observer_detach (&breakpoint_created_subject, observer); 844} 845 846void 847observer_notify_breakpoint_created (struct breakpoint *b) 848{ 849 struct breakpoint_created_args args; 850 args.b = b; 851 852 if (observer_debug) 853 fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_created() called\n"); 854 generic_observer_notify (breakpoint_created_subject, &args); 855} 856 857/* breakpoint_deleted notifications. */ 858 859static struct observer_list *breakpoint_deleted_subject = NULL; 860 861struct breakpoint_deleted_args { struct breakpoint *b; }; 862 863static void 864observer_breakpoint_deleted_notification_stub (const void *data, const void *args_data) 865{ 866 observer_breakpoint_deleted_ftype *notify = (observer_breakpoint_deleted_ftype *) data; 867 const struct breakpoint_deleted_args *args = (const struct breakpoint_deleted_args *) args_data; 868 notify (args->b); 869} 870 871struct observer * 872observer_attach_breakpoint_deleted (observer_breakpoint_deleted_ftype *f) 873{ 874 return generic_observer_attach (&breakpoint_deleted_subject, 875 &observer_breakpoint_deleted_notification_stub, 876 (void *) f); 877} 878 879void 880observer_detach_breakpoint_deleted (struct observer *observer) 881{ 882 generic_observer_detach (&breakpoint_deleted_subject, observer); 883} 884 885void 886observer_notify_breakpoint_deleted (struct breakpoint *b) 887{ 888 struct breakpoint_deleted_args args; 889 args.b = b; 890 891 if (observer_debug) 892 fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_deleted() called\n"); 893 generic_observer_notify (breakpoint_deleted_subject, &args); 894} 895 896/* breakpoint_modified notifications. */ 897 898static struct observer_list *breakpoint_modified_subject = NULL; 899 900struct breakpoint_modified_args { struct breakpoint *b; }; 901 902static void 903observer_breakpoint_modified_notification_stub (const void *data, const void *args_data) 904{ 905 observer_breakpoint_modified_ftype *notify = (observer_breakpoint_modified_ftype *) data; 906 const struct breakpoint_modified_args *args = (const struct breakpoint_modified_args *) args_data; 907 notify (args->b); 908} 909 910struct observer * 911observer_attach_breakpoint_modified (observer_breakpoint_modified_ftype *f) 912{ 913 return generic_observer_attach (&breakpoint_modified_subject, 914 &observer_breakpoint_modified_notification_stub, 915 (void *) f); 916} 917 918void 919observer_detach_breakpoint_modified (struct observer *observer) 920{ 921 generic_observer_detach (&breakpoint_modified_subject, observer); 922} 923 924void 925observer_notify_breakpoint_modified (struct breakpoint *b) 926{ 927 struct breakpoint_modified_args args; 928 args.b = b; 929 930 if (observer_debug) 931 fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_modified() called\n"); 932 generic_observer_notify (breakpoint_modified_subject, &args); 933} 934 935/* traceframe_changed notifications. */ 936 937static struct observer_list *traceframe_changed_subject = NULL; 938 939struct traceframe_changed_args { int tfnum; int tpnum; }; 940 941static void 942observer_traceframe_changed_notification_stub (const void *data, const void *args_data) 943{ 944 observer_traceframe_changed_ftype *notify = (observer_traceframe_changed_ftype *) data; 945 const struct traceframe_changed_args *args = (const struct traceframe_changed_args *) args_data; 946 notify (args->tfnum, args->tpnum); 947} 948 949struct observer * 950observer_attach_traceframe_changed (observer_traceframe_changed_ftype *f) 951{ 952 return generic_observer_attach (&traceframe_changed_subject, 953 &observer_traceframe_changed_notification_stub, 954 (void *) f); 955} 956 957void 958observer_detach_traceframe_changed (struct observer *observer) 959{ 960 generic_observer_detach (&traceframe_changed_subject, observer); 961} 962 963void 964observer_notify_traceframe_changed (int tfnum, int tpnum) 965{ 966 struct traceframe_changed_args args; 967 args.tfnum = tfnum, args.tpnum = tpnum; 968 969 if (observer_debug) 970 fprintf_unfiltered (gdb_stdlog, "observer_notify_traceframe_changed() called\n"); 971 generic_observer_notify (traceframe_changed_subject, &args); 972} 973 974/* architecture_changed notifications. */ 975 976static struct observer_list *architecture_changed_subject = NULL; 977 978struct architecture_changed_args { struct gdbarch *newarch; }; 979 980static void 981observer_architecture_changed_notification_stub (const void *data, const void *args_data) 982{ 983 observer_architecture_changed_ftype *notify = (observer_architecture_changed_ftype *) data; 984 const struct architecture_changed_args *args = (const struct architecture_changed_args *) args_data; 985 notify (args->newarch); 986} 987 988struct observer * 989observer_attach_architecture_changed (observer_architecture_changed_ftype *f) 990{ 991 return generic_observer_attach (&architecture_changed_subject, 992 &observer_architecture_changed_notification_stub, 993 (void *) f); 994} 995 996void 997observer_detach_architecture_changed (struct observer *observer) 998{ 999 generic_observer_detach (&architecture_changed_subject, observer); 1000} 1001 1002void 1003observer_notify_architecture_changed (struct gdbarch *newarch) 1004{ 1005 struct architecture_changed_args args; 1006 args.newarch = newarch; 1007 1008 if (observer_debug) 1009 fprintf_unfiltered (gdb_stdlog, "observer_notify_architecture_changed() called\n"); 1010 generic_observer_notify (architecture_changed_subject, &args); 1011} 1012 1013/* thread_ptid_changed notifications. */ 1014 1015static struct observer_list *thread_ptid_changed_subject = NULL; 1016 1017struct thread_ptid_changed_args { ptid_t old_ptid; ptid_t new_ptid; }; 1018 1019static void 1020observer_thread_ptid_changed_notification_stub (const void *data, const void *args_data) 1021{ 1022 observer_thread_ptid_changed_ftype *notify = (observer_thread_ptid_changed_ftype *) data; 1023 const struct thread_ptid_changed_args *args = (const struct thread_ptid_changed_args *) args_data; 1024 notify (args->old_ptid, args->new_ptid); 1025} 1026 1027struct observer * 1028observer_attach_thread_ptid_changed (observer_thread_ptid_changed_ftype *f) 1029{ 1030 return generic_observer_attach (&thread_ptid_changed_subject, 1031 &observer_thread_ptid_changed_notification_stub, 1032 (void *) f); 1033} 1034 1035void 1036observer_detach_thread_ptid_changed (struct observer *observer) 1037{ 1038 generic_observer_detach (&thread_ptid_changed_subject, observer); 1039} 1040 1041void 1042observer_notify_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid) 1043{ 1044 struct thread_ptid_changed_args args; 1045 args.old_ptid = old_ptid, args.new_ptid = new_ptid; 1046 1047 if (observer_debug) 1048 fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_ptid_changed() called\n"); 1049 generic_observer_notify (thread_ptid_changed_subject, &args); 1050} 1051 1052/* inferior_added notifications. */ 1053 1054static struct observer_list *inferior_added_subject = NULL; 1055 1056struct inferior_added_args { struct inferior *inf; }; 1057 1058static void 1059observer_inferior_added_notification_stub (const void *data, const void *args_data) 1060{ 1061 observer_inferior_added_ftype *notify = (observer_inferior_added_ftype *) data; 1062 const struct inferior_added_args *args = (const struct inferior_added_args *) args_data; 1063 notify (args->inf); 1064} 1065 1066struct observer * 1067observer_attach_inferior_added (observer_inferior_added_ftype *f) 1068{ 1069 return generic_observer_attach (&inferior_added_subject, 1070 &observer_inferior_added_notification_stub, 1071 (void *) f); 1072} 1073 1074void 1075observer_detach_inferior_added (struct observer *observer) 1076{ 1077 generic_observer_detach (&inferior_added_subject, observer); 1078} 1079 1080void 1081observer_notify_inferior_added (struct inferior *inf) 1082{ 1083 struct inferior_added_args args; 1084 args.inf = inf; 1085 1086 if (observer_debug) 1087 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_added() called\n"); 1088 generic_observer_notify (inferior_added_subject, &args); 1089} 1090 1091/* inferior_appeared notifications. */ 1092 1093static struct observer_list *inferior_appeared_subject = NULL; 1094 1095struct inferior_appeared_args { struct inferior *inf; }; 1096 1097static void 1098observer_inferior_appeared_notification_stub (const void *data, const void *args_data) 1099{ 1100 observer_inferior_appeared_ftype *notify = (observer_inferior_appeared_ftype *) data; 1101 const struct inferior_appeared_args *args = (const struct inferior_appeared_args *) args_data; 1102 notify (args->inf); 1103} 1104 1105struct observer * 1106observer_attach_inferior_appeared (observer_inferior_appeared_ftype *f) 1107{ 1108 return generic_observer_attach (&inferior_appeared_subject, 1109 &observer_inferior_appeared_notification_stub, 1110 (void *) f); 1111} 1112 1113void 1114observer_detach_inferior_appeared (struct observer *observer) 1115{ 1116 generic_observer_detach (&inferior_appeared_subject, observer); 1117} 1118 1119void 1120observer_notify_inferior_appeared (struct inferior *inf) 1121{ 1122 struct inferior_appeared_args args; 1123 args.inf = inf; 1124 1125 if (observer_debug) 1126 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_appeared() called\n"); 1127 generic_observer_notify (inferior_appeared_subject, &args); 1128} 1129 1130/* inferior_exit notifications. */ 1131 1132static struct observer_list *inferior_exit_subject = NULL; 1133 1134struct inferior_exit_args { struct inferior *inf; }; 1135 1136static void 1137observer_inferior_exit_notification_stub (const void *data, const void *args_data) 1138{ 1139 observer_inferior_exit_ftype *notify = (observer_inferior_exit_ftype *) data; 1140 const struct inferior_exit_args *args = (const struct inferior_exit_args *) args_data; 1141 notify (args->inf); 1142} 1143 1144struct observer * 1145observer_attach_inferior_exit (observer_inferior_exit_ftype *f) 1146{ 1147 return generic_observer_attach (&inferior_exit_subject, 1148 &observer_inferior_exit_notification_stub, 1149 (void *) f); 1150} 1151 1152void 1153observer_detach_inferior_exit (struct observer *observer) 1154{ 1155 generic_observer_detach (&inferior_exit_subject, observer); 1156} 1157 1158void 1159observer_notify_inferior_exit (struct inferior *inf) 1160{ 1161 struct inferior_exit_args args; 1162 args.inf = inf; 1163 1164 if (observer_debug) 1165 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_exit() called\n"); 1166 generic_observer_notify (inferior_exit_subject, &args); 1167} 1168 1169/* inferior_removed notifications. */ 1170 1171static struct observer_list *inferior_removed_subject = NULL; 1172 1173struct inferior_removed_args { struct inferior *inf; }; 1174 1175static void 1176observer_inferior_removed_notification_stub (const void *data, const void *args_data) 1177{ 1178 observer_inferior_removed_ftype *notify = (observer_inferior_removed_ftype *) data; 1179 const struct inferior_removed_args *args = (const struct inferior_removed_args *) args_data; 1180 notify (args->inf); 1181} 1182 1183struct observer * 1184observer_attach_inferior_removed (observer_inferior_removed_ftype *f) 1185{ 1186 return generic_observer_attach (&inferior_removed_subject, 1187 &observer_inferior_removed_notification_stub, 1188 (void *) f); 1189} 1190 1191void 1192observer_detach_inferior_removed (struct observer *observer) 1193{ 1194 generic_observer_detach (&inferior_removed_subject, observer); 1195} 1196 1197void 1198observer_notify_inferior_removed (struct inferior *inf) 1199{ 1200 struct inferior_removed_args args; 1201 args.inf = inf; 1202 1203 if (observer_debug) 1204 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_removed() called\n"); 1205 generic_observer_notify (inferior_removed_subject, &args); 1206} 1207 1208/* memory_changed notifications. */ 1209 1210static struct observer_list *memory_changed_subject = NULL; 1211 1212struct memory_changed_args { struct inferior *inferior; CORE_ADDR addr; ssize_t len; const bfd_byte *data; }; 1213 1214static void 1215observer_memory_changed_notification_stub (const void *data, const void *args_data) 1216{ 1217 observer_memory_changed_ftype *notify = (observer_memory_changed_ftype *) data; 1218 const struct memory_changed_args *args = (const struct memory_changed_args *) args_data; 1219 notify (args->inferior, args->addr, args->len, args->data); 1220} 1221 1222struct observer * 1223observer_attach_memory_changed (observer_memory_changed_ftype *f) 1224{ 1225 return generic_observer_attach (&memory_changed_subject, 1226 &observer_memory_changed_notification_stub, 1227 (void *) f); 1228} 1229 1230void 1231observer_detach_memory_changed (struct observer *observer) 1232{ 1233 generic_observer_detach (&memory_changed_subject, observer); 1234} 1235 1236void 1237observer_notify_memory_changed (struct inferior *inferior, CORE_ADDR addr, ssize_t len, const bfd_byte *data) 1238{ 1239 struct memory_changed_args args; 1240 args.inferior = inferior, args.addr = addr, args.len = len, args.data = data; 1241 1242 if (observer_debug) 1243 fprintf_unfiltered (gdb_stdlog, "observer_notify_memory_changed() called\n"); 1244 generic_observer_notify (memory_changed_subject, &args); 1245} 1246 1247/* before_prompt notifications. */ 1248 1249static struct observer_list *before_prompt_subject = NULL; 1250 1251struct before_prompt_args { const char *current_prompt; }; 1252 1253static void 1254observer_before_prompt_notification_stub (const void *data, const void *args_data) 1255{ 1256 observer_before_prompt_ftype *notify = (observer_before_prompt_ftype *) data; 1257 const struct before_prompt_args *args = (const struct before_prompt_args *) args_data; 1258 notify (args->current_prompt); 1259} 1260 1261struct observer * 1262observer_attach_before_prompt (observer_before_prompt_ftype *f) 1263{ 1264 return generic_observer_attach (&before_prompt_subject, 1265 &observer_before_prompt_notification_stub, 1266 (void *) f); 1267} 1268 1269void 1270observer_detach_before_prompt (struct observer *observer) 1271{ 1272 generic_observer_detach (&before_prompt_subject, observer); 1273} 1274 1275void 1276observer_notify_before_prompt (const char *current_prompt) 1277{ 1278 struct before_prompt_args args; 1279 args.current_prompt = current_prompt; 1280 1281 if (observer_debug) 1282 fprintf_unfiltered (gdb_stdlog, "observer_notify_before_prompt() called\n"); 1283 generic_observer_notify (before_prompt_subject, &args); 1284} 1285 1286/* gdb_datadir_changed notifications. */ 1287 1288static struct observer_list *gdb_datadir_changed_subject = NULL; 1289 1290static void 1291observer_gdb_datadir_changed_notification_stub (const void *data, const void *args_data) 1292{ 1293 observer_gdb_datadir_changed_ftype *notify = (observer_gdb_datadir_changed_ftype *) data; 1294 notify (); 1295} 1296 1297struct observer * 1298observer_attach_gdb_datadir_changed (observer_gdb_datadir_changed_ftype *f) 1299{ 1300 return generic_observer_attach (&gdb_datadir_changed_subject, 1301 &observer_gdb_datadir_changed_notification_stub, 1302 (void *) f); 1303} 1304 1305void 1306observer_detach_gdb_datadir_changed (struct observer *observer) 1307{ 1308 generic_observer_detach (&gdb_datadir_changed_subject, observer); 1309} 1310 1311void 1312observer_notify_gdb_datadir_changed (void) 1313{ 1314char *args = NULL; 1315 if (observer_debug) 1316 fprintf_unfiltered (gdb_stdlog, "observer_notify_gdb_datadir_changed() called\n"); 1317 generic_observer_notify (gdb_datadir_changed_subject, &args); 1318} 1319 1320/* command_param_changed notifications. */ 1321 1322static struct observer_list *command_param_changed_subject = NULL; 1323 1324struct command_param_changed_args { const char *param; const char *value; }; 1325 1326static void 1327observer_command_param_changed_notification_stub (const void *data, const void *args_data) 1328{ 1329 observer_command_param_changed_ftype *notify = (observer_command_param_changed_ftype *) data; 1330 const struct command_param_changed_args *args = (const struct command_param_changed_args *) args_data; 1331 notify (args->param, args->value); 1332} 1333 1334struct observer * 1335observer_attach_command_param_changed (observer_command_param_changed_ftype *f) 1336{ 1337 return generic_observer_attach (&command_param_changed_subject, 1338 &observer_command_param_changed_notification_stub, 1339 (void *) f); 1340} 1341 1342void 1343observer_detach_command_param_changed (struct observer *observer) 1344{ 1345 generic_observer_detach (&command_param_changed_subject, observer); 1346} 1347 1348void 1349observer_notify_command_param_changed (const char *param, const char *value) 1350{ 1351 struct command_param_changed_args args; 1352 args.param = param, args.value = value; 1353 1354 if (observer_debug) 1355 fprintf_unfiltered (gdb_stdlog, "observer_notify_command_param_changed() called\n"); 1356 generic_observer_notify (command_param_changed_subject, &args); 1357} 1358 1359/* tsv_created notifications. */ 1360 1361static struct observer_list *tsv_created_subject = NULL; 1362 1363struct tsv_created_args { const struct trace_state_variable *tsv; }; 1364 1365static void 1366observer_tsv_created_notification_stub (const void *data, const void *args_data) 1367{ 1368 observer_tsv_created_ftype *notify = (observer_tsv_created_ftype *) data; 1369 const struct tsv_created_args *args = (const struct tsv_created_args *) args_data; 1370 notify (args->tsv); 1371} 1372 1373struct observer * 1374observer_attach_tsv_created (observer_tsv_created_ftype *f) 1375{ 1376 return generic_observer_attach (&tsv_created_subject, 1377 &observer_tsv_created_notification_stub, 1378 (void *) f); 1379} 1380 1381void 1382observer_detach_tsv_created (struct observer *observer) 1383{ 1384 generic_observer_detach (&tsv_created_subject, observer); 1385} 1386 1387void 1388observer_notify_tsv_created (const struct trace_state_variable *tsv) 1389{ 1390 struct tsv_created_args args; 1391 args.tsv = tsv; 1392 1393 if (observer_debug) 1394 fprintf_unfiltered (gdb_stdlog, "observer_notify_tsv_created() called\n"); 1395 generic_observer_notify (tsv_created_subject, &args); 1396} 1397 1398/* tsv_deleted notifications. */ 1399 1400static struct observer_list *tsv_deleted_subject = NULL; 1401 1402struct tsv_deleted_args { const struct trace_state_variable *tsv; }; 1403 1404static void 1405observer_tsv_deleted_notification_stub (const void *data, const void *args_data) 1406{ 1407 observer_tsv_deleted_ftype *notify = (observer_tsv_deleted_ftype *) data; 1408 const struct tsv_deleted_args *args = (const struct tsv_deleted_args *) args_data; 1409 notify (args->tsv); 1410} 1411 1412struct observer * 1413observer_attach_tsv_deleted (observer_tsv_deleted_ftype *f) 1414{ 1415 return generic_observer_attach (&tsv_deleted_subject, 1416 &observer_tsv_deleted_notification_stub, 1417 (void *) f); 1418} 1419 1420void 1421observer_detach_tsv_deleted (struct observer *observer) 1422{ 1423 generic_observer_detach (&tsv_deleted_subject, observer); 1424} 1425 1426void 1427observer_notify_tsv_deleted (const struct trace_state_variable *tsv) 1428{ 1429 struct tsv_deleted_args args; 1430 args.tsv = tsv; 1431 1432 if (observer_debug) 1433 fprintf_unfiltered (gdb_stdlog, "observer_notify_tsv_deleted() called\n"); 1434 generic_observer_notify (tsv_deleted_subject, &args); 1435} 1436 1437/* tsv_modified notifications. */ 1438 1439static struct observer_list *tsv_modified_subject = NULL; 1440 1441struct tsv_modified_args { const struct trace_state_variable *tsv; }; 1442 1443static void 1444observer_tsv_modified_notification_stub (const void *data, const void *args_data) 1445{ 1446 observer_tsv_modified_ftype *notify = (observer_tsv_modified_ftype *) data; 1447 const struct tsv_modified_args *args = (const struct tsv_modified_args *) args_data; 1448 notify (args->tsv); 1449} 1450 1451struct observer * 1452observer_attach_tsv_modified (observer_tsv_modified_ftype *f) 1453{ 1454 return generic_observer_attach (&tsv_modified_subject, 1455 &observer_tsv_modified_notification_stub, 1456 (void *) f); 1457} 1458 1459void 1460observer_detach_tsv_modified (struct observer *observer) 1461{ 1462 generic_observer_detach (&tsv_modified_subject, observer); 1463} 1464 1465void 1466observer_notify_tsv_modified (const struct trace_state_variable *tsv) 1467{ 1468 struct tsv_modified_args args; 1469 args.tsv = tsv; 1470 1471 if (observer_debug) 1472 fprintf_unfiltered (gdb_stdlog, "observer_notify_tsv_modified() called\n"); 1473 generic_observer_notify (tsv_modified_subject, &args); 1474} 1475 1476/* inferior_call_pre notifications. */ 1477 1478static struct observer_list *inferior_call_pre_subject = NULL; 1479 1480struct inferior_call_pre_args { ptid_t thread; CORE_ADDR address; }; 1481 1482static void 1483observer_inferior_call_pre_notification_stub (const void *data, const void *args_data) 1484{ 1485 observer_inferior_call_pre_ftype *notify = (observer_inferior_call_pre_ftype *) data; 1486 const struct inferior_call_pre_args *args = (const struct inferior_call_pre_args *) args_data; 1487 notify (args->thread, args->address); 1488} 1489 1490struct observer * 1491observer_attach_inferior_call_pre (observer_inferior_call_pre_ftype *f) 1492{ 1493 return generic_observer_attach (&inferior_call_pre_subject, 1494 &observer_inferior_call_pre_notification_stub, 1495 (void *) f); 1496} 1497 1498void 1499observer_detach_inferior_call_pre (struct observer *observer) 1500{ 1501 generic_observer_detach (&inferior_call_pre_subject, observer); 1502} 1503 1504void 1505observer_notify_inferior_call_pre (ptid_t thread, CORE_ADDR address) 1506{ 1507 struct inferior_call_pre_args args; 1508 args.thread = thread, args.address = address; 1509 1510 if (observer_debug) 1511 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_call_pre() called\n"); 1512 generic_observer_notify (inferior_call_pre_subject, &args); 1513} 1514 1515/* inferior_call_post notifications. */ 1516 1517static struct observer_list *inferior_call_post_subject = NULL; 1518 1519struct inferior_call_post_args { ptid_t thread; CORE_ADDR address; }; 1520 1521static void 1522observer_inferior_call_post_notification_stub (const void *data, const void *args_data) 1523{ 1524 observer_inferior_call_post_ftype *notify = (observer_inferior_call_post_ftype *) data; 1525 const struct inferior_call_post_args *args = (const struct inferior_call_post_args *) args_data; 1526 notify (args->thread, args->address); 1527} 1528 1529struct observer * 1530observer_attach_inferior_call_post (observer_inferior_call_post_ftype *f) 1531{ 1532 return generic_observer_attach (&inferior_call_post_subject, 1533 &observer_inferior_call_post_notification_stub, 1534 (void *) f); 1535} 1536 1537void 1538observer_detach_inferior_call_post (struct observer *observer) 1539{ 1540 generic_observer_detach (&inferior_call_post_subject, observer); 1541} 1542 1543void 1544observer_notify_inferior_call_post (ptid_t thread, CORE_ADDR address) 1545{ 1546 struct inferior_call_post_args args; 1547 args.thread = thread, args.address = address; 1548 1549 if (observer_debug) 1550 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_call_post() called\n"); 1551 generic_observer_notify (inferior_call_post_subject, &args); 1552} 1553 1554/* register_changed notifications. */ 1555 1556static struct observer_list *register_changed_subject = NULL; 1557 1558struct register_changed_args { struct frame_info *frame; int regnum; }; 1559 1560static void 1561observer_register_changed_notification_stub (const void *data, const void *args_data) 1562{ 1563 observer_register_changed_ftype *notify = (observer_register_changed_ftype *) data; 1564 const struct register_changed_args *args = (const struct register_changed_args *) args_data; 1565 notify (args->frame, args->regnum); 1566} 1567 1568struct observer * 1569observer_attach_register_changed (observer_register_changed_ftype *f) 1570{ 1571 return generic_observer_attach (®ister_changed_subject, 1572 &observer_register_changed_notification_stub, 1573 (void *) f); 1574} 1575 1576void 1577observer_detach_register_changed (struct observer *observer) 1578{ 1579 generic_observer_detach (®ister_changed_subject, observer); 1580} 1581 1582void 1583observer_notify_register_changed (struct frame_info *frame, int regnum) 1584{ 1585 struct register_changed_args args; 1586 args.frame = frame, args.regnum = regnum; 1587 1588 if (observer_debug) 1589 fprintf_unfiltered (gdb_stdlog, "observer_notify_register_changed() called\n"); 1590 generic_observer_notify (register_changed_subject, &args); 1591} 1592 1593/* test_notification notifications. */ 1594 1595static struct observer_list *test_notification_subject = NULL; 1596 1597struct test_notification_args { int somearg; }; 1598 1599static void 1600observer_test_notification_notification_stub (const void *data, const void *args_data) 1601{ 1602 observer_test_notification_ftype *notify = (observer_test_notification_ftype *) data; 1603 const struct test_notification_args *args = (const struct test_notification_args *) args_data; 1604 notify (args->somearg); 1605} 1606 1607struct observer * 1608observer_attach_test_notification (observer_test_notification_ftype *f) 1609{ 1610 return generic_observer_attach (&test_notification_subject, 1611 &observer_test_notification_notification_stub, 1612 (void *) f); 1613} 1614 1615void 1616observer_detach_test_notification (struct observer *observer) 1617{ 1618 generic_observer_detach (&test_notification_subject, observer); 1619} 1620 1621void 1622observer_notify_test_notification (int somearg) 1623{ 1624 struct test_notification_args args; 1625 args.somearg = somearg; 1626 1627 if (observer_debug) 1628 fprintf_unfiltered (gdb_stdlog, "observer_notify_test_notification() called\n"); 1629 generic_observer_notify (test_notification_subject, &args); 1630} 1631 1632/* user_selected_context_changed notifications. */ 1633 1634static struct observer_list *user_selected_context_changed_subject = NULL; 1635 1636struct user_selected_context_changed_args { user_selected_what selection; }; 1637 1638static void 1639observer_user_selected_context_changed_notification_stub (const void *data, const void *args_data) 1640{ 1641 observer_user_selected_context_changed_ftype *notify = (observer_user_selected_context_changed_ftype *) data; 1642 const struct user_selected_context_changed_args *args = (const struct user_selected_context_changed_args *) args_data; 1643 notify (args->selection); 1644} 1645 1646struct observer * 1647observer_attach_user_selected_context_changed (observer_user_selected_context_changed_ftype *f) 1648{ 1649 return generic_observer_attach (&user_selected_context_changed_subject, 1650 &observer_user_selected_context_changed_notification_stub, 1651 (void *) f); 1652} 1653 1654void 1655observer_detach_user_selected_context_changed (struct observer *observer) 1656{ 1657 generic_observer_detach (&user_selected_context_changed_subject, observer); 1658} 1659 1660void 1661observer_notify_user_selected_context_changed (user_selected_what selection) 1662{ 1663 struct user_selected_context_changed_args args; 1664 args.selection = selection; 1665 1666 if (observer_debug) 1667 fprintf_unfiltered (gdb_stdlog, "observer_notify_user_selected_context_changed() called\n"); 1668 generic_observer_notify (user_selected_context_changed_subject, &args); 1669} 1670