lldb debug Chromium not showing variable correct - debugging

Guys, I have successfully built a debug version of Chromium on OS X Mavericks‎ 10.9.2 by following this instruction with ninja -C out/Debug chrome.
The question is when I debugging(using lldb) into the Chromium, I cannot show all of the variable's value in the debugger:
The variable isolate is showing correct, but not the element_size. How can I let the debugger know where to find the element_size and others? Is this something about global and local variable? Thanks!

Check your optimization settings. If you are not building -O0 it may be that the compiler has figured out it doesn't need this variable, and so the debugger's not going to be able to find it.

Related

Debug xv6 on mac with CLion

I've looked through the internet and searched for solution for debugging xv6 on mac with CLion and didn't find one. as you know it's difficult (or maybe impossible, I didn't succeeded anyway) to make gdb work on macOS.
So, how can I do it? How can I debug xv6 with CLion on macOS?
NOTE that in order to be able to debug xv6-riscv you will need to use riscv64-unknown-elf-gdb instead of gdb
as following:
run make qemu-gdb clean in terminal (in the project's directory of course), pay attention for the port, it may be different for some reason, for me it was 25501.
All I needed to do is the following:
kernel is good for debugging proc.c, if you want to debug other file, (i.e. sh.c) you should put _sh instead.

Code::Blocks How to specify SSDC debugger for PIC micro-controllers?

I'm using SSDC Compiler for PIC micro-controllers, and it supposed to have a supported debugger called (SDCDB). Although, in compiler settings it shows Invalid Debugger in debugger option. So, how can I specify the SDCDB to be my default debugger. And, is there any problems using GDB with SDCC compiler?
This only answers part 1 of your question. I don't know what happens when you use gdb with SDCC.
You will need to be an admin user for this
Look for options_sdcc.xml in %programfiles%\CodeBlocks\share\CodeBlocks\compilers
Open the file in an editor. Look for DBGconfig on the windows platform. Set the value to sdcdb.exe

QtCreator + gdb on Mac OS X Yosemite doesn't give me source level debug info

Debugger shows me dissassembler code, while i am trying to step over the instructions of my program.
Using lldb under QtCreator.
Interesting thing is: debugging works fine, if i use it without QtCreator (via terminal)
Small projects seems to debug normally... So I've try to add peaces of my project gradually to small one.
I've found a peace of code, that resulting to crash:
QVector<myClass>::contains();
But if i try to make an empty project only with this realisation, problem disappeared.
I've lost about a week, trying to solve it.
Any ideas, what can go wrong?
EDIT:
Well, QtCreator still using GDB instead of LLDB, that i refer it to...
Looks like bug

How to compile programs to enable LLDB debugging symbols?

On my MacBook at work, I'm trying to use LLDB to attach to a running Ruby process.
It's normally suggested that one compile Ruby with the debug flag -ggdb(3) to use GDB. But I can't find anything equivalent for LLDB. My Google-fu is failing me, so I thought I'd ask, since this seems like an obscure request.
I would assume that all that -ggdb does is produce debug information. The format for this debug information is most likely DWARF, which both GDB and LLDB understand
If that is the case, -ggdb is a misnomer and should be fixed. But, for your intents and purposes, you should be able to just compile with -ggdb and then attach with LLDB and things should be all right

Debugging with Bochs + GDB: "cannot find bounds of current function"?

I'm working on writing an OS and I'm running into problems trying to debug my code. I'm using GDB to connect to Bochs' GDB stub to "remotely" debug my kernel. Connecting works fine, as does loading debugging symbols from the kernel file. I set a breakpoint for the kmain function, which is successfully located, and the debugger breaks correctly (inside my kernel). However, I can't "step" or "next" through my code, nor can GDB apparently determine which line of code is the current line.
When I try to "step", I get the following message: "Cannot find bounds of current function". This is the only error message I get at any point.
My code is being compiled in GCC with the -g flag (I've tried other types of debugging information using GCC options; none have worked.) I have tried looking through the GDB manual , as well as searching for the answer, and I'm totally stumped. Any help would be amazing.
Thanks!
Well, I got debugging working, but I had to switch emulators. I was able to get GDB working with Qemu, even though I also had problems doing that. To get GDB to connect to the Qemu gdbserver, I had to pass the following option to Qemu: "-gdb tcp::1234,ipv4". Took me forever to figure that out... Debugging works perfectly now!
Googling throws up "This is because when you attached to gdbserver, the process under
debug has not completed the C start-up code" http://www.cygwin.com/ml/gdb/2005-03/msg00237.html... http://www.bravegnu.org/gnu-eprog/c-startup.html describes the process for when you are coding for embedded devices, maybe this will help?
If you find the answer please post here as I'd like to know what the solution to the problem is too.
I don't know why but bochs with gdb-stub enabled seems to be picky with the config options. On some system following options will break it:
--enable-x86-64, --enable-vmx

Resources