1

I'm trying to implement a Suffix Trie to search strings using C++ for a programming assignment. Now I've started coding things with Vim/Ubuntu on a virtual machine (since I run windows), partly because it's encouraged by our lecturer not to use IDEs and compile things manually, and partly because the VM is too slow to run a decent IDE anyway.

But my program has grown quite large and I need to debug things. I've grown quite fond of both Eclipse's and CLion's debuggers in the past, so I decided to copy and paste my workspace to a windows directory, just for debugging.

I’m using C++11 and MinGW as a compiler, and programs run just fine:

Program Running Just Fine

But when I tried to debug the program, I got the message:

CLion

So I decided to try debugging in Eclipse instead. This time it sort of worked, but it isn't treating my std::string objects as strings, but rather as just objects with lots of properties in them:

enter image description here enter image description here

This is obviously a problem since I'm dealing a lot with std::strings. Now I've read online that this is related to the whole pretty printers thing I got with CLion, but I haven't been able to find anything which tells me how to get things set up with MinGW. I'd appreciate any advice.

Luke Collins
  • 1,433
  • 3
  • 18
  • 36
  • 2
    This answer might get you started: http://stackoverflow.com/a/13923245/3931225 – KompjoeFriek Jan 10 '17 at 14:11
  • 1
    First, the `std::string` won't be properly set up until constructed. After that, odds are `_M_dataplus>_M_p` will usually be a pointer to the first element of the string. But yes, getting a good pretty printer is nice. (It is also possible that your IDE and your code have a different definition of `std::string`, but I cannot diagnose that from that screenshot) – Yakk - Adam Nevraumont Jan 10 '17 at 14:48
  • check your configurations to ensure that no optimisations are being made. or use/create a debug configuration. Sometimes on release builds, debug symbols are not available during debug, due to optimisations that happened at compile time. – boring32 Jan 10 '17 at 15:33

1 Answers1

0

I was trying to figure out the same thing few days back. After Googling for hours and compiling all the stuff into one place, I have created a detailed post which might here. Here is the link: https://dev.to/abhinav1602/how-to-run-vs-code-c-debugger-on-windows-4d3

abhinav1602
  • 1,190
  • 17
  • 18