The Linux Page

debug

When one of the early computers stopped working, it felt like the program was wrong. The fact was that a bug was crowling inside and generating electrical problems. Once the bug was removed and the computer fixed, the program worked again. Since then, a problem in a computer program is called a bug. The word de-bug means removing the bugs from the software program.

Debug and/or Release specific command line option in cmake

Today I ran in a problem with cmake which was to very simply select /MT instead of /MD for a small set of projects. The problem is that so far this feature was at least on a per directory basis. Since the exact same directory is used to build the dynamic (DLL) and static (.lib) libraries, having two directories is not exactly an option here.

set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT" )
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} /MTd" )
set ( CMAKE_C_FLAGS_DEBUG ...

Hacking my NVG510 device

Earlz found a way to hack the NVG510 device and wrote a page about it: Rooting The NVG510 from the WebUI

He also offers a page that one can use to allow telnet connections to the NVG510 (by default it is locked up.) From there you can allow ssh and tftp connections too.

Note that this means if you are logged in your NVG510 and you click on a link on a bad server, you could actually allow remote connections from anyone! So that's a dangerous back door, although if you are not logged in the Web interface, then it is fine (assuming you do not then log in without thinking!?)

Just in case ...

mov eax,dword ptr fs:[0000000h]

As I was trying to debug a problem using an STL vector, I looked at the resulting assembly and saw this strange thing:

mov eax,dword ptr fs:[0000000h]

And a little further down, the opposite:

mov dword ptr fs:[0000000h],eax

These statements are from VC++ so the first is "put fs:[0] in eax" and the second is "save eax at fs:[0]".

Curious I looked around and found a page describing what's really hapenning. If you need to know, that's actually initializing the exception structure for this function. The fs:[0] location is where that structure pointer is saved ...

Includes in your C++ files... and namespace "side effects"

Today I discovered that I couldn't include the QDebug header file at the time I need it.

When I write in C/C++ I like to add my test libraries at the point where I'm writing the debug function I'm working on so that way I can delete it all at once.

So the skeleton of a file would look something like this:

Comment (copyright/purpose of file)

#include of all headers necessary

code

#include of debug headers

debug code

However, today I had problems compiling and/or linking doing so. The qDebug() << ... expressions did not want to work.

Moving the #include of debug headers to

The application was unable to start correctly (0xC0150002). Click OK to close the application.

On MS-Windows, you get really strange errors and at times some of those errors are difficult to fix.

Sams Teach Yourself C++The error 0xC0150002 means that a DLL could not be loaded and thus the software could not get started since a piece of it was missing. The only solution is to "close the application" (since it wasn't really started, closing it sounds a bit funny here.)

There are several ways to find out about the problem. In Visual Studio, the output should tell you what is happening and that a library could not be loaded. However, many times, low level libraries will not be displayed in the ...

Errors and Form_Open() in MS-Access Main

Problem

I wrote some MS-Access code that I want to execute once a day.

Trace PHP code with xdebug

xdebug

XDebug "logo"I'm very much working on Drupal and once in a while, I just have no clue what the code does... especially when there are callbacks that call callbacks in forever loops.

wsprintf() limit under MS-Windows

Today I wanted to check out a set of floating value in my Visual C++ development environment.

You can use the OutputDebugString() to print a debug string in the VC++ output window when running a software. This is quite handy, but when working in C++, string handling can be tedious. I need to create a message and wrote something similar to this:

wchar_t msg[128];
swprintf(msg, "Float: %f\n", my_float);
...

[toc hidden:1]

MS-Access: INSERT INTO syntax error

Today I was creating a report and created a table with a column named 'Group'. It looked like it worked just fine so I moved on with it.

Then, at the point I wanted to insert data with a simple INSERT INTO ... statement, it broke. The statement would generate a syntax error. Yes. The simple answer is that GROUP is viewed as a keyword and thus when used as a field name it needs to be escaped (i.e. written between backward quotes: `...`). Not liking the need to escape a field name each time I use it, I just renamed the field which is even better.

Syndicate content Syndicate content

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.

     

Terms of Site Index

Find the page/content you are looking for with our index.