[Vm-dev] Help Request: gdb usage et al

ken.dickey at whidbey.com ken.dickey at whidbey.com
Thu Jul 28 20:20:19 UTC 2022


Greetings,

I am trying to gain runtime info for use of Alien on a RiscV64 Linux 
system, but [A] I have barely used gdb in the last couple of decades and 
[B] have hardly used Squeak in a decade or so, and [C] never used Alien.

With that confession out of the way.. my proximate problem is trying to 
set a breakpoint in a thunk to capture where things are going into the 
weeds.

The attached file has the gritty details.  I am trying 
Alien>>exampleCqsort

The Smalltalk setup code is copying a hand assembled byteVector into an 
Alien.  I am catching the copy operation in gdb in IA32ABI.c: 
primAlianReplace to get the code address, then trying to set a 
breakpoint there -- which seems to fail.  Get SIGILL (illegal 
instruction) when the PC gets to the start of the thunk.

So:
   [A] How do I find out if the thunk memory is properly Executable?
   [B] RiscV64 is little-endian.  Are the bytes correctly ordered?
   [C] Is the math right for accessing the primEntryThunkAddress at 
thunkStart+0x28 ?

Any help appreciated.

Thanks a bunch,
-KenD

PS: I like to feel the bits between my toes, but don't like getting them 
caught in my teeth!  ;^)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bugInfo.txt
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220728/720c02eb/attachment.txt>


More information about the Vm-dev mailing list