Changeset 7cc6ac0 in buchla-emu for emu


Ignore:
Timestamp:
08/05/2017 05:07:26 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
5fa5369
Parents:
c3f113d
Message:

Successfully attached GDB.

Location:
emu
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • emu/all.h

    rc3f113d r7cc6ac0  
    4848
    4949extern int32_t sdl_verbose;
     50extern int32_t gdb_verbose;
    5051extern int32_t cpu_verbose;
    5152extern int32_t fpu_verbose;
     
    6869extern void sdl_quit(void);
    6970extern void sdl_loop(void);
     71
     72extern void gdb_init(void);
     73extern void gdb_quit(void);
     74extern void gdb_loop(void);
     75extern void gdb_inst(void);
    7076
    7177extern SDL_mutex *cpu_mutex;
  • emu/cpu.c

    rc3f113d r7cc6ac0  
    470470static void inst_cb(void)
    471471{
     472        gdb_inst();
     473
    472474        uint32_t pc = m68k_get_reg(NULL, M68K_REG_PC);
    473475        uint32_t op = m68k_read_memory_16(pc);
  • emu/main.c

    rc3f113d r7cc6ac0  
    2525static verb_flag_t verb_flags[] = {
    2626        { "sdl", &sdl_verbose },
     27        { "gdb", &gdb_verbose },
    2728        { "cpu", &cpu_verbose },
    2829        { "fpu", &fpu_verbose },
     
    128129}
    129130
     131static int32_t gdb_thread(void *data)
     132{
     133        (void)data;
     134
     135        gdb_loop();
     136        return 0;
     137}
     138
    130139int32_t main(int32_t argc, char *argv[])
    131140{
    132141        parse_args(argc, argv);
    133142        sdl_init();
     143        gdb_init();
    134144        cpu_init();
    135145
    136146        SDL_AtomicSet(&run, 1);
    137         SDL_Thread *thr = SDL_CreateThread(cpu_thread, "cpu", NULL);
     147        SDL_Thread *thr_cpu = SDL_CreateThread(cpu_thread, "cpu", NULL);
    138148
    139         if (thr == NULL) {
     149        if (thr_cpu == NULL) {
     150                fail("SDL_CreateThread() failed: %s", SDL_GetError());
     151        }
     152
     153        SDL_Thread *thr_gdb = SDL_CreateThread(gdb_thread, "gdb", NULL);
     154
     155        if (thr_gdb == NULL) {
    140156                fail("SDL_CreateThread() failed: %s", SDL_GetError());
    141157        }
    142158
    143159        sdl_loop();
    144         SDL_WaitThread(thr, NULL);
     160
     161        SDL_WaitThread(thr_cpu, NULL);
     162        SDL_WaitThread(thr_gdb, NULL);
    145163
    146164        cpu_quit();
     165        gdb_quit();
    147166        sdl_quit();
    148167        return 0;
  • emu/sdl.c

    rc3f113d r7cc6ac0  
    1818#include <all.h>
    1919
    20 int32_t sdl_verbose = false;
     20int32_t sdl_verbose = 0;
    2121
    2222#define ver(...) _ver(sdl_verbose, 0, __VA_ARGS__)
Note: See TracChangeset for help on using the changeset viewer.