| OLD | NEW |
| 1 /* Copyright (C) 2009-2012 Free Software Foundation, Inc. | 1 /* Copyright (C) 2009-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 This file is part of GDB. | 3 This file is part of GDB. |
| 4 | 4 |
| 5 This program is free software; you can redistribute it and/or modify | 5 This program is free software; you can redistribute it and/or modify |
| 6 it under the terms of the GNU General Public License as published by | 6 it under the terms of the GNU General Public License as published by |
| 7 the Free Software Foundation; either version 3 of the License, or | 7 the Free Software Foundation; either version 3 of the License, or |
| 8 (at your option) any later version. | 8 (at your option) any later version. |
| 9 | 9 |
| 10 This program is distributed in the hope that it will be useful, | 10 This program is distributed in the hope that it will be useful, |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 this here instead of when handling new-thread events is because | 443 this here instead of when handling new-thread events is because |
| 444 we need to add the thread associated to the "main" thread - even | 444 we need to add the thread associated to the "main" thread - even |
| 445 for non-threaded applications where the new-thread events are not | 445 for non-threaded applications where the new-thread events are not |
| 446 generated. */ | 446 generated. */ |
| 447 if (!find_thread_ptid (new_ptid)) | 447 if (!find_thread_ptid (new_ptid)) |
| 448 add_thread (new_ptid, NULL); | 448 add_thread (new_ptid, NULL); |
| 449 | 449 |
| 450 if (WIFSTOPPED (wstat)) | 450 if (WIFSTOPPED (wstat)) |
| 451 { | 451 { |
| 452 status->kind = TARGET_WAITKIND_STOPPED; | 452 status->kind = TARGET_WAITKIND_STOPPED; |
| 453 status->value.integer = target_signal_from_host (WSTOPSIG (wstat)); | 453 status->value.integer = gdb_signal_from_host (WSTOPSIG (wstat)); |
| 454 lynx_debug ("process stopped with signal: %d", | 454 lynx_debug ("process stopped with signal: %d", |
| 455 status->value.integer); | 455 status->value.integer); |
| 456 } | 456 } |
| 457 else if (WIFEXITED (wstat)) | 457 else if (WIFEXITED (wstat)) |
| 458 { | 458 { |
| 459 status->kind = TARGET_WAITKIND_EXITED; | 459 status->kind = TARGET_WAITKIND_EXITED; |
| 460 status->value.integer = WEXITSTATUS (wstat); | 460 status->value.integer = WEXITSTATUS (wstat); |
| 461 lynx_debug ("process exited with code: %d", status->value.integer); | 461 lynx_debug ("process exited with code: %d", status->value.integer); |
| 462 } | 462 } |
| 463 else if (WIFSIGNALED (wstat)) | 463 else if (WIFSIGNALED (wstat)) |
| 464 { | 464 { |
| 465 status->kind = TARGET_WAITKIND_SIGNALLED; | 465 status->kind = TARGET_WAITKIND_SIGNALLED; |
| 466 status->value.integer = target_signal_from_host (WTERMSIG (wstat)); | 466 status->value.integer = gdb_signal_from_host (WTERMSIG (wstat)); |
| 467 lynx_debug ("process terminated with code: %d", | 467 lynx_debug ("process terminated with code: %d", |
| 468 status->value.integer); | 468 status->value.integer); |
| 469 } | 469 } |
| 470 else | 470 else |
| 471 { | 471 { |
| 472 /* Not sure what happened if we get here, or whether we can | 472 /* Not sure what happened if we get here, or whether we can |
| 473 in fact get here. But if we do, handle the event the best | 473 in fact get here. But if we do, handle the event the best |
| 474 we can. */ | 474 we can. */ |
| 475 status->kind = TARGET_WAITKIND_STOPPED; | 475 status->kind = TARGET_WAITKIND_STOPPED; |
| 476 status->value.integer = target_signal_from_host (0); | 476 status->value.integer = gdb_signal_from_host (0); |
| 477 lynx_debug ("unknown event ????"); | 477 lynx_debug ("unknown event ????"); |
| 478 } | 478 } |
| 479 | 479 |
| 480 /* SIGTRAP events are generated for situations other than single-step/ | 480 /* SIGTRAP events are generated for situations other than single-step/ |
| 481 breakpoint events (Eg. new-thread events). Handle those other types | 481 breakpoint events (Eg. new-thread events). Handle those other types |
| 482 of events, and resume the execution if necessary. */ | 482 of events, and resume the execution if necessary. */ |
| 483 if (status->kind == TARGET_WAITKIND_STOPPED | 483 if (status->kind == TARGET_WAITKIND_STOPPED |
| 484 && status->value.integer == TARGET_SIGNAL_TRAP) | 484 && status->value.integer == GDB_SIGNAL_TRAP) |
| 485 { | 485 { |
| 486 const int realsig = lynx_ptrace (PTRACE_GETTRACESIG, new_ptid, 0, 0, 0); | 486 const int realsig = lynx_ptrace (PTRACE_GETTRACESIG, new_ptid, 0, 0, 0); |
| 487 | 487 |
| 488 lynx_debug ("(realsig = %d)", realsig); | 488 lynx_debug ("(realsig = %d)", realsig); |
| 489 switch (realsig) | 489 switch (realsig) |
| 490 { | 490 { |
| 491 case SIGNEWTHREAD: | 491 case SIGNEWTHREAD: |
| 492 /* We just added the new thread above. No need to do anything | 492 /* We just added the new thread above. No need to do anything |
| 493 further. Just resume the execution again. */ | 493 further. Just resume the execution again. */ |
| 494 lynx_continue (ptid); | 494 lynx_continue (ptid); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 NULL, /* handle_monitor_command */ | 761 NULL, /* handle_monitor_command */ |
| 762 }; | 762 }; |
| 763 | 763 |
| 764 void | 764 void |
| 765 initialize_low (void) | 765 initialize_low (void) |
| 766 { | 766 { |
| 767 set_target_ops (&lynx_target_ops); | 767 set_target_ops (&lynx_target_ops); |
| 768 the_low_target.arch_setup (); | 768 the_low_target.arch_setup (); |
| 769 } | 769 } |
| 770 | 770 |
| OLD | NEW |