1/* This file is automatically generated. DO NOT EDIT! */ 2/* Generated from: NetBSD: mknative-gdb,v 1.4 2011/10/09 02:03:30 christos Exp */ 3/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ 4 5/* GDB Notifications to Observers. 6 7 Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011 8 Free Software Foundation, Inc. 9 10 This file is part of GDB. 11 12 This program is free software; you can redistribute it and/or modify 13 it under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 3 of the License, or 15 (at your option) any later version. 16 17 This program is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 You should have received a copy of the GNU General Public License 23 along with this program. If not, see <http://www.gnu.org/licenses/>. 24 25 -- 26 27 This file was generated using observer.sh and observer.texi. */ 28 29 30/* normal_stop notifications. */ 31 32static struct observer_list *normal_stop_subject = NULL; 33 34struct normal_stop_args { struct bpstats *bs; int print_frame; }; 35 36static void 37observer_normal_stop_notification_stub (const void *data, const void *args_data) 38{ 39 observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data; 40 const struct normal_stop_args *args = args_data; 41 notify (args->bs, args->print_frame); 42} 43 44struct observer * 45observer_attach_normal_stop (observer_normal_stop_ftype *f) 46{ 47 return generic_observer_attach (&normal_stop_subject, 48 &observer_normal_stop_notification_stub, 49 (void *) f); 50} 51 52void 53observer_detach_normal_stop (struct observer *observer) 54{ 55 generic_observer_detach (&normal_stop_subject, observer); 56} 57 58void 59observer_notify_normal_stop (struct bpstats *bs, int print_frame) 60{ 61 struct normal_stop_args args; 62 args.bs = bs, args.print_frame = print_frame; 63 64 if (observer_debug) 65 fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n"); 66 generic_observer_notify (normal_stop_subject, &args); 67} 68 69/* target_changed notifications. */ 70 71static struct observer_list *target_changed_subject = NULL; 72 73struct target_changed_args { struct target_ops *target; }; 74 75static void 76observer_target_changed_notification_stub (const void *data, const void *args_data) 77{ 78 observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data; 79 const struct target_changed_args *args = args_data; 80 notify (args->target); 81} 82 83struct observer * 84observer_attach_target_changed (observer_target_changed_ftype *f) 85{ 86 return generic_observer_attach (&target_changed_subject, 87 &observer_target_changed_notification_stub, 88 (void *) f); 89} 90 91void 92observer_detach_target_changed (struct observer *observer) 93{ 94 generic_observer_detach (&target_changed_subject, observer); 95} 96 97void 98observer_notify_target_changed (struct target_ops *target) 99{ 100 struct target_changed_args args; 101 args.target = target; 102 103 if (observer_debug) 104 fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n"); 105 generic_observer_notify (target_changed_subject, &args); 106} 107 108/* executable_changed notifications. */ 109 110static struct observer_list *executable_changed_subject = NULL; 111 112static void 113observer_executable_changed_notification_stub (const void *data, const void *args_data) 114{ 115 observer_executable_changed_ftype *notify = (observer_executable_changed_ftype *) data; 116 const struct executable_changed_args *args = args_data; 117 notify (); 118} 119 120struct observer * 121observer_attach_executable_changed (observer_executable_changed_ftype *f) 122{ 123 return generic_observer_attach (&executable_changed_subject, 124 &observer_executable_changed_notification_stub, 125 (void *) f); 126} 127 128void 129observer_detach_executable_changed (struct observer *observer) 130{ 131 generic_observer_detach (&executable_changed_subject, observer); 132} 133 134void 135observer_notify_executable_changed (void) 136{ 137char *args = NULL; 138 if (observer_debug) 139 fprintf_unfiltered (gdb_stdlog, "observer_notify_executable_changed() called\n"); 140 generic_observer_notify (executable_changed_subject, &args); 141} 142 143/* inferior_created notifications. */ 144 145static struct observer_list *inferior_created_subject = NULL; 146 147struct inferior_created_args { struct target_ops *objfile; int from_tty; }; 148 149static void 150observer_inferior_created_notification_stub (const void *data, const void *args_data) 151{ 152 observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data; 153 const struct inferior_created_args *args = args_data; 154 notify (args->objfile, args->from_tty); 155} 156 157struct observer * 158observer_attach_inferior_created (observer_inferior_created_ftype *f) 159{ 160 return generic_observer_attach (&inferior_created_subject, 161 &observer_inferior_created_notification_stub, 162 (void *) f); 163} 164 165void 166observer_detach_inferior_created (struct observer *observer) 167{ 168 generic_observer_detach (&inferior_created_subject, observer); 169} 170 171void 172observer_notify_inferior_created (struct target_ops *objfile, int from_tty) 173{ 174 struct inferior_created_args args; 175 args.objfile = objfile, args.from_tty = from_tty; 176 177 if (observer_debug) 178 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n"); 179 generic_observer_notify (inferior_created_subject, &args); 180} 181 182/* solib_loaded notifications. */ 183 184static struct observer_list *solib_loaded_subject = NULL; 185 186struct solib_loaded_args { struct so_list *solib; }; 187 188static void 189observer_solib_loaded_notification_stub (const void *data, const void *args_data) 190{ 191 observer_solib_loaded_ftype *notify = (observer_solib_loaded_ftype *) data; 192 const struct solib_loaded_args *args = args_data; 193 notify (args->solib); 194} 195 196struct observer * 197observer_attach_solib_loaded (observer_solib_loaded_ftype *f) 198{ 199 return generic_observer_attach (&solib_loaded_subject, 200 &observer_solib_loaded_notification_stub, 201 (void *) f); 202} 203 204void 205observer_detach_solib_loaded (struct observer *observer) 206{ 207 generic_observer_detach (&solib_loaded_subject, observer); 208} 209 210void 211observer_notify_solib_loaded (struct so_list *solib) 212{ 213 struct solib_loaded_args args; 214 args.solib = solib; 215 216 if (observer_debug) 217 fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_loaded() called\n"); 218 generic_observer_notify (solib_loaded_subject, &args); 219} 220 221/* solib_unloaded notifications. */ 222 223static struct observer_list *solib_unloaded_subject = NULL; 224 225struct solib_unloaded_args { struct so_list *solib; }; 226 227static void 228observer_solib_unloaded_notification_stub (const void *data, const void *args_data) 229{ 230 observer_solib_unloaded_ftype *notify = (observer_solib_unloaded_ftype *) data; 231 const struct solib_unloaded_args *args = args_data; 232 notify (args->solib); 233} 234 235struct observer * 236observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f) 237{ 238 return generic_observer_attach (&solib_unloaded_subject, 239 &observer_solib_unloaded_notification_stub, 240 (void *) f); 241} 242 243void 244observer_detach_solib_unloaded (struct observer *observer) 245{ 246 generic_observer_detach (&solib_unloaded_subject, observer); 247} 248 249void 250observer_notify_solib_unloaded (struct so_list *solib) 251{ 252 struct solib_unloaded_args args; 253 args.solib = solib; 254 255 if (observer_debug) 256 fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_unloaded() called\n"); 257 generic_observer_notify (solib_unloaded_subject, &args); 258} 259 260/* new_objfile notifications. */ 261 262static struct observer_list *new_objfile_subject = NULL; 263 264struct new_objfile_args { struct objfile *objfile; }; 265 266static void 267observer_new_objfile_notification_stub (const void *data, const void *args_data) 268{ 269 observer_new_objfile_ftype *notify = (observer_new_objfile_ftype *) data; 270 const struct new_objfile_args *args = args_data; 271 notify (args->objfile); 272} 273 274struct observer * 275observer_attach_new_objfile (observer_new_objfile_ftype *f) 276{ 277 return generic_observer_attach (&new_objfile_subject, 278 &observer_new_objfile_notification_stub, 279 (void *) f); 280} 281 282void 283observer_detach_new_objfile (struct observer *observer) 284{ 285 generic_observer_detach (&new_objfile_subject, observer); 286} 287 288void 289observer_notify_new_objfile (struct objfile *objfile) 290{ 291 struct new_objfile_args args; 292 args.objfile = objfile; 293 294 if (observer_debug) 295 fprintf_unfiltered (gdb_stdlog, "observer_notify_new_objfile() called\n"); 296 generic_observer_notify (new_objfile_subject, &args); 297} 298 299/* new_thread notifications. */ 300 301static struct observer_list *new_thread_subject = NULL; 302 303struct new_thread_args { struct thread_info *t; }; 304 305static void 306observer_new_thread_notification_stub (const void *data, const void *args_data) 307{ 308 observer_new_thread_ftype *notify = (observer_new_thread_ftype *) data; 309 const struct new_thread_args *args = args_data; 310 notify (args->t); 311} 312 313struct observer * 314observer_attach_new_thread (observer_new_thread_ftype *f) 315{ 316 return generic_observer_attach (&new_thread_subject, 317 &observer_new_thread_notification_stub, 318 (void *) f); 319} 320 321void 322observer_detach_new_thread (struct observer *observer) 323{ 324 generic_observer_detach (&new_thread_subject, observer); 325} 326 327void 328observer_notify_new_thread (struct thread_info *t) 329{ 330 struct new_thread_args args; 331 args.t = t; 332 333 if (observer_debug) 334 fprintf_unfiltered (gdb_stdlog, "observer_notify_new_thread() called\n"); 335 generic_observer_notify (new_thread_subject, &args); 336} 337 338/* thread_exit notifications. */ 339 340static struct observer_list *thread_exit_subject = NULL; 341 342struct thread_exit_args { struct thread_info *t; int silent; }; 343 344static void 345observer_thread_exit_notification_stub (const void *data, const void *args_data) 346{ 347 observer_thread_exit_ftype *notify = (observer_thread_exit_ftype *) data; 348 const struct thread_exit_args *args = args_data; 349 notify (args->t, args->silent); 350} 351 352struct observer * 353observer_attach_thread_exit (observer_thread_exit_ftype *f) 354{ 355 return generic_observer_attach (&thread_exit_subject, 356 &observer_thread_exit_notification_stub, 357 (void *) f); 358} 359 360void 361observer_detach_thread_exit (struct observer *observer) 362{ 363 generic_observer_detach (&thread_exit_subject, observer); 364} 365 366void 367observer_notify_thread_exit (struct thread_info *t, int silent) 368{ 369 struct thread_exit_args args; 370 args.t = t, args.silent = silent; 371 372 if (observer_debug) 373 fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_exit() called\n"); 374 generic_observer_notify (thread_exit_subject, &args); 375} 376 377/* thread_stop_requested notifications. */ 378 379static struct observer_list *thread_stop_requested_subject = NULL; 380 381struct thread_stop_requested_args { ptid_t ptid; }; 382 383static void 384observer_thread_stop_requested_notification_stub (const void *data, const void *args_data) 385{ 386 observer_thread_stop_requested_ftype *notify = (observer_thread_stop_requested_ftype *) data; 387 const struct thread_stop_requested_args *args = args_data; 388 notify (args->ptid); 389} 390 391struct observer * 392observer_attach_thread_stop_requested (observer_thread_stop_requested_ftype *f) 393{ 394 return generic_observer_attach (&thread_stop_requested_subject, 395 &observer_thread_stop_requested_notification_stub, 396 (void *) f); 397} 398 399void 400observer_detach_thread_stop_requested (struct observer *observer) 401{ 402 generic_observer_detach (&thread_stop_requested_subject, observer); 403} 404 405void 406observer_notify_thread_stop_requested (ptid_t ptid) 407{ 408 struct thread_stop_requested_args args; 409 args.ptid = ptid; 410 411 if (observer_debug) 412 fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_stop_requested() called\n"); 413 generic_observer_notify (thread_stop_requested_subject, &args); 414} 415 416/* target_resumed notifications. */ 417 418static struct observer_list *target_resumed_subject = NULL; 419 420struct target_resumed_args { ptid_t ptid; }; 421 422static void 423observer_target_resumed_notification_stub (const void *data, const void *args_data) 424{ 425 observer_target_resumed_ftype *notify = (observer_target_resumed_ftype *) data; 426 const struct target_resumed_args *args = args_data; 427 notify (args->ptid); 428} 429 430struct observer * 431observer_attach_target_resumed (observer_target_resumed_ftype *f) 432{ 433 return generic_observer_attach (&target_resumed_subject, 434 &observer_target_resumed_notification_stub, 435 (void *) f); 436} 437 438void 439observer_detach_target_resumed (struct observer *observer) 440{ 441 generic_observer_detach (&target_resumed_subject, observer); 442} 443 444void 445observer_notify_target_resumed (ptid_t ptid) 446{ 447 struct target_resumed_args args; 448 args.ptid = ptid; 449 450 if (observer_debug) 451 fprintf_unfiltered (gdb_stdlog, "observer_notify_target_resumed() called\n"); 452 generic_observer_notify (target_resumed_subject, &args); 453} 454 455/* about_to_proceed notifications. */ 456 457static struct observer_list *about_to_proceed_subject = NULL; 458 459static void 460observer_about_to_proceed_notification_stub (const void *data, const void *args_data) 461{ 462 observer_about_to_proceed_ftype *notify = (observer_about_to_proceed_ftype *) data; 463 const struct about_to_proceed_args *args = args_data; 464 notify (); 465} 466 467struct observer * 468observer_attach_about_to_proceed (observer_about_to_proceed_ftype *f) 469{ 470 return generic_observer_attach (&about_to_proceed_subject, 471 &observer_about_to_proceed_notification_stub, 472 (void *) f); 473} 474 475void 476observer_detach_about_to_proceed (struct observer *observer) 477{ 478 generic_observer_detach (&about_to_proceed_subject, observer); 479} 480 481void 482observer_notify_about_to_proceed (void) 483{ 484char *args = NULL; 485 if (observer_debug) 486 fprintf_unfiltered (gdb_stdlog, "observer_notify_about_to_proceed() called\n"); 487 generic_observer_notify (about_to_proceed_subject, &args); 488} 489 490/* breakpoint_created notifications. */ 491 492static struct observer_list *breakpoint_created_subject = NULL; 493 494struct breakpoint_created_args { int bpnum; }; 495 496static void 497observer_breakpoint_created_notification_stub (const void *data, const void *args_data) 498{ 499 observer_breakpoint_created_ftype *notify = (observer_breakpoint_created_ftype *) data; 500 const struct breakpoint_created_args *args = args_data; 501 notify (args->bpnum); 502} 503 504struct observer * 505observer_attach_breakpoint_created (observer_breakpoint_created_ftype *f) 506{ 507 return generic_observer_attach (&breakpoint_created_subject, 508 &observer_breakpoint_created_notification_stub, 509 (void *) f); 510} 511 512void 513observer_detach_breakpoint_created (struct observer *observer) 514{ 515 generic_observer_detach (&breakpoint_created_subject, observer); 516} 517 518void 519observer_notify_breakpoint_created (int bpnum) 520{ 521 struct breakpoint_created_args args; 522 args.bpnum = bpnum; 523 524 if (observer_debug) 525 fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_created() called\n"); 526 generic_observer_notify (breakpoint_created_subject, &args); 527} 528 529/* breakpoint_deleted notifications. */ 530 531static struct observer_list *breakpoint_deleted_subject = NULL; 532 533struct breakpoint_deleted_args { int bpnum; }; 534 535static void 536observer_breakpoint_deleted_notification_stub (const void *data, const void *args_data) 537{ 538 observer_breakpoint_deleted_ftype *notify = (observer_breakpoint_deleted_ftype *) data; 539 const struct breakpoint_deleted_args *args = args_data; 540 notify (args->bpnum); 541} 542 543struct observer * 544observer_attach_breakpoint_deleted (observer_breakpoint_deleted_ftype *f) 545{ 546 return generic_observer_attach (&breakpoint_deleted_subject, 547 &observer_breakpoint_deleted_notification_stub, 548 (void *) f); 549} 550 551void 552observer_detach_breakpoint_deleted (struct observer *observer) 553{ 554 generic_observer_detach (&breakpoint_deleted_subject, observer); 555} 556 557void 558observer_notify_breakpoint_deleted (int bpnum) 559{ 560 struct breakpoint_deleted_args args; 561 args.bpnum = bpnum; 562 563 if (observer_debug) 564 fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_deleted() called\n"); 565 generic_observer_notify (breakpoint_deleted_subject, &args); 566} 567 568/* breakpoint_modified notifications. */ 569 570static struct observer_list *breakpoint_modified_subject = NULL; 571 572struct breakpoint_modified_args { int bpnum; }; 573 574static void 575observer_breakpoint_modified_notification_stub (const void *data, const void *args_data) 576{ 577 observer_breakpoint_modified_ftype *notify = (observer_breakpoint_modified_ftype *) data; 578 const struct breakpoint_modified_args *args = args_data; 579 notify (args->bpnum); 580} 581 582struct observer * 583observer_attach_breakpoint_modified (observer_breakpoint_modified_ftype *f) 584{ 585 return generic_observer_attach (&breakpoint_modified_subject, 586 &observer_breakpoint_modified_notification_stub, 587 (void *) f); 588} 589 590void 591observer_detach_breakpoint_modified (struct observer *observer) 592{ 593 generic_observer_detach (&breakpoint_modified_subject, observer); 594} 595 596void 597observer_notify_breakpoint_modified (int bpnum) 598{ 599 struct breakpoint_modified_args args; 600 args.bpnum = bpnum; 601 602 if (observer_debug) 603 fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_modified() called\n"); 604 generic_observer_notify (breakpoint_modified_subject, &args); 605} 606 607/* tracepoint_created notifications. */ 608 609static struct observer_list *tracepoint_created_subject = NULL; 610 611struct tracepoint_created_args { int tpnum; }; 612 613static void 614observer_tracepoint_created_notification_stub (const void *data, const void *args_data) 615{ 616 observer_tracepoint_created_ftype *notify = (observer_tracepoint_created_ftype *) data; 617 const struct tracepoint_created_args *args = args_data; 618 notify (args->tpnum); 619} 620 621struct observer * 622observer_attach_tracepoint_created (observer_tracepoint_created_ftype *f) 623{ 624 return generic_observer_attach (&tracepoint_created_subject, 625 &observer_tracepoint_created_notification_stub, 626 (void *) f); 627} 628 629void 630observer_detach_tracepoint_created (struct observer *observer) 631{ 632 generic_observer_detach (&tracepoint_created_subject, observer); 633} 634 635void 636observer_notify_tracepoint_created (int tpnum) 637{ 638 struct tracepoint_created_args args; 639 args.tpnum = tpnum; 640 641 if (observer_debug) 642 fprintf_unfiltered (gdb_stdlog, "observer_notify_tracepoint_created() called\n"); 643 generic_observer_notify (tracepoint_created_subject, &args); 644} 645 646/* tracepoint_deleted notifications. */ 647 648static struct observer_list *tracepoint_deleted_subject = NULL; 649 650struct tracepoint_deleted_args { int tpnum; }; 651 652static void 653observer_tracepoint_deleted_notification_stub (const void *data, const void *args_data) 654{ 655 observer_tracepoint_deleted_ftype *notify = (observer_tracepoint_deleted_ftype *) data; 656 const struct tracepoint_deleted_args *args = args_data; 657 notify (args->tpnum); 658} 659 660struct observer * 661observer_attach_tracepoint_deleted (observer_tracepoint_deleted_ftype *f) 662{ 663 return generic_observer_attach (&tracepoint_deleted_subject, 664 &observer_tracepoint_deleted_notification_stub, 665 (void *) f); 666} 667 668void 669observer_detach_tracepoint_deleted (struct observer *observer) 670{ 671 generic_observer_detach (&tracepoint_deleted_subject, observer); 672} 673 674void 675observer_notify_tracepoint_deleted (int tpnum) 676{ 677 struct tracepoint_deleted_args args; 678 args.tpnum = tpnum; 679 680 if (observer_debug) 681 fprintf_unfiltered (gdb_stdlog, "observer_notify_tracepoint_deleted() called\n"); 682 generic_observer_notify (tracepoint_deleted_subject, &args); 683} 684 685/* tracepoint_modified notifications. */ 686 687static struct observer_list *tracepoint_modified_subject = NULL; 688 689struct tracepoint_modified_args { int tpnum; }; 690 691static void 692observer_tracepoint_modified_notification_stub (const void *data, const void *args_data) 693{ 694 observer_tracepoint_modified_ftype *notify = (observer_tracepoint_modified_ftype *) data; 695 const struct tracepoint_modified_args *args = args_data; 696 notify (args->tpnum); 697} 698 699struct observer * 700observer_attach_tracepoint_modified (observer_tracepoint_modified_ftype *f) 701{ 702 return generic_observer_attach (&tracepoint_modified_subject, 703 &observer_tracepoint_modified_notification_stub, 704 (void *) f); 705} 706 707void 708observer_detach_tracepoint_modified (struct observer *observer) 709{ 710 generic_observer_detach (&tracepoint_modified_subject, observer); 711} 712 713void 714observer_notify_tracepoint_modified (int tpnum) 715{ 716 struct tracepoint_modified_args args; 717 args.tpnum = tpnum; 718 719 if (observer_debug) 720 fprintf_unfiltered (gdb_stdlog, "observer_notify_tracepoint_modified() called\n"); 721 generic_observer_notify (tracepoint_modified_subject, &args); 722} 723 724/* architecture_changed notifications. */ 725 726static struct observer_list *architecture_changed_subject = NULL; 727 728struct architecture_changed_args { struct gdbarch *newarch; }; 729 730static void 731observer_architecture_changed_notification_stub (const void *data, const void *args_data) 732{ 733 observer_architecture_changed_ftype *notify = (observer_architecture_changed_ftype *) data; 734 const struct architecture_changed_args *args = args_data; 735 notify (args->newarch); 736} 737 738struct observer * 739observer_attach_architecture_changed (observer_architecture_changed_ftype *f) 740{ 741 return generic_observer_attach (&architecture_changed_subject, 742 &observer_architecture_changed_notification_stub, 743 (void *) f); 744} 745 746void 747observer_detach_architecture_changed (struct observer *observer) 748{ 749 generic_observer_detach (&architecture_changed_subject, observer); 750} 751 752void 753observer_notify_architecture_changed (struct gdbarch *newarch) 754{ 755 struct architecture_changed_args args; 756 args.newarch = newarch; 757 758 if (observer_debug) 759 fprintf_unfiltered (gdb_stdlog, "observer_notify_architecture_changed() called\n"); 760 generic_observer_notify (architecture_changed_subject, &args); 761} 762 763/* thread_ptid_changed notifications. */ 764 765static struct observer_list *thread_ptid_changed_subject = NULL; 766 767struct thread_ptid_changed_args { ptid_t old_ptid; ptid_t new_ptid; }; 768 769static void 770observer_thread_ptid_changed_notification_stub (const void *data, const void *args_data) 771{ 772 observer_thread_ptid_changed_ftype *notify = (observer_thread_ptid_changed_ftype *) data; 773 const struct thread_ptid_changed_args *args = args_data; 774 notify (args->old_ptid, args->new_ptid); 775} 776 777struct observer * 778observer_attach_thread_ptid_changed (observer_thread_ptid_changed_ftype *f) 779{ 780 return generic_observer_attach (&thread_ptid_changed_subject, 781 &observer_thread_ptid_changed_notification_stub, 782 (void *) f); 783} 784 785void 786observer_detach_thread_ptid_changed (struct observer *observer) 787{ 788 generic_observer_detach (&thread_ptid_changed_subject, observer); 789} 790 791void 792observer_notify_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid) 793{ 794 struct thread_ptid_changed_args args; 795 args.old_ptid = old_ptid, args.new_ptid = new_ptid; 796 797 if (observer_debug) 798 fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_ptid_changed() called\n"); 799 generic_observer_notify (thread_ptid_changed_subject, &args); 800} 801 802/* inferior_added notifications. */ 803 804static struct observer_list *inferior_added_subject = NULL; 805 806struct inferior_added_args { struct inferior *inf; }; 807 808static void 809observer_inferior_added_notification_stub (const void *data, const void *args_data) 810{ 811 observer_inferior_added_ftype *notify = (observer_inferior_added_ftype *) data; 812 const struct inferior_added_args *args = args_data; 813 notify (args->inf); 814} 815 816struct observer * 817observer_attach_inferior_added (observer_inferior_added_ftype *f) 818{ 819 return generic_observer_attach (&inferior_added_subject, 820 &observer_inferior_added_notification_stub, 821 (void *) f); 822} 823 824void 825observer_detach_inferior_added (struct observer *observer) 826{ 827 generic_observer_detach (&inferior_added_subject, observer); 828} 829 830void 831observer_notify_inferior_added (struct inferior *inf) 832{ 833 struct inferior_added_args args; 834 args.inf = inf; 835 836 if (observer_debug) 837 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_added() called\n"); 838 generic_observer_notify (inferior_added_subject, &args); 839} 840 841/* inferior_appeared notifications. */ 842 843static struct observer_list *inferior_appeared_subject = NULL; 844 845struct inferior_appeared_args { struct inferior *inf; }; 846 847static void 848observer_inferior_appeared_notification_stub (const void *data, const void *args_data) 849{ 850 observer_inferior_appeared_ftype *notify = (observer_inferior_appeared_ftype *) data; 851 const struct inferior_appeared_args *args = args_data; 852 notify (args->inf); 853} 854 855struct observer * 856observer_attach_inferior_appeared (observer_inferior_appeared_ftype *f) 857{ 858 return generic_observer_attach (&inferior_appeared_subject, 859 &observer_inferior_appeared_notification_stub, 860 (void *) f); 861} 862 863void 864observer_detach_inferior_appeared (struct observer *observer) 865{ 866 generic_observer_detach (&inferior_appeared_subject, observer); 867} 868 869void 870observer_notify_inferior_appeared (struct inferior *inf) 871{ 872 struct inferior_appeared_args args; 873 args.inf = inf; 874 875 if (observer_debug) 876 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_appeared() called\n"); 877 generic_observer_notify (inferior_appeared_subject, &args); 878} 879 880/* inferior_exit notifications. */ 881 882static struct observer_list *inferior_exit_subject = NULL; 883 884struct inferior_exit_args { struct inferior *inf; }; 885 886static void 887observer_inferior_exit_notification_stub (const void *data, const void *args_data) 888{ 889 observer_inferior_exit_ftype *notify = (observer_inferior_exit_ftype *) data; 890 const struct inferior_exit_args *args = args_data; 891 notify (args->inf); 892} 893 894struct observer * 895observer_attach_inferior_exit (observer_inferior_exit_ftype *f) 896{ 897 return generic_observer_attach (&inferior_exit_subject, 898 &observer_inferior_exit_notification_stub, 899 (void *) f); 900} 901 902void 903observer_detach_inferior_exit (struct observer *observer) 904{ 905 generic_observer_detach (&inferior_exit_subject, observer); 906} 907 908void 909observer_notify_inferior_exit (struct inferior *inf) 910{ 911 struct inferior_exit_args args; 912 args.inf = inf; 913 914 if (observer_debug) 915 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_exit() called\n"); 916 generic_observer_notify (inferior_exit_subject, &args); 917} 918 919/* inferior_removed notifications. */ 920 921static struct observer_list *inferior_removed_subject = NULL; 922 923struct inferior_removed_args { struct inferior *inf; }; 924 925static void 926observer_inferior_removed_notification_stub (const void *data, const void *args_data) 927{ 928 observer_inferior_removed_ftype *notify = (observer_inferior_removed_ftype *) data; 929 const struct inferior_removed_args *args = args_data; 930 notify (args->inf); 931} 932 933struct observer * 934observer_attach_inferior_removed (observer_inferior_removed_ftype *f) 935{ 936 return generic_observer_attach (&inferior_removed_subject, 937 &observer_inferior_removed_notification_stub, 938 (void *) f); 939} 940 941void 942observer_detach_inferior_removed (struct observer *observer) 943{ 944 generic_observer_detach (&inferior_removed_subject, observer); 945} 946 947void 948observer_notify_inferior_removed (struct inferior *inf) 949{ 950 struct inferior_removed_args args; 951 args.inf = inf; 952 953 if (observer_debug) 954 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_removed() called\n"); 955 generic_observer_notify (inferior_removed_subject, &args); 956} 957 958/* memory_changed notifications. */ 959 960static struct observer_list *memory_changed_subject = NULL; 961 962struct memory_changed_args { CORE_ADDR addr; int len; const bfd_byte *data; }; 963 964static void 965observer_memory_changed_notification_stub (const void *data, const void *args_data) 966{ 967 observer_memory_changed_ftype *notify = (observer_memory_changed_ftype *) data; 968 const struct memory_changed_args *args = args_data; 969 notify (args->addr, args->len, args->data); 970} 971 972struct observer * 973observer_attach_memory_changed (observer_memory_changed_ftype *f) 974{ 975 return generic_observer_attach (&memory_changed_subject, 976 &observer_memory_changed_notification_stub, 977 (void *) f); 978} 979 980void 981observer_detach_memory_changed (struct observer *observer) 982{ 983 generic_observer_detach (&memory_changed_subject, observer); 984} 985 986void 987observer_notify_memory_changed (CORE_ADDR addr, int len, const bfd_byte *data) 988{ 989 struct memory_changed_args args; 990 args.addr = addr, args.len = len, args.data = data; 991 992 if (observer_debug) 993 fprintf_unfiltered (gdb_stdlog, "observer_notify_memory_changed() called\n"); 994 generic_observer_notify (memory_changed_subject, &args); 995} 996 997/* test_notification notifications. */ 998 999static struct observer_list *test_notification_subject = NULL; 1000 1001struct test_notification_args { int somearg; }; 1002 1003static void 1004observer_test_notification_notification_stub (const void *data, const void *args_data) 1005{ 1006 observer_test_notification_ftype *notify = (observer_test_notification_ftype *) data; 1007 const struct test_notification_args *args = args_data; 1008 notify (args->somearg); 1009} 1010 1011struct observer * 1012observer_attach_test_notification (observer_test_notification_ftype *f) 1013{ 1014 return generic_observer_attach (&test_notification_subject, 1015 &observer_test_notification_notification_stub, 1016 (void *) f); 1017} 1018 1019void 1020observer_detach_test_notification (struct observer *observer) 1021{ 1022 generic_observer_detach (&test_notification_subject, observer); 1023} 1024 1025void 1026observer_notify_test_notification (int somearg) 1027{ 1028 struct test_notification_args args; 1029 args.somearg = somearg; 1030 1031 if (observer_debug) 1032 fprintf_unfiltered (gdb_stdlog, "observer_notify_test_notification() called\n"); 1033 generic_observer_notify (test_notification_subject, &args); 1034} 1035