Debugging Network Driver!!

Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.
So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Thanks and regards,
Jalaja

JalajaDevi <jganapat@storage.com> wrote:

Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path /mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

I tried this. In a different not, I get “symbols Not loaded” message cuz I
dint speicify -g option in the makefile.
Since I have the standard layout of QNX makefiles
I could not figure out in which makefile I can add -g option so that my *.c
files gets compiled with -g option and i can load the symbols for debugging.

Thanks,
Jalaja




“Colin Burgess” <cburgess@qnx.com> wrote in message
news:9kc87e$f8r$1@nntp.qnx.com

JalajaDevi <> jganapat@storage.com> > wrote:
Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path
/mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared
object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can
then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

I tried this! But on a different not, I am unable to load the symbols cuz I
could not figure out where to add -g option. I follow the QNX standard
Makefile layout.
In …/devn/common.mk, there was a CFLAGS where I added -g. But itz not
taking it for compilation.

Thanks
Jalaja

“Colin Burgess” <cburgess@qnx.com> wrote in message
news:9kc87e$f8r$1@nntp.qnx.com

JalajaDevi <> jganapat@storage.com> > wrote:
Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path
/mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared
object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can
then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

Test Mail! Please Ignore!

“Colin Burgess” <cburgess@qnx.com> wrote in message
news:9kc87e$f8r$1@nntp.qnx.com

JalajaDevi <> jganapat@storage.com> > wrote:
Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path
/mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared
object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can
then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

I did this. But my symbols are not getting loaded. On a different not, I
could not figure out where i could add -g option. I follow the standard QNX
Makefile strategy.
In the …/…/devn/common.mk file, I added -g in the CFLAGS. But itz not
getting compiled with -g option.

So, In which file I should add -g option?

Thanks and regards,
Jalaja

“Colin Burgess” <cburgess@qnx.com> wrote in message
news:9kc87e$f8r$1@nntp.qnx.com

JalajaDevi <> jganapat@storage.com> > wrote:
Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path
/mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared
object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can
then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

JalajaDevi <jganapat@storage.com> wrote:

I did this. But my symbols are not getting loaded. On a different not, I
could not figure out where i could add -g option. I follow the standard QNX
Makefile strategy.
In the …/…/devn/common.mk file, I added -g in the CFLAGS. But itz not
getting compiled with -g option.

So, In which file I should add -g option?

DEBUG=-g -O0

-xtang

Thanks and regards,
Jalaja

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:9kc87e$f8r$> 1@nntp.qnx.com> …
JalajaDevi <> jganapat@storage.com> > wrote:
Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path
/mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared
object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can
then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

Hi,
I am sorry if my question is not clear.

I had already added the -g flag in the /devn/common.mk file. But it is not
compiled with the flag.
I am not sure in which Makefile I need to add the flag.

Thanks
Jalaja



“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:9kem6q$11l$3@nntp.qnx.com

JalajaDevi <> jganapat@storage.com> > wrote:
I did this. But my symbols are not getting loaded. On a different not, I
could not figure out where i could add -g option. I follow the standard
QNX
Makefile strategy.
In the …/…/devn/common.mk file, I added -g in the CFLAGS. But itz not
getting compiled with -g option.

So, In which file I should add -g option?

DEBUG=-g -O0

-xtang

Thanks and regards,
Jalaja

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:9kc87e$f8r$> 1@nntp.qnx.com> …
JalajaDevi <> jganapat@storage.com> > wrote:
Hi, I am debugging Network Device Driver:

I do the following:

In one session:
gdb /sbin/io-net
run
set solib-search-path /mypath/devn-mydriver.so

change this to

set solib-search-path
/mypath/devn-mydriver.so:/x86/lib:/x86/usr/lib:/x86/lib/dll

set auto-solib add 1
c

In another session
mount -Tio-net -oif=en0:11.2 /lib/dll/npm-ttcpip.so
mount -Tionet devn-mydriver.so

Here where can I put a breakpoint to start from my mydriver_init ?

Also, When I mount the io-net, in the first terminal, the message
libc.so: No such file or directory
is popped out.

This is because of you not adding /x86/lib etc to your search path

So I repeat these steps again.
set solib-search-path /mypath/devn-mydriver.so
set auto-solib add 1
c

Could anyone tell me wat am i missing out here. And How can i put a
breakpoint and debug my driver?

Once you have io-net up and running, just before you mount your shared
object,
add a breakpoint to dlopen.

Then mount your shared object - io-net will hit dlopen.
Then type ‘finish’ this will run to completion out of dlopen. You can
then
do a ‘shared’ command to load the symbols of your shared lib, and can
set breakpoints on it.


cburgess@qnx.com

JalajaDevi <jganapat@storage.com> wrote:

Hi,
I am sorry if my question is not clear.

I had already added the -g flag in the /devn/common.mk file. But it is not
compiled with the flag.
I am not sure in which Makefile I need to add the flag.

Actually, the easiest thing to do is add a new “variant” which will include
the debugging macros and options.

ie:

cd devn/pcnet
addvariant x86 dll.g
cd dll.g
make

This will work on all versions of all types of sources that use this makefile
layout (ie: not just network drivers).

chris

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

But the command is not found!!!
/bin/sh: addvariant : not found

Now, How can I add -g option.

Thanks
Jalaja

“Chris McKillop” <cdm@qnx.com> wrote in message
news:9klh2j$648$1@nntp.qnx.com

JalajaDevi <> jganapat@storage.com> > wrote:

Hi,
I am sorry if my question is not clear.

I had already added the -g flag in the /devn/common.mk file. But it is
not
compiled with the flag.
I am not sure in which Makefile I need to add the flag.


Actually, the easiest thing to do is add a new “variant” which will
include
the debugging macros and options.

ie:

cd devn/pcnet
addvariant x86 dll.g
cd dll.g
make

This will work on all versions of all types of sources that use this
makefile
layout (ie: not just network drivers).

chris

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

What system are you doing this work on? From my 6.1 system…

cdm@katana → pkgctl which addvariant
— Information from /dev/pkginfo13 —
Localpath: [/usr/bin/addvariant]
Fullpath: [/pkgs/repository/qnx/os/devtools-2.1.2/usr/bin/addvariant]
Repository: [/pkgs/repository]
Vendor: [qnx/os/devtools-2.1.2]
Tree: [usr/bin/addvariant]


Are you using 6.1?

chris


JalajaDevi <jganapat@storage.com> wrote:

But the command is not found!!!
/bin/sh: addvariant : not found

Now, How can I add -g option.

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I am using the older version 6.0!!! Can i copy the utility from 6.1 or do i
need to install 6.1?

“Chris McKillop” <cdm@qnx.com> wrote in message
news:9kmln1$qf8$3@nntp.qnx.com

What system are you doing this work on? From my 6.1 system…

cdm@katana → pkgctl which addvariant
— Information from /dev/pkginfo13 —
Localpath: [/usr/bin/addvariant]
Fullpath: [/pkgs/repository/qnx/os/devtools-2.1.2/usr/bin/addvariant]
Repository: [/pkgs/repository]
Vendor: [qnx/os/devtools-2.1.2]
Tree: [usr/bin/addvariant]


Are you using 6.1?

chris


JalajaDevi <> jganapat@storage.com> > wrote:

But the command is not found!!!
/bin/sh: addvariant : not found

Now, How can I add -g option.

\

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

JalajaDevi <jganapat@storage.com> wrote:

I am using the older version 6.0!!! Can i copy the utility from 6.1 or do i
need to install 6.1?

cd pcnet/x86
mkdir dll.g
cd dll.g
cp …/dll/Makefile .
make

-xtang

“Chris McKillop” <> cdm@qnx.com> > wrote in message
news:9kmln1$qf8$> 3@nntp.qnx.com> …
What system are you doing this work on? From my 6.1 system…

cdm@katana → pkgctl which addvariant
— Information from /dev/pkginfo13 —
Localpath: [/usr/bin/addvariant]
Fullpath: [/pkgs/repository/qnx/os/devtools-2.1.2/usr/bin/addvariant]
Repository: [/pkgs/repository]
Vendor: [qnx/os/devtools-2.1.2]
Tree: [usr/bin/addvariant]


Are you using 6.1?

chris


JalajaDevi <> jganapat@storage.com> > wrote:

But the command is not found!!!
/bin/sh: addvariant : not found

Now, How can I add -g option.

\

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL

Xiaodan Tang <xtang@qnx.com> wrote:

JalajaDevi <> jganapat@storage.com> > wrote:
I am using the older version 6.0!!! Can i copy the utility from 6.1 or do i
need to install 6.1?

cd pcnet/x86
mkdir dll.g
cd dll.g
cp …/dll/Makefile .
make

:slight_smile: True enough xtang!

chris

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

THIS REALLY HELPS TANG !! I GOT MY DEBUGGIN ENVT UP TO DEBUG MY DRIVER.
THANKS ALL

“Chris McKillop” <cdm@qnx.com> wrote in message
news:9kn7m1$8u2$1@nntp.qnx.com

Xiaodan Tang <> xtang@qnx.com> > wrote:

JalajaDevi <> jganapat@storage.com> > wrote:
I am using the older version 6.0!!! Can i copy the utility from 6.1 or
do i
need to install 6.1?

cd pcnet/x86
mkdir dll.g
cd dll.g
cp …/dll/Makefile .
make


:slight_smile: > True enough xtang!

chris

cdm@qnx.com > “The faster I go, the behinder I get.”
Chris McKillop – Lewis Carroll –
Software Engineer, QSSL