www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - Debugging DMD executables with GDB in Linux; dynamic arrays and other

reply Bernard Helyer <b.helyer gmail.com> writes:
Given a simple module:

	// dmd -g file.d
	void main()
		int i = 3;

We can debug it using gdb (patched or no) like so:

	$ gdb file
	GNU gdb 6.8... <snip>
	(gdb) list _Dmain
	1	void main()
	2	{
	3		int i = 3;
	4		i++;
	5	}

And then set break points and variables to watch as we please. Even over 
multiple modules. But as soon as a dynamic array shows anywhere, in any 
fashion, in any module...
	// dmd -g file.d
	void main()
		int i = 3;
		bool[] a = null;  // <--

	$ gdb file
	(gdb) list _Dmain
	(gdb) list _Dmain
	Die: DW_TAG_<unknown> (abbrev = 5, offset = 471)
		has children: FALSE
			DW_AT_byte_size (DW_FORM_data1) constant: 8
			DW_AT_type (DW_FORM_ref4) constant ref: 462
	Dwarf Error: Cannot find type of die [in module /path/to/module]

This is with a patched gdb. Now, sometimes compiling with `-gc` allows 
this to work (as it does with this simple example), but in my larger 
programs, this error message is given instead:

	Dwarf Error: Cannot find DIE at 0xe36 referenced from DIE at
	0x165 [in module /path/to/module]

I'm not sure whose fault this is, so instead of posting a bug, I thought 
I would post it to the newsgroup (my first to a newsgroup, so if I've 
made a galling error in etiquette, please, be gentle. :]

Also, shouldn't the GDB command 'list' list out the D module, without 
having to specify _Dmain? If you don't, it just gives this report:

	(gdb) list
	1	../sysdeps/i386/elf/start.S: No such file or directory.
	in ../sysdeps/i386/elf/start.S

I think having GDB and DMD working together nicely is important. If push 
comes to shove, I'm willing to learn about DWARF and ELF and GDB 
internals as a project, but to be completely honest, I'd rather not have to.


Nov 22 2009
parent "JerryEdison" <jerry1edison gmail.com> writes:
ISO image file is a digital copy of the original Blu-ray disc. It
includes data contents of every written sector of the optical
disc. The ISO image files can be easily stored on computer and
transferred over any data link or removable storage medium.


Now lots of Blu-ray fans prefer this format to backup their
Blu-ray movies. To enjoy the backuped Blu-ray ISO image on
Windows 8 32-bit/64-bit or Windows 7 32-bit/64-bit with
outstanding sound/picture quality, the professional Wondows 8/7
Blu-ray playing software will be crucial. Today I will recommend
everyone the wonderful Windows 8 Blu-ray Player from UFUSoft.
This is a powerful yet easy-to-use Blu-ray playing application
for Windows 8/7, which offers users a perfect solution to enjoy
Blu-ray disc, folder and ISO image files on computer with Windows
8 or Win 7.

Now I will show you how to enjoy Blu-ray ISO image files with
this Blu-ray Player for Windows 8/7 step by step.

Tips: To enjoy the Blu-ray ISO images, you need to install a
virtue Blu-ray drive on your computer first.

Step 1: Install the Blu-ray Player for Windows 8/7

Any customers can easily download the Windows 8 Blu-ray Player
for free. Then users can install the application on your Windows
8 or Windows 7 computer.


Step 2: Load the Blu-ray ISO image

Launch the virtue Blu-ray drive to load the Blu-ray ISO image

Then click the "Open Disc" button to open a browse window where
you need to find the virtue drive on your Windows 8/7 PC.

Step 3: Start to play Blu-ray ISO on Windows 8 or Win 7

Once the Blu-ray ISO loading process is finished, you will see a
menu list containing Play Movie, Chapter, Audio, Subtitle and
Other Titles. Select "Play Movie" to directly play the main movie.


Step 4: Control the Blu-ray ISO play on Windows 8/7

Besides of enjoying the Blu-ray ISO on Windows 8/7 from the
beginning, users can also choose to play the specific Blu-ray
title or chapter by right-clicking on the playback screen. Also
this Blu-ray Player allows users to define the audio/video track,
audio channel, playing screen size, and so on.
May 30 2013