Previous 15994 Revisions Next

r2910 Friday 27th June, 2008 at 21:55:56 UTC by Wilbert Pol
Fixed for the OS X debugger. Review of changes will be welcome.
[src/osd/sdl]debugosx.c

src/osd/sdl/debugosx.c
r2909r2910
3232#include "debug/debugvw.h"
3333#include "debug/debugcon.h"
3434#include "debug/debugcpu.h"
35#include "debugger.h"
3536
3637// MAMEOS headers
3738#include "debugwin.h"
r2909r2910
459460
460461void debugwin_update_during_game(void)
461462{
462   int execution_state = debug_get_execution_state();
463
464463   {
465464      static int osx_inited_debugger = 0;
466465
r2909r2910
476475   }
477476
478477   // if we're running live, do some checks
479   if (execution_state != EXECUTION_STATE_STOPPED)
478   if ( ! debug_cpu_is_stopped(Machine) )
480479   {
481480      // see if the interrupt key is pressed and break if it is
482481      temporarily_fake_that_we_are_not_visible = TRUE;
r2909r2910
490489            focuswnd = NULL;
491490         }
492491         
493         debug_halt_on_next_instruction();
492         debugger_break(Machine);
494493         debug_console_printf("User-initiated break\n");
495494
496495         // if we were focused on some window's edit box, reset it to default
r2909r2910
543542
544543   debugwin_info *info = NULL;
545544   Rect work_bounds;
546   
545
547546   (void)unused;
548   
547
549548   // allocate memory
550549   info = malloc(sizeof(*info));
551550   if (!info)
552551      return NULL;
553552   memset(info, 0, sizeof(*info));
554   
553
555554   info->wnd = NULL;
556555
557556   // create the window
r2909r2910
560559
561560   if ( CreateNewWindow(kDocumentWindowClass, DEBUG_WINDOW_STYLE, &work_bounds, &info->wnd) != noErr )
562561      goto cleanup;
563   
562
564563   // install keyboard handler
565564   if ( keyEventHandler == NULL )
566565   {
r2909r2910
19771976   // then add all the memory regions
19781977   for (rgnnum = 0; rgnnum < MAX_MEMORY_REGIONS; rgnnum++)
19791978   {
1980      UINT8 *base = memory_region(rgnnum);
1979      UINT8 *base = memory_region(Machine, rgnnum);
19811980      UINT32 type = memory_region_type(Machine, rgnnum);
19821981      if (base != NULL && type > REGION_INVALID && (type - REGION_INVALID) < ARRAY_LENGTH(memory_region_names))
19831982      {
r2909r2910
19861985         UINT8 width, little_endian;
19871986         memset(ci, 0, sizeof(*ci));
19881987         ci->base = base;
1989         ci->length = memory_region_length(rgnnum);
1988         ci->length = memory_region_length(Machine, rgnnum);
19901989         width = 1 << (flags & ROMREGION_WIDTHMASK);
19911990         little_endian = ((flags & ROMREGION_ENDIANMASK) == ROMREGION_LE);
19921991         if (type >= REGION_CPU1 && type <= REGION_CPU8)
r2909r2910
28712870            cpu_num = debug_view_get_property_UINT32(info->view[0].view, DVP_DASM_CPUNUM);
28722871            cpuinfo = (debug_cpu_info*)debug_get_cpu_info(cpu_num);
28732872
2874            for (bp = cpuinfo->first_bp; bp; bp = bp->next)
2873            for (bp = cpuinfo->bplist; bp; bp = bp->next)
28752874            {
28762875               if (BYTE2ADDR(active_address, cpuinfo, ADDRESS_SPACE_PROGRAM) == bp->address)
28772876               {
r2909r2910
29652964               cpu_num = debug_view_get_property_UINT32(info->view[0].view, DVP_DASM_CPUNUM);
29662965               cpuinfo = (debug_cpu_info*)debug_get_cpu_info(cpu_num);
29672966
2968               for (bp = cpuinfo->first_bp; bp; bp = bp->next)
2967               for (bp = cpuinfo->bplist; bp; bp = bp->next)
29692968               {
29702969                  if (BYTE2ADDR(active_address, cpuinfo, ADDRESS_SPACE_PROGRAM) == bp->address)
29712970                  {
r2909r2910
30433042   MenuItemIndex   menuIndex;
30443043   ControlButtonContentInfo   content;
30453044
3045   debugwin_init_windows();
3046
30463047   // create the window
30473048   info = debug_window_create("Debug", NULL);
30483049   if (!info)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team