Newbie Question: IDE debugging and target on same machine

Hi -

I am using QNX 6.2.1A Professional Edition on a x86 machine. Neutrino RTOS
and Momentics are installed on the machine and running on a QNX partition.
I understand that in general you can debug a program running on the same
machine as the IDE as long as you are running under the Neutrino RTOS.

I have written a small exercise program in C that uses the library function
pci_attach_device. This program is not able to see the SubsystemID and
SubsystemVendorID plus other information one would expect to see after
initializing a PCI device. Neutrino does report this information correctly
when the utility
pci -vvvv
is run outside of the IDE and in a terminal.

The program being debugged in the IDE seems to find the particular hardware
for the Vendor and Device ID designated since a valid handle seems to be
returned. The code follows the example in the Library documentation for
pci_attach_device which is

pidx = 0;
inf.VendorId = PCI_VENDOR_ID;
inf.DeviceId = PCI_DEVICE_ID;
hdl = pci attach device( NULL, 0, pidx, &inf );
if( hdl == NULL ) {
fprintf( stderr, “Unable to locate adapter\n” );
}
retval = pci attach device( hdl, PCI INIT ALL, pidx, &inf );
if( retval == NULL ) {
fprintf( stderr, “Unable allocate resources\n” );
}

Prior to this point, all members of the structure, inf, have been zeroed as
in the example.

The program being debugged returns a value for hdl that is not a NULL and
returns the same value for retval which seems to indicate that the device
was found. The problem is that the structure, inf, does not have any of its
entries initialized that one would expect to see (except for VendorID and
DeviceID members that were set in the program itself). In fact, only the
irq is changed and it’s value is at 0xFF. Could this problem be due to
trying to run the both the program and the IDE on the same x86 platform at
the same time?

regards…
james jenkins

James <james.nospam@plexoninc.com> wrote:

Hi -

I am using QNX 6.2.1A Professional Edition on a x86 machine. Neutrino RTOS
and Momentics are installed on the machine and running on a QNX partition.
I understand that in general you can debug a program running on the same
machine as the IDE as long as you are running under the Neutrino RTOS.

Yes, that is generally the case.

I have written a small exercise program in C that uses the library function
pci_attach_device. This program is not able to see the SubsystemID and
SubsystemVendorID plus other information one would expect to see after
initializing a PCI device. Neutrino does report this information correctly
when the utility
pci -vvvv
is run outside of the IDE and in a terminal.

Does your program work properly if run from the commandline?

When you run the IDE/program, do you run it as a regular user, or
as root?

Could this problem be due to
trying to run the both the program and the IDE on the same x86 platform at
the same time?

It shouldn’t be. The IDE should have no effect on the interaction between
your code and the pci-bios server, nor between the server and the hardware.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Hi-

Thanks for the reply. I have not tried to run the program from the command
line. The compile and link produced an elf file, TestA_g. I do not know
offhand how to run this from the command line but will look into trying to
get an executible to run from the command line (see…I really am a QNX
newbie ).

I am running the IDE as root and not as a regular user.

regards…
james

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:bi3a06$cvj$1@nntp.qnx.com

James <> james.nospam@plexoninc.com> > wrote:
Hi -

I am using QNX 6.2.1A Professional Edition on a x86 machine. Neutrino
RTOS
and Momentics are installed on the machine and running on a QNX
partition.
I understand that in general you can debug a program running on the same
machine as the IDE as long as you are running under the Neutrino RTOS.

Yes, that is generally the case.

I have written a small exercise program in C that uses the library
function
pci_attach_device. This program is not able to see the SubsystemID and
SubsystemVendorID plus other information one would expect to see after
initializing a PCI device. Neutrino does report this information
correctly
when the utility
pci -vvvv
is run outside of the IDE and in a terminal.

Does your program work properly if run from the commandline?

When you run the IDE/program, do you run it as a regular user, or
as root?

Could this problem be due to
trying to run the both the program and the IDE on the same x86 platform
at
the same time?

It shouldn’t be. The IDE should have no effect on the interaction between
your code and the pci-bios server, nor between the server and the
hardware.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.