C :: Debugging A Code On Linux OS

Apr 11, 2013

I have a code that I'd like to debugg it.

Question
1 - What is the correct command line to use the debugger ?
2 - Do I need to install additional software for the debugger ?

if yes what it's name?

I use ububtu 12.4compiling command: gcc abc.c -lpthread -o abc

View 3 Replies


ADVERTISEMENT

C# :: Code Was Skipped While Debugging For No Reason

Oct 6, 2014

I have something like this

string rid = row.Cells[0].Value.ToString();
string identification = row.Cells[9].Value.ToString();
IDLabel.Text = "ID: " + rid + " <Identification: " + identification + ">";

I checked that while identification has a value, the IDLabel.Text was run just fine, but if identification has null value, IDLabel.Text was skipped totally...

View 13 Replies View Related

C++ :: Debugging Code (Displaying Char String Per Character)

Jul 16, 2014

I've tried a bunch of alternative methods to prevent an assertion error. "not understanding" the bug and why I'm getting it are relevant here, not proper, (or more appropriate), coding methods. I would write it in another way to prevent the error, I simply want to understand what is happening during run-time that causes the situation.What is the bug?

---------------------------------------
[assertion error]
[expression _block_type_is_valid(phead->nBlockUse)]
--------------------------------

Code:
#include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Enter your name : ";
string Name;

[code]...

View 1 Replies View Related

C++ :: Error Message While Debugging

Mar 17, 2013

I'm getting an error message that I can't seem to fix. The error clearly states that during the link aspect of the debugging and build there is an error that says that the stdio.h file is either missing, invalid or corrupt. When I try to program using any of the other headers I'm getting the same error. The files are there I can see them in the include folder, so I'm asking what can I do to fix all these headers and beware I am a beginner at programming and using any kind of compiler.

This is the error I receive.
1>------ Build started: Project: hello, Configuration: Debug Win32 ------ 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

This is the compiler I am required to use for an online course and all instruction is given for the Microsoft visual 2010 express edition. Also the only file I think that's being referenced is the #include <stdio.h>.

View 1 Replies View Related

C++ :: Crash Normally But Not When Debugging (SDL Malloc)

Jul 16, 2013

Notes: Im Using SDL, Im using Codeblocks to code

Ive narrowed down my crashing problem ( using printf's ) to a malloc call I had to use printf's because when i ran the program in Codeblocks debugging mode, it did not crash and ran fine, but when i ran it normally, it would crash, giving me this error:

fatal signal segmentation fault (sdl parachute deployed)

Inside my code, I created a malloce function that checks malloc for me ( so i dont have to do it )

( general.h )

void* malloce ( size_t size )
{
printf ( "start malloce %i
", size );

[Code]....

funny thing is that i called this malloce function about 20 times before it hits this part of the code, it is unknown behavior to me!

View 10 Replies View Related

C++ :: Error Debugging With Functions?

Oct 7, 2014

I am remaking this code for my gain, and it seems that I cant debug the error..

Are there any comments on the structure of the code? Why are there errors in calling the functions?

#include <iostream>
#include <cmath>
#include <iomanip>

[Code].....

View 6 Replies View Related

C++ :: Debugging Char Variable

Oct 13, 2014

I have a bug and when I debugged in some point i needed to know whats inside my char **grid , when i hold mouse over this variable in debug mode i can only see hex or address.. ! i cant see my values grid is 10 * 10 table which hold a number from 1 to 3 .... is there any way for me to see whats inside ?

I'm using visual studio 2013 ultimate ....

View 2 Replies View Related

C :: Segmentation Fault Could Not Find After Debugging

Apr 15, 2013

I want to know what was wrong with my code when I submitted. It's a Traveling Salesperson Problem, and the code is complete for the most part. I just can't seem to find what's causing the segmentation fault even after attempting to debug with gdb. Something is supposed to be wrong with line 76, but I don't see how my arrays are messing up. I've looked through this code countless times, and I know I'm just missing something small. I just don't want to end up making whatever mistake I made on this again in the future.

Code:

#include <stdio.h>
#include <stdlib.h>
#define SIZE 20

[Code]....

View 9 Replies View Related

C++ :: Macro For Debugging New Through Operator New Syntax?

Aug 14, 2013

It's common to see the following macros:

Code:
#define DEBUG_NEW new(__FILE__, __LINE__)
#define new DEBUG_NEW

and overloading operator new for debugging purposes. It usually works but there is a problem when use operator new syntax in code instead of directly use new. I can change my code but i can't change third party's code. Something like this:

Code:
int* j = static_cast<int*>(::operator new(sizeof(int)));

It's not common, but it appears occassionally.With that syntax, new macro generates compilation errors.

Is there any way to fix this problem?

View 2 Replies View Related

Visual C++ :: Debugging - Revisiting Same Memory State?

Oct 31, 2013

When running my code in Visual Studio, there is a particular point in the code where my program is crashing. To debug this, I am adding a break point in Debug mode just before that point, and observing what happens as I step through the code. However, to get to this break point in the code takes about a minute of running the program. So I'm wondering if there is a tool in Visual Studio to reload the state of a program's memory from a previous run, so that I can immediately get to the break point without having to wait for a minute each time?

View 6 Replies View Related

C++ :: Vector Subscript Out Of Range Error Whilst Debugging

Apr 21, 2014

I have the following code. however, when I debug it gives an error saying" vector subscript out of range"

Vector based mufti-dimensional arrays

Vectors are a STL container that allow you to store pretty much anything in them. When used correctly they can be very powerful containers.

They provide an added benefit that they will automatically remove the memory they use when they go out of scope. This means that objects stored within a vector do not need to be de-allocated (but pointers to objects do). You can also do some interesting things with dynamic multidimensional arrays with vectors.

For example, if you only allocate the first dimension, then use the .push_back() to add records to the 2nd dimension it's no longer a grid, but an array with a dynamically sized 2nd dimension (much like a street of buildings each with a different amount of floors).

This functionality can be achieved using pointers, but is much harder to do.

#include <iostream>
#include <vector>
#include<conio.h>
using std::vector;
using namespace std;

[code]...

View 8 Replies View Related

Visual C++ :: Data Stuck When Debugging With Serial Port

May 10, 2014

I am making a MFC application with VC++2012 with receiving data from Serial Port and the data is stored in a Listbox, then after processing (convert into numbers) and get these data to draw a sine wave on the chart. (I intend to make a virtual oscilloscope).

Everything works ok at the beginning, but after receiving about 300 items or above (in the Listbox) the value seem stucking (or lagging) and work very slowly.

I receive data by the SerialPort_DataReceived() method, and process of converting and drawing chart also in this method, I think this makes the system overload!!

View 1 Replies View Related

Visual C++ :: Debugging Access Write From Error Message

Aug 12, 2013

I have a crash on a application the customer machine i couldn't reproduce it yet on my machine... all i have is the error message

The Instruction 0x0070478b referencing to the memory 0x00000000 could not be written.

And that's all i have how do i track that instruction on my program from that address? is it possible?

View 4 Replies View Related

Visual C++ :: Running / Debugging Console App That Needs Admin Privileges

Nov 4, 2012

I see there's something called a manifest file but VS C++ EXPRESS seems different than non-express. The solutions I've seen show applets/tabs that I don't have in Express.

In one of my physical DEBUG folders are some .manifest. files and some a .res and .rc file.

I know you need to edit the XML and change asInvoker to requiredAdministrator (or something like that).

The confusing part is if I go into Project Properties, MANIFEST TOOL caret/tree, under INPUT AND OUTPUT, it shows this .manifest file is OUTPUT. It's as if it rewrites it every time with some defaults? I have edited it, but I see it's back to asInvoker. There is a spot to put in a ADDITIONAL manifest file (or .res file).

Does a manifest somehow affect the physical .exe file (something is imbedded in it??)?

How do I change my project to make sure that the .exe always runs as Admin? Will doing this ALSO allow me to DEBUG it in VS C++ EXPRESS without having to do anything different (play with manifest or run VS outright with Admin level)?

View 2 Replies View Related

Visual C++ :: Debugging Library / CXX0017 Error - Symbol X Not Found

Dec 20, 2012

I am debugging a library. I can step into the code however the watch window doesn't show the values of any variables. It will display a message in the value field:

Code:
m_pParentCXX0017: Error: symbol "m_pParent" not found

Interestingly it does show values for local variables in that function but not member functions. Most of my data members are member function though that I want to debug. I am using VS2010.

View 3 Replies View Related

C++ :: UDP Socket Library On Linux

Jan 29, 2014

I'm attempting to write a little UDP socket library in c++ on linux so a user can just create a new instance of a UDPSocket class, specify destination ip and port, and just connect. Then the user should be able to call send() or receive() in any order they want.. and here I encounter a little problem..

Most of the tutorials for udp socket sending out there include a bind() call when you create your "server" that is supposed to receive data, but the code that send data does not need one. Because I also want my library to support unicast/broadcast/multicast, I have read that I need to set the socket option SO_REUSEADDR on my sockets (since multiple sockets will need to be connected to same destination IP/port for broadcast/multicast)

My question is.. do I need to create 2 socket handles per "UDPSocke in order to make this work? One for sending and one for receiving data? In my code when I try to work with only 1 socket, it is only able to receive stuff from itself on unicast.. Or should I just remove the SO_REUSEADDR when in unicast mode, then try to bind with both sockets, accept that the bind will only work on the 1st socket, and take it from there?

View 1 Replies View Related

C :: Creating Shell In Linux

Feb 22, 2015

This is what so far i did

Code:
#include <stdio.h>#include <string.h>
#include <ctype.h>
#include <bsd/string.h>

int
main(void)

[Code] ....

How to do this Using the fork(), execvp() and waitpid() system calls, launches the requested program and waits until the program has finished.

View 3 Replies View Related

C :: Implementing GUI On Linux Platform

Jul 6, 2014

I am an experience C programmer but never implement GUI.

I need to make a demo implementation that will be run on Linux and will implement GUI.

I searched the WEB and found lot of information, among is implementing the GUI in HTML and run the API through web browser.

How can I make such implementation in C?

View 2 Replies View Related

C :: Compiling 2 Files In Linux Gcc

Sep 22, 2014

I want to use two separate files in 1 program, but cannot get it to work. I don't know if it's my files or the compiling thats wrong. I have never used 2 files in my programs so far. Only used #include <stdio.h>.

Here are my files:
extern_static.c Code: extern int i;
int main(void)
{

[Code]....

View 10 Replies View Related

C :: File Which Can Be Compiled In Linux Via GCC

Aug 16, 2013

I have a c file which can be compiled in Linux via GCC , but when I compile it in NetBeans via Cygwin or MinGW , it doesn't work and keeps throwing a segmentation fault.

View 14 Replies View Related

C++ :: Works On Solaris But Not On Linux?

Apr 24, 2013

I have this following piece of code:

int id = 5;
const char *ptrId;
ptrId = ( int_to_str(id) ).getPtr(); // Works in Solaris well

But the above code prints some junk values when I run the same on Linux machine. But the following works well on Linux:

String temp = int_to_str(id);
ptrId = temp.getPtr();

The prototype of getPtr() is:
const char* String::getPtr() const

View 2 Replies View Related

C/C++ :: Linux Console Get Key State

Jan 23, 2014

I want to create command line game in Linux but I don't know to get the key state. I heard of getch() but that stops the program.

View 1 Replies View Related

C/C++ :: Opening Application From Another Linux Mac

Dec 15, 2014

I want to open an application A from another application B. By opening it, I don't want to open it within B. I found many ways to call an application from within another. However, what I want to do is open the other one(A) simultaneously. How can I achieve this? fork() and exec() seem to open A within B. I am developing a code for Linux and Mac.

View 7 Replies View Related

C++ :: Why Using Namespace Required In Linux But Not In Turbo

Jan 8, 2015

Why is using namespace needed in linux but not in turbo c++?

View 1 Replies View Related

C/C++ :: MD5 Checksum Mismatching On Windows And Linux?

Feb 17, 2014

I have implemented MD5 checksum algorithm by using C language, but it is resulting correct value in windows but not in Linux?

// Constants are the integer part of the sines of integers (in radians) * 2^32.
const uint32_t k[64] = {
0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 ,
0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be ,
0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 ,

[Code] .....

View 2 Replies View Related

C++ :: Detect Arrow Key Press For Linux Only

May 13, 2012

I'm trying to implement this on ubuntu, to compile and run only under ubuntu.

I found 100s of other attempts at answering the general question of arrow key press in c++. Nothing solid.

Some recommend using the Readline for the functionality I am trying to implement, but I need to stay clear of GNU licences if I can for this project. And some tips only work on projects for windows machines... for example the conio library.

For linux there may be the option of using the ncurses library which I will take a look at, but I am stubborn and want to implement this myself. It should be an easy straight forward thing to do, which is why I am a bit frustrated at the moment.

Here is my test code so far.

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
using namespace std;
int main(void) {
char a;
stringstream ss;
string s;

[Code] ....

So! This works... 80% of the problem is solved. If you compile this, g++ under linux, ubuntu in my case, and run. Each keystroke reveals the correct key numbers.

q=113
w=119

when I click on the up key I get,

up = 279165

I thought, I can use this number is a if(int == '279165') to detect the up key.

I was not so lucky... this int is not behaving like an int!

So I modified the code to see it I could carry out an int operation on this number.

I added a 100000 to int i.

cout<< i + 100000;

Code:
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
using namespace std;
int main(void) {
char a;
stringstream ss;
string s;

[Code] .....

Compiling and running this, and pressing the UP key gives the following number.

100027100091100065

Some some sort of array, something like, [27][91][65].

I tried all ways to access these individual numbers, actually the third one for comparison purposes, but no luck.

For completeness sake I list the other arrows.

UP = [27][91][65]
DOWN = [27][91][66]
LEFT = [27][91][68]
RIGHT = [27][91][67]

A little further digging shows that these numbers are derived from the representation of a "multi-char" constant, the data type given when pressing special characters...

Now here is the main problem I have, I can find ANY decent documentation on how to handle and play with "multi-char" .

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved