Jump to content
dilinger

Debugger integration in Virtual Jaguar

Recommended Posts

Hi,


Just wanted to share my debugger integration in Virtual Jaguar. Screenshot shows an example about how it looks like.

Nothing can replace the real hardware but I wanted to give a try and modify the emulator.

I have added the support of ELF/DWARF format because my toolchain is based on it, and such format can operate at source code level.


If someone knows about QT and OpenGL integration, it can be helpful to me. Because, if I build the emulator under msys2 environement, I have a correct video output but if I build it with Visual Studio 2015, the output video remains black/empty.

post-40826-0-47914200-1504266946_thumb.jpg

  • Like 7

Share this post


Link to post
Share on other sites

Hi

 

Nice can you also display a window for DSP RISC and GPU RISC so step support

There are display for the GPU and DSP but no tracing for the moment. I add features when I feel the need or when I see "easy to do stuff".

 

Can You provide us your modifications for testing?

I can provide my current emulator version. But, you have to be aware my version need some DLLs (which I can provide), but no video output is displayed. As far, you do not need it, it won't be a big deal.

 

In the meantime, I have included my current Release notes for people interested to know more about my modifications.

vj_ReleaseNotes.txt

Share this post


Link to post
Share on other sites

Have you contacted Shamus? Merging your work into the official VJ code would benefit a lot of people :)

Thank you for your kind word.

I have been in touch with Shamus in the middle of 2016. I told him I was going to add the support of the ELF format. After that, I slowly added features but forgot to keep him updated.

I have tried to be very low intrusive in the original source code (such as finding the best hooks to insert my calls stuff), and created specific sources codes for most of the new windows / features.

In theory, the integration should be smooth.

  • Like 2

Share this post


Link to post
Share on other sites

Very cool. In my spare time I've been using Virtual Jaguar to learn more about writing an emulator, assembly language, etc.

 

I forked Virtual Jaguar and created Chocolate Virtual Jaguar with the intention of basically removing the cruft from the codebase and using it as a huge learning project essentially for myself. If you ever release the code for this, I'd love to take a look to see what you did.

 

https://github.com/rocky1138/chocolate_virtualjaguar/tree/develop

Share this post


Link to post
Share on other sites

Good evening,

I have shared the Virtual Jaguar and the DLLs in my Dropbox, in case of someone wants to have a look at the debugger.

I do not mind to share the source code, but I would prefer to make sure the version works properly outside my own environement.

 

Virtual Jaguar 64bits application
QT5 DLLs
Edited by dilinger

Share this post


Link to post
Share on other sites

thanks for sharing,

 

first feedback from my CMD:

This application failed to start because it could not find or load the Qt platform plugin "windows".
Reinstalling the application may fix this problem.

 

is there a dll missing? i placed all dlls in same folder as the VJ

 

fast goolge results: qwindowsd.dll ??

Edited by Otto1980

Share this post


Link to post
Share on other sites

I do not have missing DLLs and I do not have qwindowsd.dll either.

I guess you have used my QT5 DLL package "Qt5.5.1_DLLs_x64_VS2015-Release".

I will try to dig your issue and, just in case of, have you installed the QT5 binaries for Windows? I think there are packages available in QT downloads section.

I have added the qwindows.dll in the QT package, feel free to check if it works.

Edited by dilinger

Share this post


Link to post
Share on other sites

I got it to work but I had to install the whole Qt development package and run virtualjaguar from the MSVC2015 Qt command prompt.

 

edit: Well, it starts and runs my homebrew. The --debugger command line crashes the emu though.

Edited by Luigi301

Share this post


Link to post
Share on other sites

Many thanks for your time to test it.

 

I got it to work but I had to install the whole Qt development package and run virtualjaguar from the MSVC2015 Qt command prompt.

I do not have this kind of environement requirement(s). I compiled the QT5 package for VS2015 by myself, so I guess the installation may greater differ.

I'm able to make the emulator under msys2, but still needs the msys2 setup and link in the windows path.

I "dream" to insert all DLLs in the executable and to be ride off of the install "mess".

 

edit: Well, it starts and runs my homebrew. The --debugger command line crashes the emu though.

Could you give me the format used by your homebrew? Have you used additional command line options? I have checked using elf and cof format executable.

If you want, you can send me your homebrew executable and will check the issue.

Edited by dilinger

Share this post


Link to post
Share on other sites

Many thanks for your time to test it.

 

I do not have this kind of environement requirement(s). I compiled the QT5 package for VS2015 by myself, so I guess the installation may greater differ.

I'm able to make the emulator under msys2, but still needs the msys2 setup and link in the windows path.

I "dream" to insert all DLLs in the executable and to be ride off of the install "mess".

 

Could you give me the format used by your homebrew? Have you used additional command line options? I have checked using elf and cof format executable.

If you want, you can send me your homebrew executable and will check the issue.

It’s a Jaguar server executable - I’m going to say that’s the problem now that I think about it. How can I make a Jaguar ELF with VBCC?

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites

Its a Jaguar server executable - Im going to say thats the problem now that I think about it. How can I make a Jaguar ELF with VBCC?

 

 

Sent from my iPhone using Tapatalk

It's been a while but I think vbcc has to be recompiled. Might be mistaken. But I don't believe so.

 

Though Vlink can convert back and forth between a.out and elf. And probably jagserv.

Edited by JagChris

Share this post


Link to post
Share on other sites

You'll probably want debug and all that from the compiler I see okay.

 

It shouldn't be too hard to have your source recompile under GCC m68k elf.

 

http://www.3do.cdinteractive.co.uk/viewtopic.php?f=35&t=3371

 

I think you just need -fleadingunderscore and -c, and -68000 to make sure it produces 68000 asm. And it should work pretty smooth.

 

Sorry if I'm rambling on. Me and Tursi and Frank Wille put a lot of time into working all that out.

 

Hope it helps.

Edited by JagChris

Share this post


Link to post
Share on other sites

I changed the vlink config to output elf32jag instead of jagsrv and it's erroring out now on the startup lib?

 

 

vlink -belf32jag -t -x -minalign 1 -Bstatic -Cvbcc -nostdlib $VBCC/targets/m68k-jaguar/lib/startup.o "obj/hello.o" "obj/screen.o" "obj/cube.o" "obj/mobj.o" "obj/images.o"   -s -L$VBCC/targets/m68k-jaguar/lib/ -ljag -lvc -o bin/hello.jag failed
 
startup.o: In "startup":
Error 21: startup.o (CODE+0x42): Reference to undefined symbol _BSS_END.
libjag.a(debug.o): In "showoffset":
Error 21: libjag.a(debug.o) (CODE+0x318): Reference to undefined symbol _BSS_END.

 

Unfortunately the attachments don't seem to exist on that thread anymore. I have a m68k-elf-gcc but it's set up for Amiga so I'd need a Jaguar linker script.

Share this post


Link to post
Share on other sites

Hmm, undefined-symbol sounds like an underscore problem.

 

Like the names aren't matching anymore between the startup code and the main code.

 

Check the subsequent posts in the linked to thread for ideas and just look at the names and see if you can fix it.

 

And you really might want to consider just downloading the m68k gcc elf for Windows because a.out debug is rather primitive though Willie says that the conversion will honor any of the debug info.

Edited by JagChris

Share this post


Link to post
Share on other sites

Whoops. After thinking about it my logic is wrong. There's nothing to fix in the source codes. It might be something in the linker options that's adding and underscored during the link. Best guess on my part.

Share this post


Link to post
Share on other sites

@Luigi301

 

In case of -bjagsrv vlink uses a default linker script if nothing else is provided it looks like:

SECTIONS {
    . = 0x4000;
    .text: {
      *(.text CODE text)
    }
    . = ALIGN(32);
    .data: {
      VBCC_CONSTRUCTORS
      *(.data DATA data)
    }
    . = ALIGN(32);
    .bss: {
      *(.bss BSS bss)
      *(COMMON)
      _BSS_END = ALIGN(32);
    }
  };

The _BSS_END symbol ist used by the vbcc vclib to determine free RAM for malloc/free operations.

 

-toarnold

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...