Skip to contentSkip to conversation

gdb'ing 32-bit executable on IA64

Linux-ia64 [email protected] 3 participants 8 messages Oct 30, 2002 – Nov 12, 2002

lore
Share & tools
lore
#0 lore raw

When I try to run a 32-bit executable in gdb on a IA-64 linux (RH 7.2), I can set the breakpoint fine but when I try to run it, I get an error "Can't insert breakpoint for slot numbers greater than 2"

What's the solution ??

Nitin Sane
[email protected]
(508) 382-7319

#1 lore raw

Nitin-

Use an IA32 gdb'. The standard gdb' on IA64 machines only deals with IA64 processes. All you have to do is copy `gdb' over from an IA32 machine and then use that to debug your IA32 processes.

Quoted 15 lines · On Wed, Oct 30, 2002 at 09:58:05AM -0500, [email protected] wrote:

When I try to run a 32-bit executable in gdb on a IA-64 linux (RH 7.2), I can set the breakpoint fine but when I try to run it, I get an error "Can't insert breakpoint for slot numbers greater than 2"

What's the solution ??

Nitin Sane
[email protected]
(508) 382-7319

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

Signature · 3 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]
#2 lore raw
In reply to [email protected]

Nitin-

I just remembered, there's one more gotcha you have to deal with to run gdb' on IA32 processes. gdb' uses the shell to actually execute the target program and, by default, it winds up using the IA64 version of the shell. This doesn't work.

What you have to do is spcify an IA32 shell through the SHELL' environment variable when using the IA32 gdb'. If all of the IA32 programs are in the directory `/usr/ia32/bin' then the following sommand should work:

	SHELL=/usr/ia32/bin/sh /usr/ia32/bin/gdb $*
Quoted 32 lines · Don Dugger

Nitin-

Use an IA32 gdb'. The standard gdb' on IA64 machines only deals with IA64 processes. All you have to do is copy `gdb' over from an IA32 machine and then use that to debug your IA32 processes.

Quoted 15 lines · On Wed, Oct 30, 2002 at 09:58:05AM -0500, [email protected] wrote:

When I try to run a 32-bit executable in gdb on a IA-64 linux (RH 7.2), I can set the breakpoint fine but when I try to run it, I get an error "Can't insert breakpoint for slot numbers greater than 2"

What's the solution ??

Nitin Sane
[email protected]
(508) 382-7319

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

Signature · 8 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Signature · 3 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]
#3 lore raw
In reply to [email protected]

David-

Maybe. I used the shell variable long before we had the IA32 working as seamlessly as it does today. I'll give this a try tonight and let you know what happens.

Quoted 22 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Don Dugger

Don> Nitin- I just remembered, there's one more gotcha you have to Don> deal with to run gdb' on IA32 processes. gdb' uses the shell Don> to actually execute the target program and, by default, it Don> winds up using the IA64 version of the shell. This doesn't Don> work.

Don> What you have to do is spcify an IA32 shell through the SHELL' Don> environment variable when using the IA32 gdb'. If all of the Don> IA32 programs are in the directory `/usr/ia32/bin' then the Don> following sommand should work:

Don> SHELL=/usr/ia32/bin/sh /usr/ia32/bin/gdb $*

Wouldn't it be much easier to copy the x86 version of bash into

	/emul/ia32-linux/bin/sh

?

	--david
Signature · 3 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]
#4 lore raw
In reply to [email protected]
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Don Dugger

Don> Nitin- I just remembered, there's one more gotcha you have to Don> deal with to run gdb' on IA32 processes. gdb' uses the shell Don> to actually execute the target program and, by default, it Don> winds up using the IA64 version of the shell. This doesn't Don> work.

Don> What you have to do is spcify an IA32 shell through the SHELL' Don> environment variable when using the IA32 gdb'. If all of the Don> IA32 programs are in the directory `/usr/ia32/bin' then the Don> following sommand should work:

Don> SHELL=/usr/ia32/bin/sh /usr/ia32/bin/gdb $*

Wouldn't it be much easier to copy the x86 version of bash into

	/emul/ia32-linux/bin/sh

?

	--david
#5 lore raw
In reply to [email protected]

David-

Nope, that didn't work. I'm running a 2.4.18 kernel, the EMUL_PREFIX_LINUX_IA32 is set to emul/ia32-linux/', I put the IA32 version of sh' into /emul/ia32-linux/bin/sh' and the IA32 gdb' didn't work. Do you think this is something we need to worry about or is it just a quirk of `gdb'?

Quoted 22 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Don Dugger

Don> Nitin- I just remembered, there's one more gotcha you have to Don> deal with to run gdb' on IA32 processes. gdb' uses the shell Don> to actually execute the target program and, by default, it Don> winds up using the IA64 version of the shell. This doesn't Don> work.

Don> What you have to do is spcify an IA32 shell through the SHELL' Don> environment variable when using the IA32 gdb'. If all of the Don> IA32 programs are in the directory `/usr/ia32/bin' then the Don> following sommand should work:

Don> SHELL=/usr/ia32/bin/sh /usr/ia32/bin/gdb $*

Wouldn't it be much easier to copy the x86 version of bash into

	/emul/ia32-linux/bin/sh

?

	--david
Signature · 3 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]
#6 lore raw
In reply to [email protected]
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Don Dugger

Don> David- Nope, that didn't work. I'm running a 2.4.18 kernel, Don> the EMUL_PREFIX_LINUX_IA32 is set to emul/ia32-linux/', I put Don> the IA32 version of sh' into /emul/ia32-linux/bin/sh' and the Don> IA32 gdb' didn't work. Do you think this is something we need Don> to worry about or is it just a quirk of `gdb'?

Hmmh, to be honest, I always have used gdb.x86 without doing anything special about the shell and it always worked for me. Perhaps we're using different gdb versions or we're doing something differently? I seem to be using "gdb 5.0rh-5" from x86 Red Hat 7.1.

	--david
#7 lore raw
In reply to [email protected]

David-

Duh, cockpit error on my part. Turns out I run with SHELL set to /bin/bash'. I copied the IA32 version of bash' to the `emul' directory and everything works just fine.

Quoted 14 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Don Dugger

Don> David- Nope, that didn't work. I'm running a 2.4.18 kernel, Don> the EMUL_PREFIX_LINUX_IA32 is set to emul/ia32-linux/', I put Don> the IA32 version of sh' into /emul/ia32-linux/bin/sh' and the Don> IA32 gdb' didn't work. Do you think this is something we need Don> to worry about or is it just a quirk of `gdb'?

Hmmh, to be honest, I always have used gdb.x86 without doing anything special about the shell and it always worked for me. Perhaps we're using different gdb versions or we're doing something differently? I seem to be using "gdb 5.0rh-5" from x86 Red Hat 7.1.

	--david
Signature · 3 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]