Skip to content

Commit e5bc135

Browse files
committed
Add basic 1.25 support #83
1 parent 0ead0ce commit e5bc135

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

build_test_files.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
trap "exit" INT
33
sudo rm -rf $(pwd)/test/build
4-
versions=("1.24" "1.23" "1.22" "1.21" "1.20" "1.19" "1.18" "1.17" "1.16" "1.15" "1.14" "1.13" "1.12" "1.11" "1.10" "1.9" "1.8" "1.7" "1.6" "1.5")
4+
versions=("1.25" "1.24" "1.23" "1.22" "1.21" "1.20" "1.19" "1.18" "1.17" "1.16" "1.15" "1.14" "1.13" "1.12" "1.11" "1.10" "1.9" "1.8" "1.7" "1.6" "1.5")
55
for v in "${versions[@]}"
66
do
77
GO_TAG=$v

debug/gosym/pclntab.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ func (t *LineTable) parsePclnTab(versionOverride string) {
264264
t.Version = possibleVersion
265265

266266
if len(versionOverride) > 0 {
267-
if strings.Contains(versionOverride, "1.24") ||
267+
if strings.Contains(versionOverride, "1.25") ||
268+
strings.Contains(versionOverride, "1.24") ||
268269
strings.Contains(versionOverride, "1.23") ||
269270
strings.Contains(versionOverride, "1.22") ||
270271
strings.Contains(versionOverride, "1.21") {

main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
_ "net/http/pprof"
1212
)
1313

14-
var versions = []string{"124", "123", "122", "121", "120", "119", "118", "117", "116", "115", "114", "113", "112", "111", "110", "19", "18", "17", "16", "15"}
14+
var versions = []string{"125", "124", "123", "122", "121", "120", "119", "118", "117", "116", "115", "114", "113", "112", "111", "110", "19", "18", "17", "16", "15"}
1515
var fileNames = []string{"testproject_lin", "testproject_lin_32", "testproject_lin_stripped", "testproject_lin_stripped_32", "testproject_mac", "testproject_mac_stripped", "testproject_win_32.exe", "testproject_win_stripped_32.exe", "testproject_win_stripped.exe", "testproject_win.exe"}
1616

1717
func TestAllVersions(t *testing.T) {

objfile/layouts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func getModuleDataLayout(version string) *ModuleDataLayout {
137137
// Map version to layout name (many versions share layouts)
138138
layoutName := version
139139
switch version {
140-
case "1.24", "1.23", "1.22", "1.21":
140+
case "1.25", "1.24", "1.23", "1.22", "1.21":
141141
layoutName = "1.21"
142142
case "1.20":
143143
layoutName = "1.20"
@@ -713,7 +713,7 @@ func getRtypeLayout(runtimeVersion string) *RtypeLayout {
713713
layoutName = "1.7"
714714
case "1.14", "1.15", "1.16", "1.17", "1.18", "1.19":
715715
layoutName = "1.14"
716-
case "1.20", "1.21", "1.22", "1.23", "1.24":
716+
case "1.20", "1.21", "1.22", "1.23", "1.24", "1.25":
717717
layoutName = "1.20"
718718
default:
719719
return nil
@@ -923,7 +923,7 @@ func getInterfaceLayout(version string) *InterfaceLayout {
923923
MethodsFormat: IFMethodsPre17,
924924
}
925925
case "1.7", "1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14",
926-
"1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24":
926+
"1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24", "1.25":
927927
return &InterfaceLayout{
928928
MethodsOffsetPtrs: 1, // pkgPath at +0, methods slice at +1
929929
PkgPathOffsetPtrs: 0,

objfile/layouts_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ func TestVersionMapping(t *testing.T) {
243243
{"1.22", "1.21"}, // 1.22 uses same layout as 1.21
244244
{"1.23", "1.21"}, // 1.23 uses same layout as 1.21
245245
{"1.24", "1.21"}, // 1.24 uses same layout as 1.21
246+
{"1.25", "1.21"}, // 1.25 uses same layout as 1.21
246247
{"1.20", "1.20"},
247248
{"1.18", "1.18"},
248249
{"1.19", "1.18"}, // 1.19 uses same layout as 1.18

objfile/objfile.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ func (e *Entry) ModuleDataTable(pclntabVA uint64, runtimeVersion string, version
288288
// with some higher versions using the same layout as versions before it.
289289
switch version {
290290
// Refactored: Go 1.16-1.24 use generic parser with layout tables
291+
case "1.25":
292+
fallthrough
291293
case "1.24":
292294
fallthrough
293295
case "1.23":
@@ -544,6 +546,8 @@ func (e *Entry) readRTypeName(runtimeVersion string, typeFlags tflag, namePtr ui
544546
case "1.23":
545547
fallthrough
546548
case "1.24":
549+
fallthrough
550+
case "1.25":
547551
varint_len, namelen, err := e.readVarint(namePtr + 1)
548552
if err != nil {
549553
return "", fmt.Errorf("Failed to read name")
@@ -1006,6 +1010,8 @@ func (e *Entry) ParseType_impl(runtimeVersion string, moduleData *ModuleData, ty
10061010
case "1.23":
10071011
fallthrough
10081012
case "1.24":
1013+
fallthrough
1014+
case "1.25":
10091015
var methodsStartAddr uint64 = typeAddress + uint64(_type.baseSize) + ptrSize
10101016
var methods GoSlice64 = GoSlice64{}
10111017
if is64bit {
@@ -1175,6 +1181,8 @@ func (e *Entry) ParseType_impl(runtimeVersion string, moduleData *ModuleData, ty
11751181
case "1.23":
11761182
fallthrough
11771183
case "1.24":
1184+
fallthrough
1185+
case "1.25":
11781186
// type structType struct {
11791187
// rtype
11801188
// pkgPath name // pointer

0 commit comments

Comments
 (0)