121308Sache/* This file is automatically generated. DO NOT EDIT! */ 221308Sache/* Generated from: NetBSD: mknative-gdb,v 1.7 2016/10/16 04:37:42 mrg Exp */ 3157184Sache/* Generated from: NetBSD: mknative.common,v 1.15 2017/11/29 03:32:28 christos Exp */ 421308Sache 521308Sache/* GDB Notifications to Observers. 621308Sache 721308Sache Copyright (C) 2004-2017 Free Software Foundation, Inc. 821308Sache 921308Sache This file is part of GDB. 1058310Sache 1121308Sache This program is free software; you can redistribute it and/or modify 1221308Sache it under the terms of the GNU General Public License as published by 1321308Sache the Free Software Foundation; either version 3 of the License, or 1421308Sache (at your option) any later version. 1521308Sache 1621308Sache This program is distributed in the hope that it will be useful, 1721308Sache but WITHOUT ANY WARRANTY; without even the implied warranty of 1821308Sache MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1921308Sache GNU General Public License for more details. 2021308Sache 2158310Sache You should have received a copy of the GNU General Public License 2221308Sache along with this program. If not, see <http://www.gnu.org/licenses/>. 2321308Sache 2421308Sache -- 2521308Sache 2621308Sache This file was generated using observer.sh and observer.texi. */ 2721308Sache 2821308Sache 2921308Sache/* normal_stop notifications. */ 3021308Sache 3121308Sachestatic struct observer_list *normal_stop_subject = NULL; 3221308Sache 3321308Sachestruct normal_stop_args { struct bpstats *bs; int print_frame; }; 3421308Sache 3521308Sachestatic void 3621308Sacheobserver_normal_stop_notification_stub (const void *data, const void *args_data) 3721308Sache{ 3821308Sache observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data; 3921308Sache const struct normal_stop_args *args = (const struct normal_stop_args *) args_data; 4021308Sache notify (args->bs, args->print_frame); 4121308Sache} 4221308Sache 4321308Sachestruct observer * 4421308Sacheobserver_attach_normal_stop (observer_normal_stop_ftype *f) 4521308Sache{ 4621308Sache return generic_observer_attach (&normal_stop_subject, 4721308Sache &observer_normal_stop_notification_stub, 4858310Sache (void *) f); 4958310Sache} 5021308Sache 5121308Sachevoid 5221308Sacheobserver_detach_normal_stop (struct observer *observer) 5321308Sache{ 5421308Sache generic_observer_detach (&normal_stop_subject, observer); 5521308Sache} 5621308Sache 5721308Sachevoid 5821308Sacheobserver_notify_normal_stop (struct bpstats *bs, int print_frame) 5921308Sache{ 6021308Sache struct normal_stop_args args; 6121308Sache args.bs = bs, args.print_frame = print_frame; 6221308Sache 6321308Sache if (observer_debug) 6475406Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n"); 6521308Sache generic_observer_notify (normal_stop_subject, &args); 6621308Sache} 6721308Sache 6858310Sache/* signal_received notifications. */ 6958310Sache 7058310Sachestatic struct observer_list *signal_received_subject = NULL; 7158310Sache 7258310Sachestruct signal_received_args { enum gdb_signal siggnal; }; 7358310Sache 7458310Sachestatic void 7547558Sacheobserver_signal_received_notification_stub (const void *data, const void *args_data) 76136644Sache{ 77136644Sache observer_signal_received_ftype *notify = (observer_signal_received_ftype *) data; 78136644Sache const struct signal_received_args *args = (const struct signal_received_args *) args_data; 79136644Sache notify (args->siggnal); 80119610Sache} 81119610Sache 8247558Sachestruct observer * 8347558Sacheobserver_attach_signal_received (observer_signal_received_ftype *f) 8447558Sache{ 8547558Sache return generic_observer_attach (&signal_received_subject, 8647558Sache &observer_signal_received_notification_stub, 8747558Sache (void *) f); 8847558Sache} 8947558Sache 9047558Sachevoid 9147558Sacheobserver_detach_signal_received (struct observer *observer) 92136644Sache{ 93136644Sache generic_observer_detach (&signal_received_subject, observer); 9447558Sache} 9547558Sache 9647558Sachevoid 9747558Sacheobserver_notify_signal_received (enum gdb_signal siggnal) 9847558Sache{ 9921308Sache struct signal_received_args args; 10021308Sache args.siggnal = siggnal; 10121308Sache 10221308Sache if (observer_debug) 10321308Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_signal_received() called\n"); 10421308Sache generic_observer_notify (signal_received_subject, &args); 10547558Sache} 10647558Sache 10726497Sache/* end_stepping_range notifications. */ 10826497Sache 10921308Sachestatic struct observer_list *end_stepping_range_subject = NULL; 11021308Sache 11121308Sachestatic void 11221308Sacheobserver_end_stepping_range_notification_stub (const void *data, const void *args_data) 11321308Sache{ 11421308Sache observer_end_stepping_range_ftype *notify = (observer_end_stepping_range_ftype *) data; 11521308Sache notify (); 11621308Sache} 11721308Sache 11821308Sachestruct observer * 11921308Sacheobserver_attach_end_stepping_range (observer_end_stepping_range_ftype *f) 12021308Sache{ 12121308Sache return generic_observer_attach (&end_stepping_range_subject, 12221308Sache &observer_end_stepping_range_notification_stub, 12321308Sache (void *) f); 12426497Sache} 12526497Sache 12626497Sachevoid 12721308Sacheobserver_detach_end_stepping_range (struct observer *observer) 12821308Sache{ 12975406Sache generic_observer_detach (&end_stepping_range_subject, observer); 13075406Sache} 13121308Sache 13221308Sachevoid 13321308Sacheobserver_notify_end_stepping_range (void) 134157184Sache{ 13521308Sachechar *args = NULL; 136157184Sache if (observer_debug) 137157184Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_end_stepping_range() called\n"); 138157184Sache generic_observer_notify (end_stepping_range_subject, &args); 13926497Sache} 14021308Sache 14121308Sache/* signal_exited notifications. */ 14221308Sache 14321308Sachestatic struct observer_list *signal_exited_subject = NULL; 14421308Sache 14547558Sachestruct signal_exited_args { enum gdb_signal siggnal; }; 14647558Sache 14721308Sachestatic void 148157184Sacheobserver_signal_exited_notification_stub (const void *data, const void *args_data) 14921308Sache{ 15021308Sache observer_signal_exited_ftype *notify = (observer_signal_exited_ftype *) data; 15121308Sache const struct signal_exited_args *args = (const struct signal_exited_args *) args_data; 15221308Sache notify (args->siggnal); 15321308Sache} 154157184Sache 15521308Sachestruct observer * 156157184Sacheobserver_attach_signal_exited (observer_signal_exited_ftype *f) 157157184Sache{ 15847558Sache return generic_observer_attach (&signal_exited_subject, 159157184Sache &observer_signal_exited_notification_stub, 16047558Sache (void *) f); 16121308Sache} 16221308Sache 163165670Sachevoid 16421308Sacheobserver_detach_signal_exited (struct observer *observer) 16521308Sache{ 16621308Sache generic_observer_detach (&signal_exited_subject, observer); 16721308Sache} 16821308Sache 16921308Sachevoid 17021308Sacheobserver_notify_signal_exited (enum gdb_signal siggnal) 17121308Sache{ 17258310Sache struct signal_exited_args args; 17358310Sache args.siggnal = siggnal; 17458310Sache 17558310Sache if (observer_debug) 176157184Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_signal_exited() called\n"); 17721308Sache generic_observer_notify (signal_exited_subject, &args); 178157184Sache} 179157184Sache 180157184Sache/* exited notifications. */ 18121308Sache 18221308Sachestatic struct observer_list *exited_subject = NULL; 18321308Sache 18421308Sachestruct exited_args { int exitstatus; }; 18521308Sache 18621308Sachestatic void 18721308Sacheobserver_exited_notification_stub (const void *data, const void *args_data) 18821308Sache{ 18921308Sache observer_exited_ftype *notify = (observer_exited_ftype *) data; 19021308Sache const struct exited_args *args = (const struct exited_args *) args_data; 19147558Sache notify (args->exitstatus); 19221308Sache} 19321308Sache 19475406Sachestruct observer * 19521308Sacheobserver_attach_exited (observer_exited_ftype *f) 19621308Sache{ 19721308Sache return generic_observer_attach (&exited_subject, 19821308Sache &observer_exited_notification_stub, 19921308Sache (void *) f); 20047558Sache} 20121308Sache 20221308Sachevoid 20321308Sacheobserver_detach_exited (struct observer *observer) 20421308Sache{ 20526497Sache generic_observer_detach (&exited_subject, observer); 20626497Sache} 20726497Sache 20826497Sachevoid 20926497Sacheobserver_notify_exited (int exitstatus) 21026497Sache{ 21126497Sache struct exited_args args; 21247558Sache args.exitstatus = exitstatus; 21326497Sache 21426497Sache if (observer_debug) 21575406Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_exited() called\n"); 21647558Sache generic_observer_notify (exited_subject, &args); 21721308Sache} 21821308Sache 21921308Sache/* no_history notifications. */ 22021308Sache 22121308Sachestatic struct observer_list *no_history_subject = NULL; 22221308Sache 22375406Sachestatic void 22421308Sacheobserver_no_history_notification_stub (const void *data, const void *args_data) 22521308Sache{ 22621308Sache observer_no_history_ftype *notify = (observer_no_history_ftype *) data; 22721308Sache notify (); 22821308Sache} 22921308Sache 23021308Sachestruct observer * 23121308Sacheobserver_attach_no_history (observer_no_history_ftype *f) 23221308Sache{ 23321308Sache return generic_observer_attach (&no_history_subject, 23421308Sache &observer_no_history_notification_stub, 23521308Sache (void *) f); 23621308Sache} 23721308Sache 23821308Sachevoid 23921308Sacheobserver_detach_no_history (struct observer *observer) 24021308Sache{ 24121308Sache generic_observer_detach (&no_history_subject, observer); 24221308Sache} 24321308Sache 24421308Sachevoid 24521308Sacheobserver_notify_no_history (void) 24621308Sache{ 24721308Sachechar *args = NULL; 24821308Sache if (observer_debug) 24921308Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_no_history() called\n"); 25058310Sache generic_observer_notify (no_history_subject, &args); 25121308Sache} 25221308Sache 25321308Sache/* sync_execution_done notifications. */ 25421308Sache 255136644Sachestatic struct observer_list *sync_execution_done_subject = NULL; 25621308Sache 25721308Sachestatic void 25858310Sacheobserver_sync_execution_done_notification_stub (const void *data, const void *args_data) 25921308Sache{ 26058310Sache observer_sync_execution_done_ftype *notify = (observer_sync_execution_done_ftype *) data; 26121308Sache notify (); 26258310Sache} 26358310Sache 26458310Sachestruct observer * 26558310Sacheobserver_attach_sync_execution_done (observer_sync_execution_done_ftype *f) 26658310Sache{ 26758310Sache return generic_observer_attach (&sync_execution_done_subject, 26858310Sache &observer_sync_execution_done_notification_stub, 26921308Sache (void *) f); 27021308Sache} 27121308Sache 27247558Sachevoid 27347558Sacheobserver_detach_sync_execution_done (struct observer *observer) 27447558Sache{ 27547558Sache generic_observer_detach (&sync_execution_done_subject, observer); 27647558Sache} 27747558Sache 27847558Sachevoid 27947558Sacheobserver_notify_sync_execution_done (void) 28047558Sache{ 28147558Sachechar *args = NULL; 28247558Sache if (observer_debug) 28347558Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_sync_execution_done() called\n"); 28447558Sache generic_observer_notify (sync_execution_done_subject, &args); 28547558Sache} 28647558Sache 28721308Sache/* command_error notifications. */ 28821308Sache 28921308Sachestatic struct observer_list *command_error_subject = NULL; 29021308Sache 29121308Sachestatic void 292165670Sacheobserver_command_error_notification_stub (const void *data, const void *args_data) 293165670Sache{ 294165670Sache observer_command_error_ftype *notify = (observer_command_error_ftype *) data; 295165670Sache notify (); 29621308Sache} 297165670Sache 298165670Sachestruct observer * 299165670Sacheobserver_attach_command_error (observer_command_error_ftype *f) 300165670Sache{ 301165670Sache return generic_observer_attach (&command_error_subject, 302165670Sache &observer_command_error_notification_stub, 303165670Sache (void *) f); 304165670Sache} 305165670Sache 306165670Sachevoid 307165670Sacheobserver_detach_command_error (struct observer *observer) 308165670Sache{ 309165670Sache generic_observer_detach (&command_error_subject, observer); 310165670Sache} 311165670Sache 312165670Sachevoid 313165670Sacheobserver_notify_command_error (void) 314165670Sache{ 315165670Sachechar *args = NULL; 316165670Sache if (observer_debug) 317165670Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_command_error() called\n"); 318165670Sache generic_observer_notify (command_error_subject, &args); 319165670Sache} 320165670Sache 321165670Sache/* target_changed notifications. */ 322165670Sache 32347558Sachestatic struct observer_list *target_changed_subject = NULL; 32447558Sache 325165670Sachestruct target_changed_args { struct target_ops *target; }; 326165670Sache 327165670Sachestatic void 328165670Sacheobserver_target_changed_notification_stub (const void *data, const void *args_data) 329165670Sache{ 33047558Sache observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data; 33147558Sache const struct target_changed_args *args = (const struct target_changed_args *) args_data; 332157184Sache notify (args->target); 33347558Sache} 334157184Sache 33521308Sachestruct observer * 336157184Sacheobserver_attach_target_changed (observer_target_changed_ftype *f) 33747558Sache{ 33847558Sache return generic_observer_attach (&target_changed_subject, 33947558Sache &observer_target_changed_notification_stub, 34021308Sache (void *) f); 34147558Sache} 34247558Sache 34347558Sachevoid 34447558Sacheobserver_detach_target_changed (struct observer *observer) 34547558Sache{ 34647558Sache generic_observer_detach (&target_changed_subject, observer); 34721308Sache} 348157184Sache 34921308Sachevoid 35021308Sacheobserver_notify_target_changed (struct target_ops *target) 35147558Sache{ 35221308Sache struct target_changed_args args; 35321308Sache args.target = target; 35421308Sache 35547558Sache if (observer_debug) 35621308Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n"); 35721308Sache generic_observer_notify (target_changed_subject, &args); 35847558Sache} 35947558Sache 36047558Sache/* executable_changed notifications. */ 36126497Sache 36247558Sachestatic struct observer_list *executable_changed_subject = NULL; 363165670Sache 364165670Sachestatic void 365165670Sacheobserver_executable_changed_notification_stub (const void *data, const void *args_data) 366165670Sache{ 36747558Sache observer_executable_changed_ftype *notify = (observer_executable_changed_ftype *) data; 36821308Sache notify (); 36921308Sache} 37047558Sache 37147558Sachestruct observer * 37247558Sacheobserver_attach_executable_changed (observer_executable_changed_ftype *f) 37347558Sache{ 37447558Sache return generic_observer_attach (&executable_changed_subject, 37521308Sache &observer_executable_changed_notification_stub, 37621308Sache (void *) f); 37721308Sache} 37821308Sache 37921308Sachevoid 38021308Sacheobserver_detach_executable_changed (struct observer *observer) 38121308Sache{ 38221308Sache generic_observer_detach (&executable_changed_subject, observer); 38321308Sache} 38421308Sache 38547558Sachevoid 38647558Sacheobserver_notify_executable_changed (void) 38747558Sache{ 38821308Sachechar *args = NULL; 38947558Sache if (observer_debug) 39047558Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_executable_changed() called\n"); 391157184Sache generic_observer_notify (executable_changed_subject, &args); 39247558Sache} 393157184Sache 394157184Sache/* inferior_created notifications. */ 39547558Sache 396157184Sachestatic struct observer_list *inferior_created_subject = NULL; 39721308Sache 39821308Sachestruct inferior_created_args { struct target_ops *objfile; int from_tty; }; 39947558Sache 40047558Sachestatic void 40121308Sacheobserver_inferior_created_notification_stub (const void *data, const void *args_data) 40221308Sache{ 40347558Sache observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data; 40421308Sache const struct inferior_created_args *args = (const struct inferior_created_args *) args_data; 40521308Sache notify (args->objfile, args->from_tty); 40647558Sache} 40747558Sache 40847558Sachestruct observer * 40926497Sacheobserver_attach_inferior_created (observer_inferior_created_ftype *f) 41047558Sache{ 41147558Sache return generic_observer_attach (&inferior_created_subject, 41221308Sache &observer_inferior_created_notification_stub, 41321308Sache (void *) f); 41447558Sache} 41547558Sache 41647558Sachevoid 41747558Sacheobserver_detach_inferior_created (struct observer *observer) 41847558Sache{ 41947558Sache generic_observer_detach (&inferior_created_subject, observer); 42021308Sache} 42121308Sache 42221308Sachevoid 42321308Sacheobserver_notify_inferior_created (struct target_ops *objfile, int from_tty) 42447558Sache{ 42547558Sache struct inferior_created_args args; 42647558Sache args.objfile = objfile, args.from_tty = from_tty; 42747558Sache 42847558Sache if (observer_debug) 42947558Sache fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n"); 43047558Sache generic_observer_notify (inferior_created_subject, &args); 431157184Sache} 432157184Sache 433165670Sache/* record_changed notifications. */ 43447558Sache 43547558Sachestatic struct observer_list *record_changed_subject = NULL; 43647558Sache 43747558Sachestruct record_changed_args { struct inferior *inferior; int started; const char *method; const char *format; }; 43847558Sache 43947558Sachestatic void 44047558Sacheobserver_record_changed_notification_stub (const void *data, const void *args_data) 441157184Sache{ 442157184Sache observer_record_changed_ftype *notify = (observer_record_changed_ftype *) data; 44347558Sache const struct record_changed_args *args = (const struct record_changed_args *) args_data; 44447558Sache notify (args->inferior, args->started, args->method, args->format); 44547558Sache} 44647558Sache 44747558Sachestruct observer * 44847558Sacheobserver_attach_record_changed (observer_record_changed_ftype *f) 44947558Sache{ 45047558Sache return generic_observer_attach (&record_changed_subject, 45147558Sache &observer_record_changed_notification_stub, 45247558Sache (void *) f); 45347558Sache} 45447558Sache 45575406Sachevoid 45647558Sacheobserver_detach_record_changed (struct observer *observer) 45747558Sache{ 45847558Sache generic_observer_detach (&record_changed_subject, observer); 45947558Sache} 46047558Sache 46147558Sachevoid 46247558Sacheobserver_notify_record_changed (struct inferior *inferior, int started, const char *method, const char *format) 463157184Sache{ 46447558Sache struct record_changed_args args; 46547558Sache args.inferior = inferior, args.started = started, args.method = method, args.format = format; 46621308Sache 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