473,324 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Printing problems in gdb

Hi,
I am facing certain problems when I want to view the data
from variables or objcets. If i am trying to view the objects or
characters, sometimes it is showing adresses and some times it is
showing null adress like 0x0 .

Example is given below

297 strncpy( itemData, dataString, dataLen);
(gdb) n
298 return WCO_OK;
(gdb) p itemData
$12 = 0x0
(gdb) ptype itemData
type = char *

But the data is there in those variables. How to avoid
this situation ,if anybody knows or knows any soft book or any
site ,plese mail back to me.

Thanks in Advance
Sunil

Feb 7 '07 #1
2 1479
On Feb 7, 4:53 pm, "sunil....@gmail.com" <vvnsunilku...@gmail.com>
wrote:
Hi,
I am facing certain problems when I want to view the data
from variables or objcets. If i am trying to view the objects or
characters, sometimes it is showing adresses and some times it is
showing null adress like 0x0 .

Example is given below

297 strncpy( itemData, dataString, dataLen);
(gdb) n
298 return WCO_OK;
(gdb) p itemData
$12 = 0x0
(gdb) ptype itemData
type = char *

But the data is there in those variables. How to avoid
this situation ,if anybody knows or knows any soft book or any
site ,plese mail back to me.
1. Please post to appropriate group. GDB is offtopic here.
2. Google "GDB" and you will get lots of information.
3. itemData could indeed be 0x0. If not, there are lots of
things to consider including how you compiled your program,
how was your gdb configured and what is your operating
system.
Thanks in Advance
Sunil


Feb 7 '07 #2
su*******@gmail.com <vv***********@gmail.comwrote:
I am facing certain problems when I want to view the data
from variables or objcets. If i am trying to view the objects or
characters, sometimes it is showing adresses and some times it is
showing null adress like 0x0 .
Example is given below
297 strncpy( itemData, dataString, dataLen);
(gdb) n
298 return WCO_OK;
(gdb) p itemData
$12 = 0x0
(gdb) ptype itemData
type = char *
But the data is there in those variables. How to avoid
this situation ,if anybody knows or knows any soft book or any
site ,plese mail back to me.
That's not really a question about C so it's a bit off-topic here.
You perhaps better ask such questions in a newsgroup dedicated to
discussions about the GNU compiler tools like gnu.gcc.help.

<OT>
Did you compile with optimization disabled, i.e. with '-O0' (that's
an uppercase letter O, followed by the number 0)? Optimization can
rearrange code, lead to data stored in CPU registers, even optimizing
out some of the variables etc. which then makes the output of the de-
bugger look rather strange.
</OT>
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Feb 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
5
by: Mark Preston | last post by:
Admission first - I don't actually have a problem here but have noticed that a lot of people have been asking similar questions and getting very varied answers. What I've done is to sort of...
3
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
1
by: G.Esmeijer | last post by:
Friends, I'm (a bit) dissapointed about the printing possibilities in c#. It could also be lack of knowedge. I would like to align a text on the right side of the paper when printing. For...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
4
by: Tracey | last post by:
Hey folks, I have an ASP.NET web app that's working just fine, but a small percentage have two printing problems that don't happen to the vast majority of users. These problems are listed below...
1
by: Dreamtime | last post by:
Hi I am using Visual Studio 2005 and the bundled Crystal Reports (previously I used .net 2003 and bundled Crystal Reports for 2 years - same issues!) I have a report which is displayed in the...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.